From 92d9f7140e28b7d2485ef65b410b206e330423d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Sun, 19 May 2013 18:57:12 +0200 Subject: [PATCH] show pubsub status on publisher page --- mygpo/publisher/templates/publisher/podcast.html | 23 +++++++++++++++++++++++ mygpo/publisher/views.py | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/mygpo/publisher/templates/publisher/podcast.html b/mygpo/publisher/templates/publisher/podcast.html index 0ae8431c..55532ece 100644 --- a/mygpo/publisher/templates/publisher/podcast.html +++ b/mygpo/publisher/templates/publisher/podcast.html @@ -99,6 +99,29 @@ {% endif %} + +

{% trans "PubSubHubbub" %}

+

+ {% blocktrans with site.domain as sitename %}If you publish your podcast feed through a PubSubHubbu hub, {{ sitename }} can immediatelly update your podcast when a new episode is released.{% endblocktrans %} +

+ + {% if pubsubscription and pubsubscription.mode == 'subscribe' %} + {% if pubsubscription.verified %} +
+ {% blocktrans with podcast.hub as hub %}Your podcast is published through {{ hub }} and should update immediatelly for each new episode.{% endblocktrans %} +
+ {% else %} +
+ {% blocktrans with podcast.hub as hub %}Your podcast is published through {{ hub }} but our subscription has not yet been verified.{% endblocktrans %} +
+ {% endif %} + {% else %} +
+ {% 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 %} +
+ {% endif %} + +

Episodes

View and edit episode data.

diff --git a/mygpo/publisher/views.py b/mygpo/publisher/views.py index 22729acb..09489573 100644 --- a/mygpo/publisher/views.py +++ b/mygpo/publisher/views.py @@ -33,6 +33,7 @@ from mygpo.db.couchdb.podcast import podcast_by_id, podcasts_by_id, \ podcast_for_url, podcastgroup_for_slug_id, podcastgroup_for_oldid, \ podcastgroup_by_id, update_additional_data from mygpo.db.couchdb.episode_state import episode_listener_counts +from mygpo.db.couchdb.pubsub import subscription_for_topic @vary_on_cookie @@ -97,6 +98,8 @@ def podcast(request, podcast): heatmap = EpisodeHeatmap(podcast.get_id()) + pubsubscription = subscription_for_topic(podcast.url) + site = RequestSite(request) feedurl_quoted = urllib.quote(podcast.url) @@ -110,6 +113,7 @@ def podcast(request, podcast): 'update_token': update_token, 'heatmap': heatmap, 'feedurl_quoted': feedurl_quoted, + 'pubsubscription': pubsubscription, }) -- 2.11.4.GIT