fix headers of sidebar boxes on episode page
[mygpo.git] / mygpo / web / templates / episode.html
blob43a3ee5bf1f8bf1391183d1d6794331309965fe9
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load humanize %}
4 {% load episodes %}
5 {% load devices %}
6 {% load podcasts %}
7 {% load mygpoutil %}
8 {% load time %}
9 {% load youtube %}
10 {% load flickr %}
11 {% load facebook %}
12 {% load google %}
13 {% load charts %}
14 {% load utils %}
16 {% load menu %}
17 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
18 {% block sectionmenu %}
19 {% if podcast.title %}
20 {{ "/podcast/"|section_menu:podcast.title }}
21 {% else %}
22 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
23 {% endif %}
24 {% endblock %}
26 {% block head %}
27 {% if episode.url|is_youtube_video %}
28 <script type="text/javascript" src="/media/js/swfobject.js"></script>
29 <script type="text/javascript" src="/media/js/json2.js"></script>
30 <script type="text/javascript" src="/media/js/youtube-handler.js"></script>
31 {% endif %}
32 {% opengraph_episode episode podcast %}
33 {% google_plus_one_head %}
35 {% endblock head %}
37 {% block title %}{{ episode.title|default:"Unnamed Episode"|striptags }} - {{ podcast.title|default:"Unnamed Podcast"|striptags}}{% endblock %}
39 {% block header %}
41 {% if podcast.logo_url %}
42 <div id="podcastlogo"><a href="{% podcast_link_target podcast %}">{{ podcast|podcast_logo_big }}</a></div>
43 {% endif %}
44 <h1>
45 {{ episode.title|default:"Unnamed Episode"|striptags }}
46 <small>{{ episode.released|naturalday }}</small>
47 </h1>
48 <small class="description">
49 {% trans "from" %} {% podcast_group_link podcast %},
50 {% trans "links" %}:
51 {% if not episode.outdated or "hide-outdated-urls" not in podcast.restrictions %}
52 <a href="{{episode.url}}">{% trans "download" %}</a>
53 {% endif %}
54 {% if episode.link and episode.link != episode.url %}
55 <a href="{{episode.link}}">{% trans "website" %}</a>
56 {% endif %},
57 {% trans "stats:" %} {% blocktrans with episode.listener_count as listener_count %}{{listener_count}} listeners{% endblocktrans %}
58 </small>
60 {% endblock %}
64 {% block content %}
66 {% if episode.content or episode.description %}
67 <div class="description">{{ episode.content|default:episode.description|markdown }}</div>
68 {% endif %}
70 {% if episode.url|is_youtube_video %}
71 <div id="ytapiplayer">
72 You need Flash player 8+ and JavaScript enabled to view this video.
73 </div>
74 {% endif %}
77 {% if episode.url|is_flickr_photo %}
78 {{ episode|embed_flickr_photo }}
79 {% endif %}
81 {% if episode|is_image %}
82 <img src="{{ episode.url }}" />
83 {% endif %}
85 {% if user.is_authenticated %}
87 {% if is_favorite %}
88 <a class="btn" href="{% episode_link_target episode podcast "episode-fav" %}">
89 <i class="icon-star"></i> {% trans "Remove Favorite" %}
90 </a>
91 {% else %}
92 <a class="btn" href="{% episode_link_target episode podcast "episode-fav" %}">
93 <i class="icon-star-empty"></i> {% trans "Favorite" %}
94 </a>
95 {% endif %}
97 {% if played_parts %}
98 <h3>Already played</h3>
99 {{ played_parts|episode_heatmap_visualization }}
100 {% endif %}
102 {% endif %}
104 <div class="pagination">
105 <ul>
106 {% if prev %}
107 <li>
108 {% episode_link prev podcast %}
109 </li>
110 {% endif %}
111 <li>
112 <a href="{% podcast_link_target podcast %}#episodes">{% trans "Episode-List" %}</a>
113 </li>
114 {% if next %}
115 <li>
116 {% episode_link next podcast %}
117 </li>
118 {% endif %}
119 </ul>
120 </div>
122 {% endblock %}
125 {% block sidebar %}
127 <div class="well">
129 <h4>Share</h4>
131 {% google_plus_one_button %}
132 {% fb_like_episode episode podcast %}
133 </div>
137 {% if user.is_authenticated or chapters %}
138 <div class="well">
140 <h4>{% trans "Chapters" %}</h4>
142 <table class="list">
143 <tr>
144 <th></th>
145 <th>{% trans "Ad?" %}</th>
146 <th>{% trans "Label" %}</th>
147 <th></td>
148 </tr>
150 {% for chapter in chapters %}
151 <tr {% if chapter.is_own %}class="own-chapter"{% endif %} >
152 <td>{{ chapter.start|sec_to_time|time:"H:i:s" }}{% if chapter.start != chapter.end %} - {{ chapter.end|sec_to_time|time:"H:i:s" }}{% endif %}</td>
153 <td>{% if chapter.advertisement %}Yes{% endif %}</td>
154 <td>{{ chapter.label }}</strong>
155 <td>
156 {% if chapter.is_own %}
157 <a href="{% episode_link_target episode "remove-chapter" chapter.start chapter.end %}">
158 <img src="/media/unsubscribe.png" alt="{% trans "Remove" %}" />
159 </a>
160 {% endif %}
161 </td>
162 </tr>
163 {% endfor %}
164 {% if user.is_authenticated %}
165 <tr>
166 <form class="form-inline" action="{% episode_link_target episode podcast "add-chapter" %}" method="POST">
167 {% csrf_token %}
168 <td>
169 <input type="text" name="start" id="start" class="time" placeholder="h:mm:ss"/> -
170 <input type="text" name="end" id="end" class="time" placeholder="h:mm:ss"/>
171 </td>
172 <td>
173 <input type="checkbox" name="advertisement" />
174 </td>
175 <td>
176 <input class="input-small" type="text" name="label" />
177 </td>
178 <td>
179 <input class="btn" type="submit" value="{% trans "Add" %}" />
180 </td>
181 </form>
182 </tr>
183 {% endif %}
184 </table>
185 </div>
186 {% endif %}
188 {% if user.is_authenticated or history %}
189 <div class="well">
190 <h4>{% trans "History" %}</h4>
191 <table class="list">
192 <tr>
193 <th>{% trans "Time" %}</th>
194 <th>{% trans "Action" %}</th>
195 <th>{% trans "Device" %}</th>
196 <th></th>
197 </tr>
199 {% for s in history %}
200 <tr>
201 <td><abbr title="{{ s.timestamp }}">{{ s.timestamp|naturalday }}</abbr></td>
202 <td style="text-align: center;">{{ s|episode_status_icon }}</td>
203 <td>
204 {% if s.device %}
205 <a href="{% url device s.device.uid %}">{{ s.device|device_icon }} {{ s.device.name|striptags }}</a>
206 {% endif %}
207 </td>
208 <td>{% if s.started or s.playmark %}{{s.started|format_time }} - {% endif %}
209 {% if s.playmark %}{{ s.playmark|format_time }}{% endif %}
210 </td>
211 </tr>
212 {% endfor %}
214 {% if user.is_authenticated %}
215 <tr>
216 <form action="{% episode_link_target episode podcast "add-episode-action" %}" method="POST">
217 {% csrf_token %}
218 <td>
219 <input class="input-small" type="text" id="timestamp" name="timestamp" placeholder="empty = now" /></td>
220 <td>
221 <select class="input-small" name="action">
222 {% for action, str in actions %}
223 <option value="{{ action }}">{{ str }}</option>
224 {% endfor %}
225 </select>
226 </td>
227 <td>
228 <select class="input-small" name="device">
229 <option value=""></option>
230 {% for device_id, name in devices.items %}
231 <option value="{{ device_id }}">{{ name }}</option>
232 {% endfor %}
233 </select>
234 </td>
235 <td>
236 <input class="btn" type="submit" value="{% trans "Add" %}" />
237 </td>
238 </form>
239 </tr>
240 {% endif %}
241 </table>
242 </div>
243 {% endif %}
245 {% endblock %}
248 {% block javascript %}
249 <script type="text/javascript">
251 {% if episode.url|is_youtube_video %}
252 {% embed_youtube_video podcast episode user %}
253 {% endif %}
255 </script>
256 {% endblock javascript %}
259 {% block ads %}
260 {% comment %}disable ads on episode pages{% endcomment %}
261 {% endblock %}