Commit 1af0138c authored by fred's avatar fred
Browse files

performance: use template tags for episode resume and detail fragments

parent 0b880f9f
......@@ -8,6 +8,27 @@ register = template.Library()
def zip_lists(a, b):
return zip(a, b)
@register.inclusion_tag('episodes/resume.html', takes_context=True)
def episode_resume(context, date=None):
return {
'episode': context.get('episode'),
'date': date,
}
@register.inclusion_tag('episodes/inline.html', takes_context=True)
def episode_inline(context, date=None):
return {
'episode': context.get('episode'),
'date': date,
}
@register.inclusion_tag('emissions/detail.html', takes_context=True)
def emission_detail(context, date=None):
return {
'emission': context.get('emission'),
'schedules': context.get('schedules'),
}
@register.inclusion_tag('includes/player.html', takes_context=False)
def player():
return {'unique': uuid.uuid4()}
{% extends "base.html" %}
{% load paniktags %}
{% block bodyID %}Emissions{% endblock %}
{% block main %}
<div class="emission padded">
<div class="wrapper half">
<div id="Emission-tabs-detail">
{% include "emissions/detail.html" %}
{% emission_detail %}
</div>
<div id="Emission-tabs-episodes" class="episodes">
{% if episodes %}
......@@ -15,9 +16,9 @@
{% for episode in month.list %}
{% if episode.title == episodes.0.title %}
<li>{% include "episodes/resume.html" with date="daytime" %}</li>
<li>{% episode_resume date="daytime"%}</li>
{% else %}
<li>{% include "episodes/inline.html" with date="daytime" %}</li>
<li>{% episode_inline date="daytime" %}</li>
{% endif %}
{% endfor %}
</ul>
......
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