-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWIYP-Archiv.twig
58 lines (47 loc) · 4.94 KB
/
WIYP-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
{# See it working http://whats-in-your-pants.de/podcast-archiv/ #}
<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 %}
{% set durchschnitthours = Durchschnittslänge // (1000 * 3600) %}
{% set durchschnittminutes = (Durchschnittslänge // (1000 * 60)) % 60 %}
{% set durchschnittseconds = (Durchschnittslänge // 1000) % 60 %}
{% 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>"{{ podcast.title }}" besteht aus {{ podcast.episodes|length }} veröffentlichten Episoden. {% if podcast.episodes({post_status: 'future'})|length > 0 %} {{ podcast.episodes({post_status: 'future'})|length }} {% if podcast.episodes({post_status: 'future'})|length == 1 %}wird {% else %} werden {% endif %} demnächst veröffentlicht.{% endif %} {% if podcast.episodes({post_status: 'draft'})|length > 0 %} {{ podcast.episodes({post_status: 'draft'})|length }} weitere {% if podcast.episodes({post_status: 'draft'})|length == 1 %} liegt{% else %} liegen{% endif %} als Entwurf vor.{% endif %}</p>
<p>Die Gesamtdauer aller veröffentlichten Episoden beträgt {{ hours }} Stunden {{ minutes }} {% if minutes == 1%}Minute{% else %}Minuten{% endif %} und {{ seconds }} {% if minutes == 1%}Sekunde{% else %}Sekunden{% endif %}. Die durchschnittliche Episode ist {% if durchschnitthours > 0 %}{{ durchschnitthours }} {% if durchschnitthours == 1%}Stunde{% else %}Stunden{% endif %}{% endif %} {{ durchschnittminutes }} {% if durchschnittminutes == 1%}Minute{% else %}Minuten{% endif %} und {{ durchschnittseconds }} {% if durchschnittseconds == 1%}Sekunde{% else %}Sekunden{% endif %} lang und wurde im Durchschnitt {{ Durchschnitt|round }} mal heruntergeladen. </p>
{% for episode in podcast.episodes({post_status: 'future'}) %}
<p>Die nächste Episode <b>"{{ episode.post.post_title }}"</b> wird am {{ episode.publicationDate.format('j. F Y') }} um {{ episode.publicationDate.format('H:i') }} Uhr erscheinen{% if episode.chapters|length > 0 %}, Themen sind unter anderem {% for chapter in episode.chapters|slice(2,5) %} "{{ chapter.title }}"{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}. {% if episode.duration.totalMilliseconds > 0 %} Die Episode ist {{ episode.duration }} lang, aber darauf kommt es ja bekanntlich nicht an. {% endif %}</p>
{% endfor %}
<h2>Inhaltsverzeichnis:</h2>
<p>Klicke auf den Titel der Staffel, um zu ihrer Episodenliste zu gelangen.</p>
<ul>
{% for season in podcast.seasons %}
<li><a href="#{{ season.number }}">{{ season.title }}</a></li>
{% endfor %}
</ul>
{% for season in podcast.seasons %}
<h2 id="{{ season.number }}">{{ season.title }} - {{ season.subtitle }}</h2>
<p>{{ season.summary }}</p>
<p>Die Staffel ist am {{ season.startDate.format('d.m.Y') }} gestartet. Die erste Episode hieß "{{ season.firstEpisode.title }}" und wir haben sie am {{ season.firstEpisode.recordingDate.format('d.m.Y') }} aufgenommen. Staffel {{ season.number }} hat {{ season.episodes|length }} Episoden.</p>
<h3>Episodenliste:</h3>
{% for episode in season.episodes %}
<h4><a href="{{ episode.url }}">{{ episode.post.post_title }}</a></h4>
{# ATTENTION! Starting with Podlove Publisher 3.0 you should use episode.post_title instead of episode.post.post_title #}
<p style="margin-bottom:20px;padding-bottom:15px;border-bottom:1px solid black">{{ episode.summary }}<br />
<small><span style="margin-right:25px">Aufgenommen am: {{ episode.recordingdate.format('d.m.Y') }}</span> <span style="margin-right:25px">Veröffentlicht am: {{ episode.publicationdate.format('d.m.Y') }} um {{ episode.publicationdate.format('H:i') }} Uhr.</span> <span style="margin-right:25px">Dauer: {{ episode.duration }}</span>Downloads: {{ episode.total_downloads | number_format(0, ',', '.') }}</small></p>
{% if loop.last %}
<div style="{{ random(['background-color:#A0DE5A;color:#27024E', 'background-color:#58D58C;color:#071020', 'background-color:#250209;color:#E36A15', 'background-color:#F27A17;color:#2F2907', 'background-color:#F2FEBA;color:#8B6E22', 'background-color:#0c0f84;color:#fcda48', 'background-color:#8ef174;color:#162e64']) }};padding-top:20px;padding-bottom:20px;padding-left:25px;padding-right:35px;text-align:center"><h3>Kauft Tobys Merch!</h3>
<strong>T-Shirts, Hoodies, Tassen usw. findet Ihr auf <a href="https://podcastnikshop.com/collections/whats-in-your-pants" target="_blank" style="color:#AE2773">podcastnikshop.com</a>!</strong></div>
{% endif %}
{% endfor %}
{% endfor %}