Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Daron
panikweb
Commits
1af0138c
Commit
1af0138c
authored
Aug 24, 2013
by
fred
Browse files
performance: use template tags for episode resume and detail fragments
parent
0b880f9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
panikweb/paniktags/templatetags/paniktags.py
View file @
1af0138c
...
...
@@ -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
()}
panikweb_templates/templates/emissions/emission_detail.html
View file @
1af0138c
{% 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 "
emission
s/
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 "
episode
s/
resume
.html" with
date="daytime"
%}
</li>
<li>
{% episode
_
resume date="daytime"%}
</li>
{% else %}
<li>
{%
include "
episode
s/
inline
.html" with
date="daytime" %}
</li>
<li>
{% episode
_
inline date="daytime" %}
</li>
{% endif %}
{% endfor %}
</ul>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment