From 3af5c78b8bb14c00a62286dbe93c59ccd9ddc02e Mon Sep 17 00:00:00 2001 From: Stefan Koegl Date: Sat, 3 Apr 2010 17:12:23 +0200 Subject: [PATCH] apply new navigation to publisher pages moved /author to /publisher/link --- .../templates/authors.html => publisher/templates/link.html} | 6 +++--- mygpo/publisher/templates/publisher/episode.html | 4 ++++ mygpo/publisher/templates/publisher/episodes.html | 4 ++++ mygpo/publisher/templates/publisher/home.html | 4 ++++ mygpo/publisher/templates/publisher/info.html | 4 ++++ mygpo/publisher/templates/publisher/podcast.html | 4 ++++ mygpo/publisher/views.py | 10 +++++++++- mygpo/urls.py | 8 ++++++-- mygpo/web/templatetags/menu.py | 7 ++++++- mygpo/web/views/__init__.py | 7 ------- 10 files changed, 44 insertions(+), 14 deletions(-) rename mygpo/{web/templates/authors.html => publisher/templates/link.html} (76%) diff --git a/mygpo/web/templates/authors.html b/mygpo/publisher/templates/link.html similarity index 76% rename from mygpo/web/templates/authors.html rename to mygpo/publisher/templates/link.html index 61d157fc..6968c71f 100644 --- a/mygpo/web/templates/authors.html +++ b/mygpo/publisher/templates/link.html @@ -2,13 +2,13 @@ {% load i18n %} {% load menu %} -{% block mainmenu %}{{ "/authors/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/authors/"|section_menu }}{% endblock %} +{% block mainmenu %}{{ "/publisher/"|main_menu }}{% endblock %} +{% block sectionmenu %}{{ "/publisher/link/"|section_menu }}{% endblock %} {% block title %}{% trans "For Podcast Authors" %}{% endblock %} {% block content %} -

{% trans "For podcast authors" %}

+

{% trans "Link to" %} {{url}}

{% trans "You can paste this code on your website, so users of mygpo can directly subscribe to your podcast!" %}

