Merge pull request #793 from gpodder/remove-advertise
[mygpo.git] / mygpo / publisher / templates / publisher / podcast.html
blob314ab388ed552876c57801819a2a93778ad34145
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load humanize %}
4 {% load podcasts %}
5 {% load charts %}
6 {% load pcharts %}
7 {% load time %}
8 {% load static %}
9 {% load menu %}
10 {% load utils %}
11 {% block mainmenu %}{{ "/publisher/"|main_menu }}{% endblock %}
12 {% block sectionmenu %}{{ "/publisher/podcast/"|section_menu:podcast.title }}{% endblock %}
14 {% block title %}{{ podcast.title|default:"Unnamed Podcast"|striptags }}{% endblock %}
16 {% block head %}
17 {% if timeline_data %}
18 {{ timeline_data|timeline }}
19 {% endif %}
20 {% endblock %}
22 {% block header %}
23 {% if podcast.logo_url %}
24 <div id="podcastlogo">{{ podcast|podcast_logo_big }}</div>
25 {% endif %}
27 <h1>{% if podcast.title %}{{ podcast.title|striptags }}{% else %}{% trans "Unnamed Podcast" %}{%endif%} <small>{% trans "Publisher Pages" %}</small></h1>
28 <small class="description">
29 {% if podcast.author %}{% trans "by" %}
30 {{ podcast.author|striptags }}
31 {% endif %}
32 {% if podcast.twitter %}
33 <a href="https://twitter.com/{{ podcast.twitter|striptags }}"><i class="icon-twitter"></i></a>
34 {% endif %}&middot;
35 <a href="{{podcast.url}}" title="{% trans "Feed" %}">
36 <i class="icon-rss"></i>
37 </a>
38 {% if podcast.link %}&middot;
39 <a href="{{podcast.link}}" title="{% trans "Website" %}">
40 <i class="icon-external-link"></i>
41 </a>
42 {% endif %}
43 {% if podcast.subscriber_count %}&middot;
44 {{ podcast.subscriber_count }} {% trans "subscribers" %}
45 {% endif %}
46 </small>
48 <div class="description">
49 {% blocktrans with podcast.title as ptitle %}This is the publisher page of <strong>{{ ptitle }}</strong>. You can see some stats and provide additional data for the podcast page.{% endblocktrans %}
50 <a class="btn btn-default" href="{% podcast_link_target podcast %}">{% trans "Go to Podcast Page" %}</a>
51 </div>
52 {% endblock %}
55 {% block content %}
56 <h2>Podcast Data</h2>
57 <p>{% trans "The podcast information is regularly retrieved from the podcast feed" %}</p>
58 <pre><a href="{{ podcast.url }}">{{ podcast.url }}</a></pre>
60 <h3>{% trans "Updates" %}</h3>
62 {% trans "Update interval:" %} {{ podcast.update_interval|hours_to_str }}
64 <table>
65 <thead>
66 <tr>
67 <th>Start</th>
68 <th>Duration</th>
69 <th>Status</th>
70 <th class="numeric">Episodes Added</th>
71 </tr>
72 </thead>
73 <tbody>
74 <tr class="status-neutral">
75 <td>{{ podcast.next_update|naturaltime }}</td>
76 <td></td>
77 <td>Next</td>
78 <td class="numeric"></td>
79 </tr>
80 {% for result in update_results %}
81 <tr {% if result.successful %} class="status-success" {% else %} class="status-error" {% endif %}>
82 <td>{{ result.start|naturaltime }}</td>
83 <td>{{ result.duration.total_seconds|format_duration }}</td>
84 <td>
85 {% if result.successful %}
86 {% trans "Successful" %}
87 {% else %}
88 {% trans "Error" %} {{ result.error_message }}
89 {% endif %}
90 </td>
91 <td class="numeric">{{ result.episodes_added }}</td>
92 </tr>
93 {% empty %}
94 <tr class="status-neutral">
95 <td>{{ podcast.last_update|naturaltime }}</td>
96 <td></td>
97 <td></td>
98 <td class="numeric"></td>
99 </tr>
100 {% endfor %}
101 </tbody>
102 </table>
104 <form class="form-inline" action="{% podcast_link_target podcast "podcast-publisher-update" %}" method="post">
105 {% csrf_token %}
106 <button class="btn btn-default" type="submit">{% trans "Update now" %}</button>
107 </form>
110 <h2>Additional Data</h2>
112 <form class="form-horizontal" action="{% podcast_link_target podcast "podcast-publisher-save" %}" method="post">
113 {% csrf_token %}
115 <div class="form-group">
116 <label class="col-lg-2 control-label" for="inputTwitter">
117 <i class="icon-twitter"></i> {% trans "Twitter" %}
118 </label>
120 <div class="input-group col-lg-10">
121 <span class="input-group-addon">@</span>
122 <input type="text" class="form-control" id="inputTwitter" name="twitter" placeholder="username" value="{{ podcast.twitter|default:"" }}">
123 </div>
124 </div>
127 <div class="form-group">
128 <div class="col-lg-offset-2 col-lg-10">
129 <button type="submit" class="btn btn-default">{% trans "Save" %}</button>
130 </div>
131 </div>
133 </form>
135 <h2>{% trans "Feed Check" %}</h2>
137 <div class="panel-group" id="accordion">
138 <div class="panel panel-default">
139 <div class="panel-heading">
140 <h4 class="panel-title">
141 <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-check" href="#collapsePubSub">
142 <i class="icon-check{% if not pubsubscription %}-empty{% endif %}"></i>
143 {% trans "PubSubHubbub" %}
144 </a>
145 </h4>
146 </div>
149 <div id="collapsePubSub" class="panel-collapse collapse">
150 <div class="panel-body">
152 {% blocktrans with site.domain as sitename %}If you publish your podcast feed through a <a href="https://code.google.com/p/pubsubhubbub/">PubSubHubbu</a> hub, {{ sitename }} can immediatelly update your podcast when a new episode is released.{% endblocktrans %}
153 </p>
154 {% if pubsubscription and pubsubscription.mode == 'subscribe' %}
155 {% if pubsubscription.verified %}
156 <div class="alert alert-success">
157 {% blocktrans with podcast.hub as hub %}Your podcast is published through <a href="{{ hub }}">{{ hub }}</a> and should update immediatelly for each new episode.{% endblocktrans %}
158 </div>
159 {% else %}
160 <div class="alert alert-warning">
161 {% blocktrans with podcast.hub as hub %}Your podcast is published through <a href="{{ hub }}">{{ hub }}</a> but our subscription has not yet been verified.{% endblocktrans %}
162 </div>
163 {% endif %}
164 {% else %}
165 <div class="alert alert-warning">
166 {% blocktrans %}We did not find a hub in your podcast feed. Your feed is updated regularly, but there might be some delay until a new episode shows up on {{ sitename }}.{% endblocktrans %}
167 </div>
168 {% endif %}
169 </div>
170 </div>
171 </div>
173 <div class="panel panel-default">
174 <div class="panel-heading">
175 <h4 class="panel-title">
176 <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-check" href="#collapseLicense">
177 <i class="icon-check{% if not podcast.license %}-empty{% endif %}"></i>
178 {% trans "License Information" %}
179 </a>
180 </h4>
181 </div>
183 <div id="collapseLicense" class="panel-collapse collapse">
184 <div class="panel-body">
186 {% blocktrans with site.domain as sitename %}You should include license information in your feed so that users and {{ sitename }} can know, under which conditions your content can be used.{% endblocktrans %}
187 </p>
188 {% if podcast.license %}
189 <div class="alert alert-success">
190 {% blocktrans with podcast.license as license %}We found the following license in your podcast: <a href="{{ license }}">{{ license }}</a>{% endblocktrans %}
191 </div>
192 {% else %}
193 <div class="alert alert-warning">
194 {% blocktrans %}We did not find a license in your podcast feed. Refer to <a href="https://github.com/gpodder/podcast-feed-best-practice/blob/master/podcast-feed-best-practice.md#license"> gPodder Podcast Feed Best Practice</a> on how to include license information.{% endblocktrans %}
195 </div>
196 {% endif %}
197 </div>
198 </div>
199 </div>
201 </div>
204 <h2>Episodes</h2>
205 <p>View and edit <a href="{% podcast_link_target podcast "podcast-publisher-episodes" %}">episode</a> data.</p>
208 <h2>{% trans "Link" %}</h2>
209 <p>{% blocktrans with url as sitename %}You can paste this code on your website, so users of {{ sitename }} can directly subscribe to your podcast.{% endblocktrans %}</p>
210 <textarea style="width: 100%;" rows="2"><a href="http://{{ site.domain }}{% url "subscribe-by-url" %}?url={{ feedurl_quoted }}"><img src="http://{{ site.domain }}{% static "author_subscribe.png" %}" /></a></textarea>
211 <p><a href="http://{{ site.domain }}{% url "subscribe-by-url" %}?url={{ feedurl_quoted }}"><img src="http://{{ site.domain }}{% static "author_subscribe.png" %}" /></a></p>
213 <h2>Stats</h2>
215 {% if group %}
216 <a href="{% podcast_group_link_target group "group-publisher" %}">{% trans "Show Group Stats" %}</a>
217 {% endif %}
219 {% if timeline_data %}
220 <h3>Listener Timeline</h3>
221 <div id="chart_div" style="width: 700px; height: 240px;"></div>
222 {% endif %}
225 {% if subscriber_data %}
226 <h3>Subscriptions</h3>
227 <p>Please note that the chart shows subscriptions per user and device, so a single user subscribing to this podcast on 5 devices acccounts for 5 subscriptions.</p>
228 {{ subscriber_data|bar_chart }}
229 {% endif %}
231 {% endblock %}