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('
  • %s
  • ' % \ - (uri, ugettext(caption))) - else: - items.append('
  • %s
  • ' % (uri, ugettext(caption))) - - return mark_safe('\n'.join(items)) - -def get_section_items(selected): - for label, items in MENU_STRUCTURE: - if selected in (uri for uri, caption in items): - return items - - # If we arrive here, we cannot find the page items, so return a faked one - return list(MENU_STRUCTURE[0][1]) + [ - (selected, selected), - ] - -@register.filter() -def section_menu(selected, title=None): - - items = [] - for uri, caption in get_section_items(selected): - if uri == selected: - if title is not None: - if len(title) > 35: - title = title[:33] + '...' - caption = title - if uri in HIDDEN_URIS: - items.append('
  • %s
  • ' % ugettext(caption)) - elif uri == '': - items.append('' % ugettext(caption)) - else: - items.append('
  • %s
  • ' % \ - (uri, ugettext(caption))) - else: - if uri in HIDDEN_URIS: - continue - - if not uri: - items.append('' % ugettext(caption)) - else: - items.append('
  • %s
  • ' % (uri, ugettext(caption))) - - return mark_safe('\n'.join(items)) diff --git a/mygpo/web/urls.py b/mygpo/web/urls.py index 5f2374a85..cbd9e8235 100644 --- a/mygpo/web/urls.py +++ b/mygpo/web/urls.py @@ -40,7 +40,8 @@ name='help'), path('developer/', - TemplateView.as_view(template_name='developer.html')), + TemplateView.as_view(template_name='developer.html'), + name='developer'), path('contribute/', TemplateView.as_view(template_name='contribute.html'), diff --git a/static/common.css b/static/common.css new file mode 100644 index 000000000..c1e565bdb --- /dev/null +++ b/static/common.css @@ -0,0 +1,109 @@ +/* General */ + +body +{ + font-family: 'Source Sans Pro', sans-serif; +} + + +/* Overall Layout */ + +body { + padding: 0 !important; /*remove after removing bootstrap */ +} + +#wrapper { + display: grid; + /* grid-template-areas in the size-specific layouts */ +} + +header { + grid-area: header; +} + +nav.secondary { + grid-area: nav; +} + +main { + grid-area: main; +} + +aside { + grid-area: side; +} + +footer { + grid-area: footer; +} + + +/* Navigation General */ + +nav ul { + list-style-type: none; + padding-left: 0; +} + +/* Header Navigation */ + +#logo { + padding-right: 20px; +} + +header { + display: flex; +} + +header nav ul { + height: 100%; + display: flex; + flex-wrap: wrap; + align-content: center; +} + +header nav ul li { + display: inline; + padding-right: 1em; +} + +nav ul li.active { +} + +nav ul li.active a { + color: black; +} + + +/* Footer */ + +.hosting { + text-align: center; +} + + +/* Messages */ + +.status-success { + background-color: hsla(var(--color-status-success), 100%, 75%, 1); +} + +.status-error { + background-color: hsla(var(--color-status-error), 100%, 75%, 1); +} + +.status-neutral { + background-color: hsla(var(--color-status-neutral), 16%, 85%, 1); +} + + +/* Sections Navigation */ + +ul.sections li { + display: inline; +} + +ul.sections li + li:before +{ + content: 'ยท '; +} diff --git a/static/large.css b/static/large.css new file mode 100644 index 000000000..f5f9f5084 --- /dev/null +++ b/static/large.css @@ -0,0 +1,34 @@ + +/* Overall Layout */ + +#wrapper { + grid-template-areas: + "header header header" + "nav main side" + "footer footer footer"; + grid-template-columns: 10% auto fit-content(20%); + grid-column-gap: 2em; +} + +main.home { + padding-left: 20%; + width: 60%; +} + +main.home div { +} + + +/* Directory */ + +.categories { + display: grid; + grid-gap: 15px; + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr) ) ; +} + +.categories .ad { + /* span the full 2nd row */ + grid-row: 2; + grid-column: 1 / -1; +} diff --git a/static/mobile.css b/static/mobile.css new file mode 100644 index 000000000..acf10398b --- /dev/null +++ b/static/mobile.css @@ -0,0 +1,17 @@ + +/* Overall Layout */ + +#wrapper { + grid-template-areas: + "header" + "nav" + "main" + "side" + "footer"; +} + + +nav.secondary ul, +nav.secondary ul li { + display: inline; +} diff --git a/static/screen.css b/static/screen.css index 322ae97b3..90e0b3d3b 100644 --- a/static/screen.css +++ b/static/screen.css @@ -5,34 +5,10 @@ } -/* Landscape phones and down */ -@media (min-width: 980px) -{ - -#inline_logo -{ -display: none; -} - -} - /**************** General *****************/ -body -{ - font-family: 'Source Sans Pro', sans-serif; -} - -#logo -{ - position: fixed; - left: 20px; - top: -2px; - z-index: 4000; -} - body h1 { font-size: 3em; @@ -175,10 +151,6 @@ table.list th.group i { color: #222; hypens: auto; - -webkit-hyphens: auto; - -moz-hyphens: auto; - -ms-hyphens: auto; - -o-hyphens: auto; text-align: justify; } @@ -253,7 +225,8 @@ img.device_icon Searching *******************/ -form.search input[type="text"] +form.search input[type="text"], +form.search input[type="search"] { width: 300px; display: inline; @@ -404,6 +377,12 @@ iframe.results Footer *******************/ +footer nav { + padding: 0 20% 0 25%; + display: flex; + justify-content: space-around; +} + footer, footer a { color: #777; @@ -616,20 +595,3 @@ div.podcasts div.podcast:hover div.actions button.btn float: none; margin: 0 auto; } - -.hosting { - text-align: center; -} - -.status-success { - background-color: hsla(var(--color-status-success), 100%, 75%, 1); -} - - -.status-error { - background-color: hsla(var(--color-status-error), 100%, 75%, 1); -} - -.status-neutral { - background-color: hsla(var(--color-status-neutral), 16%, 85%, 1); -}