promote "Share" to main navigation
[mygpo.git] / mygpo / web / templates / podcast.html
blobf74f461ae64bae2972e7703beb630d6fff92d6a3
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load humanize %}
4 {% load episodes %}
5 {% load podcasts %}
6 {% load devices %}
7 {% load charts %}
9 {% load menu %}
10 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
11 {% block sectionmenu %}
12 {% if podcast.title %}
13 {{ "/podcast/"|section_menu:podcast.title }}
14 {% else %}
15 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
16 {% endif %}
17 {% endblock %}
19 {% block title %}{{ podcast.title|default:"Unnamed Podcast"|striptags }}{% endblock %}
21 {% block content %}
22 {% if podcast.logo_url %}
23 <div id="podcastlogo">{{ podcast|podcast_logo_big }}</div>
24 {% endif %}
26 <h1>{% if podcast.title %}{{ podcast.title|striptags }}{% else %}{% trans "Unnamed Podcast" %}{%endif%}</h1>
27 <small class="description">
28 {% trans "links" %}:
29 <a href="{{podcast.url}}">{% trans "feed" %}</a>{% if podcast.link %}, <a href="{{podcast.link}}">{% trans "website" %}</a>
30 {% endif %},
31 {% trans "stats:" %} {% blocktrans with podcast.subscriber_count as subscriber_count and podcast.listener_count as listener_count %}{{subscriber_count}} subscribers, {{listener_count}} listeners{% endblocktrans %}
32 </small>
33 <hr style="clear: none;"/>
35 {% if related_podcasts %}
36 <div class="related-podcasts">
37 <strong>{% trans "Also available" %}</strong>
38 {% for p in related_podcasts %}
39 <a href="/podcast/{{ p.id }}">{{ p.group_member_name|striptags }}</a>
40 {% endfor %}
41 </div>
42 {% endif %}
44 {% if podcast.description %}
45 <p class="description">{{ podcast.description|striptags }}</p>
46 {% endif %}
48 {% if not user.is_authenticated %}
49 <p><a href="/podcast/{{ podcast.id }}/subscribe"><img src="/media/subscribe.png" style="vertical-align: middle;" alt=""/> {% trans "Subscribe to this podcast" %}</a></p>
50 {% else %}
52 {% if devices %}
53 <h2>{% trans "My Subscriptions" %}</h2>
55 {% if privacy_form %}
56 {% if success %}
57 <div class="success">{% trans "Your settings have been saved." %}</div>
58 {% endif %}
60 <form action="" method="POST">
61 {% csrf_token %}
62 <p>{{ privacy_form.public }} {{ privacy_form.public.label_tag }}</p>
63 <input type="submit" value="Save" />
64 </form>
65 {% endif %}
67 <table class="list">
68 <tr>
69 <th>{% trans "Device" %}</th>
70 <th>{% trans "Unsubscribe" %}</th>
71 </tr>
72 {% for device in devices %}
73 <tr>
74 <td>
75 {{ device|device_icon }}
76 <a href="/device/{{ device.id }}">{{ device|striptags }}</a>
77 </td>
78 <td style="text-align: center;">
79 <a href="/podcast/{{ podcast.id }}/unsubscribe/{{ device.id }}?return_to=/podcast/{{ podcast.id }}"><img src="/media/unsubscribe.png" alt="{% trans "Unsubscribe" %}" title="{% trans "Click here to unsubscribe" %}"/></a>
80 </td>
81 </tr>
82 {% endfor %}
83 </table>
84 {% endif %}
86 {% if can_subscribe %}
87 <p><a href="/podcast/{{ podcast.id }}/subscribe"><img src="/media/subscribe.png" style="vertical-align: middle;" alt=""/> {% trans "Subscribe to this podcast" %}</a></p>
88 {% endif %}
90 {% endif %} {% comment %} End of user-only content{% endcomment %}
92 {% if similar_podcasts %}
93 <h3>Similar Podcasts</h3>
94 {% for p in similar_podcasts %}
95 <a href="/podcast/{{ p.id }}">{{ p.title }}</a>
96 {% endfor %}
97 {% endif %}
99 {% if episodes %}
100 <hr/>
101 <table class="list episode_list">
102 <tr>
103 <th></th>
104 <th>{% trans "Episode" %}</th>
105 <th>{% trans "Released" %}</th>
106 <th>{% trans "Listeners" %}</th>
107 </tr>
109 {% for episode in episodes %}
110 <tr>
111 <td style="text-align: center; padding-left: 5px; padding-right: 5px;">{{ episode.action|episode_status_icon }}</td>
112 <td style="width: 500px;">
113 <p class="title"><a href="/episode/{{ episode.id }}">{{ episode.title|default:"Unknown Episode"|striptags }}</a></p>
114 <p class="description">{{ episode.description|default:""|striptags|truncatewords:"15" }}</p>
115 </td>
116 <td>{{ episode.timestamp|default:""|date:"Y-m-d" }}</td>
117 <td>
118 {% if episode.listeners %}
119 {{ episode.listeners|vertical_bar:max_listeners }}
120 {% endif %}
121 </td>
122 </tr>
123 {% endfor %}
124 </table>
125 {% endif %}
127 {% if history %}
128 <hr/>
129 <h2>{% trans "Subscription history" %}</h2>
130 <table class="list">
131 <tr>
132 <th>{% trans "Timestamp" %}</th>
133 <th>{% trans "Action" %}</th>
134 <th>{% trans "Devices" %}</th>
135 </tr>
136 {% for s in history %}
137 <tr>
138 <td><abbr title="{{ s.timestamp }}">{{ s.timestamp|naturalday }}</abbr></td>
139 <td>{{ s|podcast_status_icon }}</td>
140 <td>
141 <a href="/device/{{ s.device.id }}">{{ s.device|device_icon }} {{ s.device.name|striptags }}</a></td>
142 </tr>
143 {% endfor %}
144 </table>
145 {% endif %}
147 {% if not podcast.title %}
148 <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>
149 {% endif %}
151 {% endblock %}