Commit d683ab2b authored by fred's avatar fred
Browse files

performance: turn news 'inline' template into a template tag

parent 8657e6b1
......@@ -36,3 +36,11 @@ def player():
@register.inclusion_tag('includes/metaNav.html', takes_context=False)
def metanav():
return {}
@register.inclusion_tag('news/inline.html', takes_context=False)
def news_inline(content=None, klass=None, logo=None):
return {
'content': content,
'class': klass,
'logo': logo
}
{% extends "base.html"%}
{% load paniktags %}
{% block bodyID %}News{% endblock %}
{% block title %}News{% endblock %}
{% block nav %}
......@@ -21,11 +22,11 @@
{% for NewsItem in newsImaged %}
<li class="item num-{{forloop.counter}}">
{% if NewsItem.slug == newsImaged.0.slug %}
{% include "news/inline.html" with content=NewsItem class="special" logo="large"%}
{% news_inline content=NewsItem klass="special" logo="large" %}
{% elif NewsItem.slug == newsImaged.1.slug or NewsItem.slug == newsImaged.2.slug%}
{% include "news/inline.html" with content=NewsItem class="special" logo="medium"%}
{% news_inline content=NewsItem klass="special" logo="medium"%}
{% else %}
{% include "news/inline.html" with content=NewsItem%}
{% news_inline with content=NewsItem%}
{% endif %}
</li>
{% endfor %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment