-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHaialarm Archiv.twig
78 lines (61 loc) · 3.96 KB
/
Haialarm Archiv.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{#
see it working on http://haialarm-podcast.de/archiv-2/
#}
<p>{{ podcast.summary }}</p>
{% set total = 0 %}
{% for episode in podcast.episodes %}
{% set total = total + episode.duration.totalMilliseconds %}
{% endfor %}
{% set Durchschnittslänge = total / podcast.episodes|length %}
{% set hours = total // (1000 * 3600) %}
{% set minutes = (total // (1000 * 60)) % 60 %}
{% set seconds = (total // 1000) % 60 %}
{% if hours < 10 %}
{% set hours = "0" ~ hours %}
{% endif %}
{% if minutes < 10 %}
{% set minutes = "0" ~ minutes %}
{% endif %}
{% if seconds < 10 %}
{% set seconds = "0" ~ seconds %}
{% endif %}
{% set durchschnitthours = Durchschnittslänge // (1000 * 3600) %}
{% set durchschnittminutes = (Durchschnittslänge // (1000 * 60)) % 60 %}
{% set durchschnittseconds = (Durchschnittslänge // 1000) % 60 %}
{% if durchschnitthours < 10 %}
{% set durchschnitthours = "0" ~ durchschnitthours %}
{% endif %}
{% if durchschnittminutes < 10 %}
{% set durchschnittminutes = "0" ~ durchschnittminutes %}
{% endif %}
{% if durchschnittseconds < 10 %}
{% set durchschnittseconds = "0" ~ durchschnittseconds %}
{% endif %}
{% set Downloadsumme = 0 %}
{% set Episodenzaehler = podcast.episodes|length %}
{% for episode in podcast.episodes %}
{% set Downloadsumme = Downloadsumme + episode.total_downloads %}
{% endfor %}
{% set Durchschnitt = Downloadsumme / Episodenzaehler %}
<p style="margin-bottom:20px">{{ podcast.title }} besteht aus {{ Episodenzaehler }} Episoden. Ihre Gesamtdauer beträgt {{ hours }} Stunden {{ minutes }} Minuten und {{ seconds }} Sekunden. Die durchschnittliche Episode ist {{ durchschnitthours }} Stunden {{ durchschnittminutes }} und {{ durchschnittseconds }} Sekunden lang und wurde im Durchschnitt {{ Durchschnitt|round }} mal heruntergeladen. </p>
<ul style="list-style-type:none">
{% for episode in podcast.episodes %}
<li style="margin-bottom:20px"><span style="font-weight:bold;font-size:1.5em"><a href="{{ episode.url }}">{{ episode.post.post_title }}</a></span><br /><span style="font-weight:italic">{{ episode.subtitle }}</span><br /><small><span class="podlove-duration" style="margin-right:20px"><img src="http://icons.joernschaar.de/dauer.png" alt="Die Dauer der Episode" title="Die Dauer der Episode" width="20px"> {{ episode.duration }}</span><span class="podlove-duration" style="margin-right:20px"><img src="http://icons.joernschaar.de/kalender.png" alt="Diese Episode erschien am" title="Diese Episode erschien am" width="20px"> {{ episode.publicationdate.format('d.m.Y') }}</span><span class="podlove-duration"><img src="http://icons.joernschaar.de/downloads.png" alt="Downloads seit Veröffentlichung" title="Downloads seit Veröffentlichung" width="20px"> {{ episode.total_downloads | number_format(0, ',', '.') }} Downloads</span> </small><br /><b>Moderation:</b>
{# ATTENTION! From Podlove Publisher 3.0 you should use episode.post_title to access the title of your post title! #}
{% for contributor in episode.contributors({group:"macher",order: "ASC", orderby: "name"}) if contributor.visible %}
<span class="name">{{ contributor.name }}</span></span>{% if not loop.last %}, {% else %}. {% endif %}
{% endfor %}
{% if episode.contributors({group:"unterstuetzer"})|length > 0 %}
<strong>Danke an:</strong>
{% for contributor in episode.contributors({group:"unterstuetzer",order: "ASC", orderby: "name"}) if contributor.visible %
<span class="name">{{ contributor.name }} für {{ contributor.comment }}</span></span>{% if not loop.last %}, {% else %}. {% endif %}
{% endfor %}
{% endif %}
{% if episode.contributors({group:"studios"})|length > 0 %}
Sowie
{% for contributor in episode.contributors({group:"studios"}) if contributor.visible %}
<span class="name">{{ contributor.name }} ({{ contributor.comment }})</span></span>{% if not loop.last %}, {% else %}. {% endif %}
{% endfor %}
{% endif %}</li>
{% endfor %}
</ul>