diff --git a/mygpo/publisher/templates/publisher/episode.html b/mygpo/publisher/templates/publisher/episode.html index bb6c8cf4..df793e11 100644 --- a/mygpo/publisher/templates/publisher/episode.html +++ b/mygpo/publisher/templates/publisher/episode.html @@ -5,6 +5,10 @@ {% load podcasts %} {% load charts %} +{% load menu %} +{% block mainmenu %}{{ "/publisher/"|main_menu }}{% endblock %} +{% block sectionmenu %}{{ "/publisher/podcast/"|section_menu:episode.podcast.title }}{% endblock %} + {% block title %}{{ episode.title|default:"Unnamed Episode"|striptags }}{% endblock %} {% block content %} diff --git a/mygpo/publisher/templates/publisher/episodes.html b/mygpo/publisher/templates/publisher/episodes.html index 99b30d8c..66eeac20 100644 --- a/mygpo/publisher/templates/publisher/episodes.html +++ b/mygpo/publisher/templates/publisher/episodes.html @@ -5,6 +5,10 @@ {% load podcasts %} {% load charts %} +{% load menu %} +{% block mainmenu %}{{ "/publisher/"|main_menu }}{% endblock %} +{% block sectionmenu %}{{ "/publisher/podcast/"|section_menu:podcast.title }}{% endblock %} + {% block title %}{{ podcast.title|default:"Unnamed Podcast"|striptags }}{% endblock %} {% block content %} diff --git a/mygpo/publisher/templates/publisher/home.html b/mygpo/publisher/templates/publisher/home.html index 96be4a11..02c71f43 100644 --- a/mygpo/publisher/templates/publisher/home.html +++ b/mygpo/publisher/templates/publisher/home.html @@ -2,6 +2,10 @@ {% load i18n %} {% load podcasts %} +{% load menu %} +{% block mainmenu %}{{ "/publisher/"|main_menu }}{% endblock %} +{% block sectionmenu %}{{ "/publisher/"|section_menu }}{% endblock %} + {% block title %}{% trans "Podcasts Published by You" %}{% endblock %} {% block content %} diff --git a/mygpo/publisher/templates/publisher/info.html b/mygpo/publisher/templates/publisher/info.html index d4dc3c6b..2ff174e2 100644 --- a/mygpo/publisher/templates/publisher/info.html +++ b/mygpo/publisher/templates/publisher/info.html @@ -2,6 +2,10 @@ {% load i18n %} {% load podcasts %} +{% load menu %} +{% block mainmenu %}{{ "/publisher/"|main_menu }}{% endblock %} +{% block sectionmenu %}{{ "/publisher/"|section_menu }}{% endblock %} + {% block title %}{% trans "Publisher Pages" %}{% endblock %} {% block content %} diff --git a/mygpo/publisher/templates/publisher/podcast.html b/mygpo/publisher/templates/publisher/podcast.html index c6447ae2..9f59ef55 100644 --- a/mygpo/publisher/templates/publisher/podcast.html +++ b/mygpo/publisher/templates/publisher/podcast.html @@ -5,6 +5,10 @@ {% load charts %} {% load pcharts %} +{% load menu %} +{% block mainmenu %}{{ "/publisher/"|main_menu }}{% endblock %} +{% block sectionmenu %}{{ "/publisher/podcast/"|section_menu:podcast.title }}{% endblock %} + {% block title %}{{ podcast.title|default:"Unnamed Podcast"|striptags }}{% endblock %} {% block head %} diff --git a/mygpo/publisher/views.py b/mygpo/publisher/views.py index 55a90ee4..888624b0 100644 --- a/mygpo/publisher/views.py +++ b/mygpo/publisher/views.py @@ -24,7 +24,8 @@ def home(request): else: site = Site.objects.get_current() return render_to_response('publisher/info.html', { - 'site': site}) + 'site': site + }, context_instance=RequestContext(request)) @require_publisher @@ -126,3 +127,10 @@ def device_stats(podcast): return res + +def link(request): + current_site = Site.objects.get_current() + return render_to_response('link.html', { + 'url': current_site + }, context_instance=RequestContext(request)) + diff --git a/mygpo/urls.py b/mygpo/urls.py index 8c0bd1b5..8969cc0a 100644 --- a/mygpo/urls.py +++ b/mygpo/urls.py @@ -98,8 +98,6 @@ urlpatterns = patterns('', #Subscribe with my.gpodder.org (r'^subscribe', 'mygpo.web.views.podcast_subscribe_url'), - #(r'^authors/$', 'django.views.generic.simple.direct_to_template', {'template': 'authors.html'}), - (r'^authors/$', 'mygpo.web.views.author'), (r'^online-help', 'django.views.generic.simple.direct_to_template', {'template': 'online-help.html'}), @@ -119,6 +117,12 @@ urlpatterns = patterns('', (r'^publisher/podcast/(?P\d+)/episodes$', 'mygpo.publisher.views.episodes'), (r'^publisher/episode/(?P\d+)$', 'mygpo.publisher.views.episode'), (r'^publisher/podcast/search$', 'mygpo.publisher.views.search_podcast'), + (r'^publisher/link/$', 'mygpo.publisher.views.link'), + + #Subscribe with my.gpodder.org + (r'^subscribe', 'mygpo.web.views.podcast_subscribe_url'), + (r'^authors/$', 'mygpo.web.views.author'), + (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': os.path.abspath('%s/../htdocs/media/' % os.path.dirname(__file__))}), diff --git a/mygpo/web/templatetags/menu.py b/mygpo/web/templatetags/menu.py index 4c23e4e6..c6abb6da 100644 --- a/mygpo/web/templatetags/menu.py +++ b/mygpo/web/templatetags/menu.py @@ -10,6 +10,7 @@ HIDDEN_URIS = ( '/podcast/', '/device/', '/user/subscriptions/', + '/publisher/podcast/', ) MENU_STRUCTURE = ( @@ -17,7 +18,6 @@ MENU_STRUCTURE = ( ('/', _('Home')), ('/login/', _('Login')), ('/register/', _('Register')), - ('/authors/', _('Publisher API')), ('/online-help', _('Help')), )), (_('My Podcasts'), ( @@ -41,6 +41,11 @@ MENU_STRUCTURE = ( ('/account/privacy', _('Privacy')), ('/share/', _('Sharing')), )), + (_('Publisher'), ( + ('/publisher/', _('Home')), + ('/publisher/link/', _('Link to gpodder.net')), + ('/publisher/podcast/', _('Podcast')), + )), ) @register.filter diff --git a/mygpo/web/views/__init__.py b/mygpo/web/views/__init__.py index df8de107..5f188261 100644 --- a/mygpo/web/views/__init__.py +++ b/mygpo/web/views/__init__.py @@ -490,13 +490,6 @@ def podcast_subscribe_url(request): return HttpResponseRedirect('/podcast/%d/subscribe' % podcast.pk) -def author(request): - current_site = Site.objects.get_current() - return render_to_response('authors.html', { - 'url': current_site - }, context_instance=RequestContext(request)) - - def resend_activation(request): error_message = '' -- 2.11.4.GIT