forked from poschi3/podlove-publisher-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlatest-episodes.twig
138 lines (136 loc) · 4.49 KB
/
latest-episodes.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{% set list = network.lists({id: "LFN"}) %}
{% set icon_size = 64 %}
<style>
.podcast_table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
font-size: 16px;
font-family: Arial, sans-serif;
color: #333;
}
.podcast_table thead th {
background-color: #0073e6;
color: #fff;
padding: 15px;
text-align: left;
}
.podcast_table tbody tr:nth-child(even) {
background-color: #f9f9f9;
}
.podcast_table tbody tr:hover {
background-color: #e6f7ff;
}
.podcast_table th, .podcast_table td {
padding: 15px;
border: 1px solid #ddd;
vertical-align: top;
}
.podcast_table .thumbnail img {
border-radius: 8px;
width: 100%;
}
.podcast_table .title a {
color: #0073e6;
text-decoration: none;
font-weight: bold;
}
.podcast_table .title a:hover {
text-decoration: underline;
}
.podcast_table .duration {
color: #666;
}
@media (max-width: 768px) {
.podcast_table thead {
display: none;
}
.podcast_table, .podcast_table tbody, .podcast_table tr, .podcast_table td {
display: block;
width: 100%;
}
.podcast_table tr {
margin-bottom: 15px;
}
.podcast_table td {
text-align: right;
padding-left: 50%;
position: relative;
}
.podcast_table td::before {
content: attr(data-label);
position: absolute;
left: 15px;
width: calc(50% - 30px);
white-space: nowrap;
text-align: left;
font-weight: bold;
}
.podcast_table .thumbnail {
text-align: center;
padding: 15px;
}
.podcast_table .thumbnail img {
width: auto;
}
}
</style>
{% if list is defined %}
<h2>{{ list.title }}</h2>
<table class="podcast_table">
<thead>
<tr>
<th style="width: {{ icon_size + 10 }}px">Episode</th>
<th style="width: {{ icon_size + 10 }}px">Podcast</th>
<th>Titel</th>
<th>Dauer & Beschreibung</th>
</tr>
</thead>
<tbody>
{% set episodes = list.episodes({limit: 50, orderby: 'post_date', order: 'DESC'}) %}
{% if episodes is not empty %}
{% for episode in episodes %}
{% set podcast = episode.podcast %}
<tr class="podcast_archive_element">
<!-- Episode Thumbnail -->
<td class="thumbnail" data-label="Episode">
{% if episode.image %}
<a href="{{ episode.url }}">
{{ episode.image.html({retina: true, width: icon_size, title: episode.title}) }}
</a>
{% endif %}
</td>
<!-- Podcast Thumbnail -->
<td class="thumbnail" data-label="Podcast">
<a href="{{ podcast.landingPageUrl }}">
{{ podcast.image.html({retina: true, width: icon_size, title: podcast.title}) }}
</a>
</td>
<!-- Episode and Podcast Title -->
<td class="title" data-label="Titel">
<a href="{{ episode.url }}">
<strong>{{ episode.title }}</strong>
</a>
<br/>
<strong>{{ podcast.title }}</strong>
<br/>
{{ episode.publicationDate }}
</td>
<!-- Episode Duration and Subtitle -->
<td class="duration" data-label="Dauer & Beschreibung">
{{ episode.duration }}
<br/>
<i>{{ episode.subtitle }}</i>
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="4">Keine Episoden gefunden.</td>
</tr>
{% endif %}
</tbody>
</table>
{% else %}
<p>Keine Liste gefunden.</p>
{% endif %}