adapt templates to Bootstrap 3
[mygpo.git] / mygpo / web / templates / podcast.html
blob4c4748f8abeff8b4379d47d3766255da3e73e72a
1 {% extends "podcast-base.html" %}
2 {% load i18n %}
3 {% load humanize %}
4 {% load episodes %}
5 {% load podcasts %}
6 {% load devices %}
7 {% load charts %}
8 {% load utils %}
10 {% load menu %}
11 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
12 {% block sectionmenu %}
13 {% if podcast.title %}
14 {{ "/podcast/"|section_menu:podcast.title }}
15 {% else %}
16 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
17 {% endif %}
18 {% endblock %}
20 {% block title %}{{ podcast.title|default:"Unnamed Podcast"|striptags }}{% endblock %}
23 {% block content %}
25 {% if episode %}
26 <div class="first-episode">
27 {% include "components/episode-box.html" with podcast=podcast episode=episode long=True only %}
28 </div>
29 {% endif %}
31 <hr />
33 <div class="btn-toolbar">
35 {% if is_publisher %}
36 <div class="btn-group">
37 <a class="btn btn-default" href="{% podcast_link_target podcast "podcast-publisher-detail" %}">
38 <i class="icon-wrench"></i>
39 {% trans "Publisher Pages" %}
40 </a>
41 </div>
42 {% endif %}
44 {% if not user.is_authenticated %}
45 <div class="btn-group">
46 <a class="btn btn-default" href="{% podcast_link_target podcast "subscribe" %}">
47 <i class="icon-plus"></i>
48 {% trans "Login to Subscribe" %}
49 </a>
50 </div>
51 {% endif %}
53 {% if devices or can_subscribe %}
55 <div class="btn-group">
56 {% if can_subscribe %}
57 <button class="btn btn-primary" onclick="submitForm('subscribe+all');">
58 <i class="icon-plus-sign"></i>
59 {% trans "Subscribe" %}
60 </button>
61 <button class="btn dropdown-toggle btn-primary" data-toggle="dropdown">
62 <span class="caret"></span>
63 </button>
64 {% else %}
65 <button class="btn btn-default" onclick="submitForm('unsubscribe+all');">
66 <i class="icon-remove-sign"></i>
67 {% trans "Unsubscribe" %}
68 </button>
69 <button class="btn dropdown-toggle btn-default" data-toggle="dropdown">
70 <span class="caret"></span>
71 </button>
72 {% endif %}
73 <ul class="dropdown-menu">
74 {% if can_subscribe %}
75 <li value="+all">
76 <a href="javascript:void(0);" onclick="submitForm('subscribe+all');">
77 <i class="icon-plus-sign"></i>
78 {% trans "Subscribe on all devices" %}
79 </a>
80 <form class="internal"
81 method="post"
82 action="{% podcast_link_target podcast "subscribe-all" %}"
83 id="subscribe+all">
84 {% csrf_token %}
85 </form>
86 </li>
87 {% endif %}
88 {% for device in subscribe_targets %}
89 <li value="{{ device.uid }}">
90 <a href="javascript:void(0);" onclick="submitForm('subscribe-{{ device|devices_uids }}');">
91 <i class="icon-plus"></i>
92 {{ device|devices_name }}
93 </a>
94 <form class="internal"
95 action="{% podcast_link_target podcast "subscribe" %}"
96 method="post"
97 id="subscribe-{{ device|devices_uids }}">
98 {% csrf_token %}
99 <input type="hidden" name="targets" value="{{ device|devices_uids }}" />
100 </form>
101 </li>
102 {% endfor %}
103 {% if can_subscribe and devices %}
104 <li class="divider"></li>
105 {% endif %}
106 {% if devices %}
107 <li value="+none">
108 <a href="javascript:void(0);" onclick="submitForm('unsubscribe+all');">
109 <i class="icon-remove-sign"></i>
110 {% trans "Unsubscribe from all devices " %}
111 </a>
112 <form class="internal"
113 method="post"
114 action="{% podcast_link_target podcast "unsubscribe-all" %}"
115 id="unsubscribe+all">
116 {% csrf_token %}
117 </form>
118 </li>
119 {% endif %}
120 {% for device in devices %}
121 <li value="{{ device.uid }}">
122 <a href="javascript:void(0);" onclick="submitForm('unsubscribe-{{ device.uid }}');">
123 <i class="icon-remove"></i>
124 {{ device|devices_name }}
125 </a>
126 <form class="internal"
127 method="post"
128 action="{% podcast_link_target podcast "unsubscribe" device.uid %}?return_to={% podcast_link_target podcast %}"
129 id="unsubscribe-{{ device.uid }}">
130 {% csrf_token %}
131 </form>
132 </li>
133 {% endfor %}
134 </ul>
135 </div>
137 {% endif %}
140 {% if has_history %}
141 <a class="btn btn-default" href="{% podcast_link_target podcast "podcast-history" %}">
142 <i class="icon-calendar"></i>
143 {% trans "Subscription History" %}
144 </a>
145 {% endif %}
147 {% if can_flattr %}
148 <a class="btn btn-default" href="{% podcast_link_target podcast "podcast-flattr" %}">
149 <img src="https://flattr.com/_img/icons/flattr_logo_16.png"
150 alt="Flattr {{ podcast.title|default:"Unnamed Podcast"|striptags }}" />
151 {% trans "Flattr" %}
152 </a>
153 {% endif %}
155 <a href="javascript:void(0);" onclick="$('#tag-box').toggle();" class="btn btn-default">
156 <i class="icon-tag"></i>
157 {% trans "Tags" %}
158 </a>
160 {% if debug %}
161 <a class="btn btn-default" href="http://127.0.0.1:5984/_utils/document.html?mygpo/{% get_id podcast %}">
162 <i class="icon-cogs"></i>
163 Futon
164 </a>
165 {% endif %}
167 </div>
169 <div id="tag-box">
170 <hr />
172 <i class="icon-tag"></i>
173 <strong>{% trans "Tags" %}: </strong>
175 {% for tag in tags %}
176 {% spaceless %}
177 {% if tag.is_own %}
178 <span class="own">{{ tag.tag }} <a class="remove" href="{% podcast_link_target podcast "remove-tag" %}?tag={{ tag.tag }}">X</a></span>
179 {% else %}
180 <span class="other">{{ tag.tag }}</span>
181 {% endif %}
182 {% if not forloop.last %}
183 <span class="seperator">,</span>
184 {% endif %}
185 {% endspaceless %}
186 {% endfor %}
188 {% if user.is_authenticated %}
189 <form class="form-inline" action="{% podcast_link_target podcast "add-tag" %}">
190 <div class="input-group">
191 <span class="input-group-addon input-sm"><i class="icon-tag"></i></span>
192 <input class="input-sm form-control" type="text" name="tag" />
193 <span class="input-group-btn">
194 <button class="btn btn-success btn-sm" type="submit">
195 <i class="icon-plus"></i>
196 </button>
197 </span>
198 </div>
199 </form>
200 {% endif %}
201 </div>
203 <hr />
206 {% if episodes %}
208 <h3>{% trans "Older Episodes" %}</h3>
210 <div class="episodes">
212 {% for episode in episodes %}
213 {% include "components/episode-box.html" with episode=episode podcast=podcast only %}
214 {% endfor %}
216 </div>
218 <ul class="pagination">
219 {% for page in page_list %}
220 <li>
221 {% if page == "..." %}
222 <span>{{ page }}</span>
223 {% else %}
225 {% if page == current_page %}
226 <a href="{% podcast_link_target podcast "podcast-all-episodes" %}?page={{ page }}"><strong>{{ page }}</strong></a>
227 {% else %}
228 <a href="{% podcast_link_target podcast "podcast-all-episodes" %}?page={{ page }}">{{ page }}</a>
229 {% endif %}
230 {% endif %}
231 </li>
232 {% endfor %}
233 </ul>
235 {% endif %}
237 {% endblock %}
240 {% block javascript %}
242 <script language="javascript">
243 <!--
244 function submitForm(formid)
246 document.forms[formid].submit();
247 return true;
250 {% if not has_tagged %}
251 // done in JS so that box is always visible if JS is disabled
252 $('#tag-box').toggle();
253 {% endif %}
255 </script>
257 {% endblock %}