use django.contrib.staticfiles everywhere
[mygpo.git] / mygpo / web / templates / podcast.html
blob666876f7f2294333e6f7ee07660bff49ffa7c6af
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load humanize %}
4 {% load episodes %}
5 {% load podcasts %}
6 {% load devices %}
7 {% load charts %}
8 {% load facebook %}
9 {% load google %}
10 {% load utils %}
11 {% load static %}
12 {% load menu %}
13 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
14 {% block sectionmenu %}
15 {% if podcast.title %}
16 {{ "/podcast/"|section_menu:podcast.title }}
17 {% else %}
18 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
19 {% endif %}
20 {% endblock %}
22 {% block head %}
23 {{ podcast|opengraph_podcast }}
24 {% google_plus_one_head %}
25 {% endblock %}
27 {% block title %}{{ podcast.title|default:"Unnamed Podcast"|striptags }}{% endblock %}
29 {% block header %}
31 {% if podcast.logo_url %}
32 <div id="podcastlogo">{{ podcast|podcast_logo_big }}</div>
33 {% endif %}
35 <h1>
36 {% if podcast.title %}
37 {{ podcast.title|striptags }}
38 {% else %}
39 {% trans "Unnamed Podcast" %}
40 {%endif%}
41 </h1>
43 <small class="description">
44 {% if podcast.author %}{% trans "by" %}
45 {{ podcast.author|striptags }}
46 {% endif %}
47 {% if podcast.twitter %}
48 <a href="https://twitter.com/{{ podcast.twitter|striptags }}"><i class="icon-twitter"></i></a>
49 {% endif %}&middot;
50 <a href="{{podcast.url}}" title="{% trans "Feed" %}">
51 <i class="icon-rss"></i>
52 </a>
53 {% if podcast.link %}&middot;
54 <a href="{{podcast.link}}" title="{% trans "Website" %}">
55 <i class="icon-external-link"></i>
56 </a>
57 {% endif %}
58 {% if podcast.subscriber_count %}&middot;
59 {{ podcast.subscriber_count }} {% trans "subscribers" %}
60 {% endif %}
61 </small>
63 {% if related_podcasts %}
64 <div class="related-podcasts">
65 <strong>{% trans "Also available" %}</strong>
66 {% for p in related_podcasts %}
67 {% if p.group_member_name != podcast.group_member_name %}
68 {% podcast_group_link p p.group_member_name %}
69 {% endif %}
70 {% endfor %}
71 </div>
72 {% endif %}
74 {% if podcast.description %}
75 <div class="description" {% if podcast.language %}lang="{{ podcast.language }}"{% endif %}>
76 {{ podcast.description|markdown }}
77 </div>
78 {% endif %}
80 {% endblock %}
84 {% block content %}
86 {% if episode %}
87 <div class="first-episode">
89 <h2>{{ episode.title }} <small>{{ episode.released|naturalday }}</small></h2>
90 <div class="description" {% if episode.language or podcast.language %}lang="{% firstof episode.language podcast.language %}"{% endif %}>
91 {{ episode.description|default:""|truncatewords:"100"|markdown }}
92 </div>
93 <a href="{% episode_link_target episode podcast %}">more...</a>
95 </div>
96 {% endif %}
98 {% if episodes %}
100 <h3>{% trans "Older Episodes" %}</h3>
101 <table class="list episode_list" id="episodes">
102 <tr>
103 <th></th>
104 <th>{% trans "Title" %}</th>
105 <th>{% trans "Released" %}</th>
106 <th>{% trans "Listeners" %}</th>
107 </tr>
109 {% for episode in episodes %}
110 <tr>
111 <td>{{ episode.action|episode_status_icon }}</td>
112 <td class="short">
113 <div class="title">{% episode_link episode podcast %}</div>
114 <div class="description short">{{ episode.subtitle|default:episode.description|default:""|truncatewords:"20"|markdown|striptags }}</div>
115 </td>
116 <td>{{ episode.released|default:""|date:"Y-m-d" }}</td>
117 <td>
118 {% if episode.listeners %}
119 {% vertical_bar episode.listeners max_listeners %}
120 {% endif %}
121 </td>
122 </tr>
123 {% endfor %}
125 {% if not podcast.episode_count or podcast.episode_count > 20 %}
126 <tr>
127 <td></td>
128 <td>
129 <a href="{% podcast_link_target podcast "podcast-all-episodes" %}?page=2">{% trans "All Episodes" %}</a>
130 </td>
131 <td></td>
132 <td></td>
133 </tr>
134 {% endif %}
136 </table>
137 {% endif %}
139 {% endblock %}
142 {% block sidebar %}
144 {% if is_publisher %}
145 <div class="well">
146 <h4>{% trans "Publisher Pages" %}</h4>
148 <a class="btn" href="{% podcast_link_target podcast "podcast-publisher-detail" %}"><i class="icon-wrench"></i> {% trans "Go" %}</a>
149 </div>
150 {% endif %}
152 <div class="well">
153 <h4>{% trans "Subscriptions" %}</h4>
154 {% if not user.is_authenticated %}
155 <div class="subscribe">
156 <a href="{% podcast_link_target podcast "subscribe" %}">
157 <img src="{% static "subscribe.png" %}" style="vertical-align: middle;" alt=""/>
158 {% trans "Subscribe to this podcast" %}
159 </a>
160 </div>
161 {% endif %}
163 {% if devices or can_subscribe %}
164 <table class="list">
165 {% for device in devices %}
166 <tr>
167 <td>
168 {% if device %}
169 {{ device|device_icon }}
170 <a href="{% url "device" device.uid %}">{{ device.name|striptags }}</a>
171 {% endif %}
172 </td>
173 <td style="text-align: center;">
174 <form class="form-inline" method="post" action="{% podcast_link_target podcast "unsubscribe" device.uid %}?return_to={% podcast_link_target podcast %}">
175 {% csrf_token %}
176 <button class="btn btn-danger btn-small" type="submit">
177 <i class="icon-remove"></i>
178 </button>
179 </form>
180 </td>
181 </tr>
182 {% endfor %}
183 {% if can_subscribe %}
184 <tr>
185 <form class="form-inline" action="{% podcast_link_target podcast "subscribe" %}" method="post">
186 <td>
187 {% csrf_token %}
188 <select name="targets" id="id_targets">
189 {% for device in subscribe_targets %}
190 <option value="{{ device.uid }}">{{ device.name }}</option>
191 {% endfor %}
192 </select>
193 </td>
194 <td>
195 <button class="btn btn-success btn-small" type="submit">
196 <i class="icon-ok"></i>
197 </button>
198 </td>
199 </form>
200 </tr>
201 {% endif %}
202 </table>
203 {% endif %}
205 </div>
208 <div class="well">
209 <h4>Tags</h4>
211 {% for tag in tags %}
212 {% spaceless %}
213 {% if tag.is_own %}
214 <span class="own">{{ tag.tag }} <a class="remove" href="{% podcast_link_target podcast "remove-tag" %}?tag={{ tag.tag }}">X</a></span>
215 {% else %}
216 <span class="other">{{ tag.tag }}</span>
217 {% endif %}
218 {% if not forloop.last %}
219 <span class="seperator">,</span>
220 {% endif %}
221 {% endspaceless %}
222 {% endfor %}
224 {% if user.is_authenticated %}
225 <form class="form-inline" action="{% podcast_link_target podcast "add-tag" %}">
226 <div class="input-prepend btn-append">
227 <span class="add-on"><i class="icon-tag"></i></span><input class="input-small" type="text" name="tag" /><button class="btn btn-success" type="submit">
228 <i class="icon-plus"></i>
229 </button>
230 </div>
231 </form>
232 {% endif %}
233 </div>
235 <div class="well">
236 <h4>{% trans "Share" %}</h4>
238 {% google_plus_one_button %}
239 {{ podcast|fb_like_podcast }}
240 {% if can_flattr %}
241 <a href="{% podcast_link_target podcast "podcast-flattr" %}">
242 <img src="https://api.flattr.com/button/flattr-badge-large.png"
243 alt="Flattr {{ podcast.title|default:"Unnamed Podcast"|striptags }}" />
244 </a>
245 {% endif %}
247 </div>
250 {% if history %}
251 <div class="well">
252 <h4>{% trans "Subscription History" %}</h4>
253 <table class="list">
254 {% for s in history %}
255 <tr>
256 <td><abbr title="{{ s.timestamp }}">{{ s.timestamp|naturalday }}</abbr></td>
257 <td>{{ s|podcast_status_icon }}</td>
258 <td>
259 {% if s.device %}
260 <a href="{% url "device" s.device.uid %}">{{ s.device|device_icon }} {{ s.device.name|striptags }}</a>
261 {% endif %}
262 </td>
263 </tr>
264 {% endfor %}
265 </table>
266 </div>
267 {% endif %}
269 {% endblock %}
272 {% block ads %}
273 {% comment %}disable ads on podcast pages{% endcomment %}
274 {% endblock %}