+ {{ addon.name }} + {{ version.version }} +
+{{ _('by') }} {{ users_list(addon.listed_authors) }}
+ +{{ addon.summary|nl2br }}
+ {{ big_install_button(addon, show_warning=False) }} +diff --git a/apps/addons/helpers.py b/apps/addons/helpers.py index 890c36e61e..9424d6f9f4 100644 --- a/apps/addons/helpers.py +++ b/apps/addons/helpers.py @@ -57,10 +57,34 @@ def performance_note(context, amount, listing=False): return new_context(**locals()) +@register.inclusion_tag('addons/impala/performance_note.html') +@jinja2.contextfunction +def impala_performance_note(context, amount, listing=False): + return new_context(**locals()) + + @register.inclusion_tag('addons/contribution.html') @jinja2.contextfunction def contribution(context, addon, text=None, src='', show_install=False, - show_help=True): + show_help=True, large=False): + """ + Show a contribution box. + + Parameters: + addon + text: The begging text at the top of the box. + src: The page where the contribution link is coming from. + show_install: Whether or not to show the install button. + show_help: Show "What's this?" link? + """ + has_suggested = bool(addon.suggested_amount) + return new_context(**locals()) + + +@register.inclusion_tag('addons/impala/contribution.html') +@jinja2.contextfunction +def impala_contribution(context, addon, text=None, src='', show_install=False, + show_help=True, large=False): """ Show a contribution box. diff --git a/apps/addons/models.py b/apps/addons/models.py index e5955fc672..971ea3d3c5 100644 --- a/apps/addons/models.py +++ b/apps/addons/models.py @@ -346,7 +346,9 @@ class Addon(amo.models.OnChangeMixin, amo.models.ModelBase): return urls - def get_url_path(self): + def get_url_path(self, impala=False): + if impala: + return reverse('addons.i_detail', args=[self.slug]) return reverse('addons.detail', args=[self.slug]) def meet_the_dev_url(self): diff --git a/apps/addons/templates/addons/impala/addon_grid.html b/apps/addons/templates/addons/impala/addon_grid.html index 91580ce1a4..eb2f012bc3 100644 --- a/apps/addons/templates/addons/impala/addon_grid.html +++ b/apps/addons/templates/addons/impala/addon_grid.html @@ -6,7 +6,7 @@ {% for addon in page %}
+ {% if has_suggested %} + {% trans amt = addon.suggested_amount|currencyfmt('USD') %} + {{ amt }} suggested + {% endtrans %} + {% endif %} +
{# /suggestion #} ++ {% if text %} + {{ text }} + {% elif not addon.charity %} + {{ _('The developer of this add-on asks that you help support its ' + 'continued development by making a small contribution.') }} + {% elif addon.charity_id == amo.FOUNDATION_ORG %} + {% trans %} + The developer of this add-on asks that you show your support + by making a donation to the {{ charity_name }}. + {% endtrans %} + {% else %} + {% trans %} + The developer of this add-on asks that you show your support + by making a small contribution to {{ charity_name }}. + {% endtrans %} + {% endif %} +
+ ++ {% if addon.charity %} + {% if addon.charity_id == amo.FOUNDATION_ORG %} + {% trans %} + The developer of this add-on would like you to consider making a + donation to the {{ charity_name }} + if you enjoy using it. + {% endtrans %} + {% else %} + {% trans %} + The developer of this add-on would like you to consider making a + small contribution to {{ charity_name }} + if you enjoy using it. + {% endtrans %} + {% endif %} + {% else %} + {% trans %} + Mozilla is committed to supporting a vibrant and healthy developer + ecosystem. Your optional contribution helps sustain further development + of this add-on. + {% endtrans %} + {% endif %} +
+{{ addon.summary|nl2br }}
+ {{ big_install_button(addon, show_warning=False) }} +{{ addon.description|nl2br }}
++ {% trans amount=amount|int %} + Installing this add-on can slow down + Firefox's start-up by {{ amount }}%. + {% endtrans %} + {{ _('Learn more…')|safe }} +
+t |