diff --git a/apps/addons/helpers.py b/apps/addons/helpers.py index c2be9ec0ba..fa6fa1bcb9 100644 --- a/apps/addons/helpers.py +++ b/apps/addons/helpers.py @@ -82,3 +82,11 @@ def contribution(addon, text='', src='', show_install=False, show_help=True): 'has_suggested': bool(addon.suggested_amount), 'pledge': pledge, })) + + +@register.inclusion_tag('addons/listing_items.html') +@jinja2.contextfunction +def addon_listing_items(context, addons): + c = dict(context.items()) + c['addons'] = addons + return c diff --git a/apps/addons/templates/addons/home.html b/apps/addons/templates/addons/home.html index 5f3a5f0acf..3911e52191 100644 --- a/apps/addons/templates/addons/home.html +++ b/apps/addons/templates/addons/home.html @@ -62,43 +62,7 @@
{% for key, addons in addon_sets.items() %}
- {% for addon in addons %} - {% cache addon %} -
-
Install button
-

- {{ addon.name }} - - {% trans users=users_list(addon.authors.all()) %} - by {{ users }} - {% endtrans %} - -

- - {{ addon.name }} - -
- {{ addon.description|truncate(250) }} -
-
- {{ addon|reviews_link }} - - {% with num=addon.weekly_downloads %} - {# L10n: {0} is the number of downloads. #} - {{ ngettext("{0} weekly download", - "{0} weekly downloads", - num)|f(num|numberfmt)|safe }} - {% endwith %} - - - {{ _('Updated {0}')|f(addon.last_updated|datetime) }} - - {{ support_addon(addon) }} -
-
- {% endcache %} - {% endfor %} + {{ addon_listing_items(addons) }}