move the macros to a separate file so they can be imported safely
This commit is contained in:
Родитель
02bfe8df2b
Коммит
5c1c5686f8
|
@ -123,14 +123,14 @@ def tags_box(context, addon, dev_tags, user_tags):
|
|||
return c
|
||||
|
||||
|
||||
@register.inclusion_tag('addons/listing_items.html')
|
||||
@register.inclusion_tag('addons/listing/items.html')
|
||||
@jinja2.contextfunction
|
||||
def addon_listing_items(context, addons, show_added_date=False):
|
||||
"""`show_added_date` will show the added versus the updated date."""
|
||||
return new_context(**locals())
|
||||
|
||||
|
||||
@register.inclusion_tag('addons/listing_items_compact.html')
|
||||
@register.inclusion_tag('addons/listing/items_compact.html')
|
||||
@jinja2.contextfunction
|
||||
def addon_listing_items_compact(context, addons, show_added_date=False):
|
||||
"""`show_added_date` will show the added versus the updated date."""
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{% from "addons/listing/macros.html" import heading, item_info %}
|
||||
{% cache addons %}
|
||||
{% for addon in addons %}
|
||||
{% cache addon %}
|
||||
<div class="item">
|
||||
{{ heading(addon) }}
|
||||
<div class="item-info">
|
||||
{{ install_button(addon) }}
|
||||
{{ item_info(addon, amo) }}
|
||||
</div>
|
||||
<blockquote>
|
||||
<div>{{ addon.description|truncate(250)|nl2br }}</div>
|
||||
{{ support_addon(addon) }}
|
||||
</blockquote>
|
||||
</div>
|
||||
{% endcache %}
|
||||
{% endfor %}
|
||||
{% endcache %}
|
|
@ -1,4 +1,4 @@
|
|||
{% from "addons/listing_items.html" import heading, item_info %}
|
||||
{% from "addons/listing/macros.html" import heading, item_info %}
|
||||
|
||||
{% cache addons %}
|
||||
{% for addon in addons %}
|
|
@ -32,21 +32,3 @@
|
|||
</p>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% cache addons %}
|
||||
{% for addon in addons %}
|
||||
{% cache addon %}
|
||||
<div class="item">
|
||||
{{ heading(addon) }}
|
||||
<div class="item-info">
|
||||
{{ install_button(addon) }}
|
||||
{{ item_info(addon, amo) }}
|
||||
</div>
|
||||
<blockquote>
|
||||
<div>{{ addon.description|truncate(250)|nl2br }}</div>
|
||||
{{ support_addon(addon) }}
|
||||
</blockquote>
|
||||
</div>
|
||||
{% endcache %}
|
||||
{% endfor %}
|
||||
{% endcache %}
|
2
media/js
2
media/js
|
@ -1 +1 @@
|
|||
Subproject commit 40b6a3f3e2c392e71a4f6f817b44e583110f7546
|
||||
Subproject commit e70abe79eb3b34ae5da51e284cb7ddf1e8819241
|
Загрузка…
Ссылка в новой задаче