add Google AdSense support
[mygpo.git] / mygpo / web / templates / podcast.html
blob50a0c095f599fe1a73bb2c0a39cd5ad3314b4569
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 %}
11 {% load menu %}
12 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
13 {% block sectionmenu %}
14 {% if podcast.title %}
15 {{ "/podcast/"|section_menu:podcast.title }}
16 {% else %}
17 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
18 {% endif %}
19 {% endblock %}
21 {% block head %}
22 {{ podcast|opengraph_podcast }}
23 {% google_plus_one_head %}
24 {% endblock %}
26 {% block title %}{{ podcast.title|default:"Unnamed Podcast"|striptags }}{% endblock %}
28 {% block content %}
29 {% if podcast.logo_url %}
30 <div id="podcastlogo">{{ podcast|podcast_logo_big }}</div>
31 {% endif %}
33 <h1>{% if podcast.title %}{{ podcast.title|striptags }}{% else %}{% trans "Unnamed Podcast" %}{%endif%}</h1>
34 <small class="description">
35 {% trans "links" %}:
36 <a href="{{podcast.url}}">{% trans "feed" %}</a>{% if podcast.link %}, <a href="{{podcast.link}}">{% trans "website" %}</a>
37 {% endif %},
38 {% trans "stats:" %} {% blocktrans with podcast.subscriber_count as subscriber_count and podcast.listener_count as listener_count %}{{subscriber_count}} subscribers, {{listener_count}} listeners{% endblocktrans %}
39 </small>
40 <hr style="clear: none;"/>
42 {% if related_podcasts %}
43 <div class="related-podcasts">
44 <strong>{% trans "Also available" %}</strong>
45 {% for p in related_podcasts %}
46 {% podcast_group_link p p.group_member_name %}
47 {% endfor %}
48 </div>
49 {% endif %}
51 {% if podcast.description %}
52 <p class="description">{{ podcast.description|striptags }}</p>
53 {% endif %}
55 <div class="podcast-state">
57 <div class="subscriptions">
58 <h2>{% trans "Subscriptions" %}</h2>
60 {% if not user.is_authenticated %}
61 <div class="subscribe"><a href="{% podcast_link_target podcast "subscribe" %}"><img src="/media/subscribe.png" style="vertical-align: middle;" alt=""/> {% trans "Subscribe to this podcast" %}</a></div>
62 {% endif %}
64 {% if devices or can_subscribe %}
65 <div>
66 <table class="list">
67 {% for device in devices %}
68 <tr>
69 <td>
70 {{ device|device_icon }}
71 <a href="{% url device device.uid %}">{{ device.name|striptags }}</a>
72 </td>
73 <td style="text-align: center;">
74 <a href="{% podcast_link_target podcast "unsubscribe" device.uid %}?return_to={% podcast_link_target podcast %}"><img src="/media/unsubscribe.png" alt="{% trans "Unsubscribe" %}" title="{% trans "Click here to unsubscribe" %}"/></a>
75 </td>
76 </tr>
77 {% endfor %}
78 {% if can_subscribe %}
79 <tr>
80 <form action="{% podcast_link_target podcast "subscribe" %}" method="post">
81 {% csrf_token %}
82 <td>{{ subscribe_form.as_p }}</td>
83 <td style="text-align: center;">
84 <input type="submit" class="subscribe" value="" />
85 </td>
86 </form>
87 </tr>
88 {% endif %}
90 </table>
91 </div>
92 {% endif %}
94 </div>
96 <div class="tags">
97 <h2>Tags</h2>
99 <div class="tag-list">
100 {% for tag in tags %}{% spaceless %}
101 {% if tag.is_own %}
102 <span class="own">{{ tag.tag }} <a class="remove" href="{% podcast_link_target podcast "remove-tag" %}?tag={{ tag.tag }}">X</a></span>
103 {% else %}
104 <span class="other">{{ tag.tag }}</span>
105 {% endif %}
106 {% if not forloop.last %}<span class="seperator">,</span>{% endif %}
107 {% endspaceless %}
108 {% endfor %}
109 {% if user.is_authenticated %}
110 <form action="{% podcast_link_target podcast "add-tag" %}">
111 <input type="text" name="tag" />
112 <input type="submit" class="subscribe" value="" />
113 </form>
114 {% endif %}
115 </div>
116 </div>
118 <div class="share">
119 <h2>{% trans "Share" %}</h2>
120 <div>
121 {% google_plus_one_button %}
122 {{ podcast|fb_like_podcast }}
124 {% if user.is_authenticated and devices %}
125 {% if is_public %}
126 <form action="{% podcast_link_target podcast "podcast-private" %}" method="POST">
127 {% csrf_token %}
128 <button type="submit" class="public" name="public">
129 <img src="/media/32x32/public.png" alt="" />
130 {% trans "Public. Make Private" %}
131 </button>
132 </form>
134 {% else %}
135 <form action="{% podcast_link_target podcast "podcast-public" %}" method="POST">
136 {% csrf_token %}
137 <button type="submit" class="private" name="private">
138 <img src="/media/32x32/private.png" alt="" />
139 {% trans "Private. Make Public" %}
140 </button>
141 </form>
143 {% endif %}
144 {% endif %}
145 </div>
146 </div>
148 </div>
151 {% if episodes %}
152 <hr/>
153 <table class="list episode_list" id="episodes">
154 <tr>
155 <th></th>
156 <th>{% trans "Episode" %}</th>
157 <th>{% trans "Released" %}</th>
158 <th>{% trans "Listeners" %}</th>
159 </tr>
161 {% for episode in episodes %}
162 <tr>
163 <td style="text-align: center; padding-left: 5px; padding-right: 5px;">{{ episode.action|episode_status_icon }}</td>
164 <td style="width: 500px;">
165 <p class="title">{% episode_link episode podcast %}</p>
166 <p class="description">{{ episode.description|default:""|striptags|truncatewords:"15" }}</p>
167 </td>
168 <td>{{ episode.released|default:""|date:"Y-m-d" }}</td>
169 <td>
170 {% if episode.listeners %}
171 {{ episode.listeners|vertical_bar:max_listeners }}
172 {% endif %}
173 </td>
174 </tr>
175 {% endfor %}
176 </table>
177 {% endif %}
179 {% if history %}
180 <hr/>
181 <h2>{% trans "Subscription History" %}</h2>
182 <table class="list">
183 <tr>
184 <th>{% trans "Timestamp" %}</th>
185 <th>{% trans "Action" %}</th>
186 <th>{% trans "Devices" %}</th>
187 </tr>
188 {% for s in history %}
189 <tr>
190 <td><abbr title="{{ s.timestamp }}">{{ s.timestamp|naturalday }}</abbr></td>
191 <td>{{ s|podcast_status_icon }}</td>
192 <td>
193 <a href="{% url device s.device.uid %}">{{ s.device|device_icon }} {{ s.device.name|striptags }}</a>
194 </td>
195 </tr>
196 {% endfor %}
197 </table>
198 {% endif %}
200 {% if not podcast.title %}
201 <div class="info"><strong>{% trans "Why Unnamed Podcast?" %}</strong> {% trans "Because we display names after we have fetched the information form the feed -- and this may take some time. Until this is completed, the podcast will simply be called this way." %}</div>
202 {% endif %}
204 {% endblock %}
207 {% block ads %}
208 {% comment %}disable ads on podcast pages{% endcomment %}
209 {% endblock %}