Ghost/core/frontend/helpers
Rish 67bf3a77c1 Updated price helper to output well formatted prices
refs https://github.com/TryGhost/Team/issues/472

The current `{{price}}` helper only works with `amount` to convert it into right value but doesn't allow any formatting with currency etc, leaving most of the work to theme.  We want to be able to output well formatted prices. E.g. the API returns 5000 for 5 EUR but we want to output €5.

The updated {{price}} helper can take a plan object or plan amount currency and use them to output a well formatted price. It works with JS's built in Intl.NumberFormat behaviour to return output in different formats, also allowing theme devs to override formatting with options.

Examples:

With Plan object => `{{price plan}} → "€5"`
With Plan object and custom number format =>  `{{price plan numberFormat="long"}} → "€5.00"`
Output only currency symbol =>  `{{price currency='EUR'}} → "€"`
2021-02-25 13:01:24 +05:30
..
tpl Added paywall card to mark end of free content preview (#12663) 2021-02-17 23:00:26 +00:00
asset.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
author.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
authors.js Fixed "no-shadow" linting error in server modules (#12287) 2020-10-20 12:02:56 +13:00
body_class.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
cancel_link.js Updated links to ghost.org sites 2021-01-20 09:59:45 +13:00
concat.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
content.js Updated {{content}} helper partial template name 2021-02-09 13:59:52 +05:30
date.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
encode.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
excerpt.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
facebook_url.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
foreach.js Fixed "no-shadow" linting error in server modules (#12287) 2020-10-20 12:02:56 +13:00
get.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
ghost_foot.js Updated ghost_head & ghost_foot to work with tags 2020-07-10 14:20:24 +02:00
ghost_head.js Updated portal to include accent color in preview mode 2021-02-17 13:49:41 +00:00
has.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
img_url.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
index.js Improved helper index, use glob to read directory 2020-04-10 13:08:41 +01:00
is.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
lang.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
link_class.js Moved non-helper code out of helpers 2020-04-10 12:27:43 +01:00
link.js Moved non-helper code out of helpers 2020-04-10 12:27:43 +01:00
meta_description.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
meta_title.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
navigation.js Fixed "no-shadow" linting error in server modules (#12287) 2020-10-20 12:02:56 +13:00
page_url.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
pagination.js Updated links to ghost.org sites 2021-01-20 09:59:45 +13:00
plural.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
post_class.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
prev_post.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
price.js Updated price helper to output well formatted prices 2021-02-25 13:01:24 +05:30
raw.js Added raw handlebars helper 2020-04-06 17:26:50 +01:00
reading_time.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
t.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
tags.js Fixed "no-shadow" linting error in server modules (#12287) 2020-10-20 12:02:56 +13:00
title.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
twitter_url.js Moved helper proxy into a service 2020-04-08 17:22:44 +01:00
url.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00