diff --git a/mygpo/administration/templates/admin/activate-user.html b/mygpo/administration/templates/admin/activate-user.html index 792df1f0c..bea266125 100644 --- a/mygpo/administration/templates/admin/activate-user.html +++ b/mygpo/administration/templates/admin/activate-user.html @@ -2,10 +2,6 @@ {% load i18n %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Activate User" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/clients.html b/mygpo/administration/templates/admin/clients.html index 7d06439d7..ce68b1fc0 100644 --- a/mygpo/administration/templates/admin/clients.html +++ b/mygpo/administration/templates/admin/clients.html @@ -3,10 +3,6 @@ {% load charts %} {% load utils %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Admin Area" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/filetypes.html b/mygpo/administration/templates/admin/filetypes.html index b4c06b567..7d65ecf2b 100644 --- a/mygpo/administration/templates/admin/filetypes.html +++ b/mygpo/administration/templates/admin/filetypes.html @@ -3,10 +3,6 @@ {% load charts %} {% load utils %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "File Type Stats" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/hostinfo.html b/mygpo/administration/templates/admin/hostinfo.html index ad273f682..761e31897 100644 --- a/mygpo/administration/templates/admin/hostinfo.html +++ b/mygpo/administration/templates/admin/hostinfo.html @@ -3,10 +3,6 @@ {% load time %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Host Information" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/make-publisher-input.html b/mygpo/administration/templates/admin/make-publisher-input.html index c99d8f1fc..462bb9793 100644 --- a/mygpo/administration/templates/admin/make-publisher-input.html +++ b/mygpo/administration/templates/admin/make-publisher-input.html @@ -2,10 +2,6 @@ {% load i18n %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Publisher Permissions" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/make-publisher-result.html b/mygpo/administration/templates/admin/make-publisher-result.html index 9685fc3eb..c410a15ee 100644 --- a/mygpo/administration/templates/admin/make-publisher-result.html +++ b/mygpo/administration/templates/admin/make-publisher-result.html @@ -2,10 +2,6 @@ {% load i18n %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Publisher Permissions" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/merge-grouping.html b/mygpo/administration/templates/admin/merge-grouping.html index 94a5c8dae..e0a0b5d6f 100644 --- a/mygpo/administration/templates/admin/merge-grouping.html +++ b/mygpo/administration/templates/admin/merge-grouping.html @@ -3,10 +3,6 @@ {% load podcasts %} {% load episodes %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Admin Area" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/merge-select.html b/mygpo/administration/templates/admin/merge-select.html index 818438b1b..605e493f4 100644 --- a/mygpo/administration/templates/admin/merge-select.html +++ b/mygpo/administration/templates/admin/merge-select.html @@ -2,10 +2,6 @@ {% load i18n %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Admin Area" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/overview.html b/mygpo/administration/templates/admin/overview.html index 4fea5e4ba..287fc188e 100644 --- a/mygpo/administration/templates/admin/overview.html +++ b/mygpo/administration/templates/admin/overview.html @@ -2,10 +2,6 @@ {% load i18n %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Admin Area" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/stats.html b/mygpo/administration/templates/admin/stats.html index 554c1dc58..1204d03d4 100644 --- a/mygpo/administration/templates/admin/stats.html +++ b/mygpo/administration/templates/admin/stats.html @@ -2,10 +2,6 @@ {% load i18n %} {% load charts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Admin Area" %}{% endblock %} {% block header %} diff --git a/mygpo/administration/templates/admin/task-status.html b/mygpo/administration/templates/admin/task-status.html index 9abe6bdef..1facb83c7 100644 --- a/mygpo/administration/templates/admin/task-status.html +++ b/mygpo/administration/templates/admin/task-status.html @@ -2,10 +2,6 @@ {% load i18n %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block head %} {% if not ready %} diff --git a/mygpo/administration/templates/admin/useragents.html b/mygpo/administration/templates/admin/useragents.html index 9e941c458..2501199f8 100644 --- a/mygpo/administration/templates/admin/useragents.html +++ b/mygpo/administration/templates/admin/useragents.html @@ -2,10 +2,6 @@ {% load i18n %} {% load charts %} -{% load menu %} -{% block mainmenu %}{{ "/admin/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/admin/"|section_menu:"Admin" }}{% endblock %} - {% block title %}{% trans "Admin Area" %}{% endblock %} {% block header %} diff --git a/mygpo/directory/templates/carousel.html b/mygpo/directory/templates/carousel.html index 9b9a86671..126f17260 100644 --- a/mygpo/directory/templates/carousel.html +++ b/mygpo/directory/templates/carousel.html @@ -7,10 +7,6 @@ {% load utils %} {% load cache %} -{% load menu %} -{% block mainmenu %}{{ "/directory/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/directory/"|section_menu }}{% endblock %} - {% block head %} - + + + + - - diff --git a/mygpo/web/templates/user_subscriptions.html b/mygpo/web/templates/user_subscriptions.html index 7ec5d85ed..8800c1e56 100644 --- a/mygpo/web/templates/user_subscriptions.html +++ b/mygpo/web/templates/user_subscriptions.html @@ -2,10 +2,6 @@ {% load i18n %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/share/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/user/subscriptions/"|section_menu:other_user.username }}{% endblock %} - {% block head %} {% endblock %} diff --git a/mygpo/web/templates/user_subscriptions_denied.html b/mygpo/web/templates/user_subscriptions_denied.html index 9e6b705ba..ae076f638 100644 --- a/mygpo/web/templates/user_subscriptions_denied.html +++ b/mygpo/web/templates/user_subscriptions_denied.html @@ -2,10 +2,6 @@ {% load i18n %} {% load podcasts %} -{% load menu %} -{% block mainmenu %}{{ "/user/subscriptions/"|main_menu }}{% endblock %} -{% block sectionmenu %}{{ "/user/subscriptions/"|section_menu:other_user.username }}{% endblock %} - {% block title %} {% blocktrans with other_user.username as username%}{{ username }}'s Subscriptions{% endblocktrans %} {% endblock %} diff --git a/mygpo/web/templatetags/menu.py b/mygpo/web/templatetags/menu.py deleted file mode 100644 index 7effd73d8..000000000 --- a/mygpo/web/templatetags/menu.py +++ /dev/null @@ -1,128 +0,0 @@ -from django import template -from django.utils.safestring import mark_safe -from django.utils.translation import ugettext -from django.utils.translation import ugettext_lazy as _ - - - -register = template.Library() - -HIDDEN_URIS = ( - '/login/', - '/register/', - '/podcast/', - '/device/', - '/user/subscriptions/', - '/publisher/podcast/', - '/share/me', -) - -MENU_STRUCTURE = ( - ('', ( - ('/', _('Home')), - ('/login/', _('Login')), - ('/register/', _('Register')), - ('', _('Docs')), - ('/contribute/', _('Contribute')), - ('/developer/', _('Development')), - ('/privacy/', _('Privacy Policy')), - ('/online-help', _('Help')), - )), - (_('Discover'), ( - ('/directory/', _('Directory')), - ('/podcast/', _('Podcast')), - ('/search/', _('Search')), - ('/missing/', _('Missing Podcast')), - ('/lists/', _('Podcast Lists')), - ('/user/subscriptions/', _('User subscriptions')), - ('/suggestions/', _('Suggestions')), - ('', _('Features')), - ('/directory/+license', _('License')), - ('', _('Toplists')), - ('/toplist/', _('Podcasts')), - ('/toplist/episodes', _('Episodes')), - )), - (_('Subscriptions'), ( - ('/subscriptions/', _('Subscriptions')), - ('/favorites/', _('Favorite Episodes')), - ('/tags/', _('My Tags')), - ('/devices/', _('Devices')), - ('/device/', _('Device')), - ('/history/', _('History')), - )), - (_('Community'), ( - ('/share/', _('Overview')), - ('/share/favorites', _('Favorite Episodes')), - ('/share/me', _('My Userpage')), - ('/user/subscriptions/', _('Subscriptions')), - ('/share/lists/', _('Podcast Lists')), - )), - (_('Settings'), ( - ('/account/', _('Account')), - ('/account/privacy', _('Privacy')), - )), - (_('Publish'), ( - ('/publisher/', _('Home')), - ('/publisher/advertise', _('Advertise')), - ('/publisher/link/', _('Link to gpodder.net')), - ('/publisher/podcast/', _('Podcast')), - )), -) - -@register.filter() -def main_menu(selected): - found_section = False - links = [] - for label, items in MENU_STRUCTURE[1:]: - uris = [uri for uri, caption in items] - if selected in uris: - found_section = True - links.append((items[0][0], label, uris)) - - items = [] - for uri, caption, subpages in links: - if selected in subpages or ('/' in subpages and not found_section): - items.append('