[Migration] Get Podcasts / Episodes from PostgreSQL
[mygpo.git] / mygpo / web / templates / episode.html
blob4f5fc592fbc0b256e42d1169e7589762b4c455b9
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 charts %}
12 {% load utils %}
13 {% load static %}
15 {% load menu %}
16 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
17 {% block sectionmenu %}
18 {% if podcast.title %}
19 {{ "/podcast/"|section_menu:podcast.title }}
20 {% else %}
21 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
22 {% endif %}
23 {% endblock %}
25 {% block head %}
26 {% if episode.url|is_youtube_video %}
27 <script type="text/javascript" src="{% static "js/swfobject.js" %}"></script>
28 <script type="text/javascript" src="{% static "js/json2.js" %}"></script>
29 <script type="text/javascript" src="{% static "js/youtube-handler.js" %}"></script>
30 {% endif %}
32 {% endblock head %}
34 {% block title %}
35 {{ episode.title|default:"Unnamed Episode"|striptags }} -
36 {{ podcast.title|default:"Unnamed Podcast"|striptags}}
37 {% 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 {% if episode.released %}
47 <small>{{ episode.released|naturalday }}</small>
48 {% endif %}
49 </h1>
50 <small class="description">
51 {% trans "from" %} {% podcast_group_link podcast %}&middot;
52 {% if not episode.outdated or "hide-outdated-urls" not in podcast.restrictions %}
53 <a href="{{episode.url}}" title="{% trans "Download" %}">
54 <i class="icon-download"></i>
55 </a>
56 {% endif %}
57 {% if episode.link and episode.link != episode.url %}&middot;
58 <a href="{{episode.link}}" title="{% trans "Website" %}">
59 <i class="icon-external-link"></i>
60 </a>
61 {% endif %}
62 {% if episode.listeners %}&middot;
63 {{ episode.listeners }} {% trans "listeners" %}
64 {% endif %}
65 </small>
68 {% if episode.summary or episode.description %}
69 <div class="summary">
70 {{ episode.summary|default:episode.description|truncatewords:100|markdown }}
71 </div>
72 {% endif %}
74 {% endblock %}
78 {% block content %}
80 <hr />
82 <div class="btn-toolbar">
84 {% if is_publisher %}
85 <a class="btn btn-default" href="{% episode_link_target episode podcast "episode-publisher-detail" %}"><i class="icon-wrench"></i> {% trans "Publisher Pages" %}</a>
86 {% endif %}
88 {% if user.is_authenticated %}
89 {% if is_favorite %}
90 <a class="btn btn-default" href="{% episode_link_target episode podcast "episode-fav" %}">
91 <i class="icon-star"></i> {% trans "Remove Favorite" %}
92 </a>
93 {% else %}
94 <a class="btn btn-default" href="{% episode_link_target episode podcast "episode-fav" %}">
95 <i class="icon-star-empty"></i> {% trans "Favorite" %}
96 </a>
97 {% endif %}
98 {% endif %}
100 {% if has_history %}
101 <a class="btn btn-default" href="{% episode_link_target episode podcast "episode-history" %}">
102 <i class="icon-calendar"></i>
103 {% trans "Episode History" %}
104 </a>
105 {% endif %}
107 {% if can_flattr %}
108 <a class="btn btn-default" href="{% episode_link_target episode podcast "flattr-episode" %}">
109 <img src="https://flattr.com/_img/icons/flattr_logo_16.png"
110 alt="Flattr {{ episode.title|default:"Unnamed Episode"|striptags }}" />
111 {% trans "Flattr" %}
112 </a>
113 {% endif %}
115 {% if debug %}
116 <a class="btn btn-default" href="{% edit_link episode %}">
117 <i class="icon-cogs"></i>Admin
118 </a>
119 {% endif %}
122 </div>
124 <hr />
126 {% if episode.content or episode.description %}
127 <div class="description" {% if episode.language or podcast.language %}lang="{% firstof episode.language podcast.language %}"{% endif %}>
128 {% if episode.content %}
129 {{ episode.content|markdown }}
130 {% else %}
131 {{ episode.description|markdown }}
132 {% endif %}
133 </div>
134 {% endif %}
136 {% if episode.url|is_youtube_video %}
137 <div id="ytapiplayer">
138 You need Flash player 8+ and JavaScript enabled to view this video.
139 </div>
140 {% endif %}
143 {% if episode.url|is_flickr_photo %}
144 {{ episode|embed_flickr_photo }}
145 {% endif %}
147 {% if episode|is_image %}
148 <img src="{{ episode.url }}" />
149 {% endif %}
151 {% if user.is_authenticated %}
153 {% if played_parts %}
154 <h3>Already played</h3>
155 {{ played_parts|episode_heatmap_visualization }}
156 {% endif %}
158 {% endif %}
160 <ul class="pagination">
161 {% if prev %}
162 <li>
163 {% episode_link prev podcast %}
164 </li>
165 {% endif %}
166 <li>
167 <a href="{% podcast_link_target podcast %}#episodes">{% trans "..." %}</a>
168 </li>
169 {% if next %}
170 <li>
171 {% episode_link next podcast %}
172 </li>
173 {% endif %}
174 </ul>
176 {% endblock %}
179 {% block javascript %}
180 <script type="text/javascript">
182 {% if episode.url|is_youtube_video %}
183 {% embed_youtube_video podcast episode user %}
184 {% endif %}
186 </script>
187 {% endblock javascript %}
190 {% block ads %}
191 {% comment %}disable ads on episode pages{% endcomment %}
192 {% endblock %}