add imprint as flatpage

- add flatpages app to gnuviechadmin.settings.base.DJANGO_APPS
- add imprint handling to gnuviechadmin.context_processors.navigation, remove
  unused about page handling
- add URL 'imprint' to gnuviechadmin.urls
- replace link 'about' in template base.html with 'imprint'
- add templates for flatpages
- add german translation for imprint and contact navigation links
This commit is contained in:
Jan Dittberner 2015-02-01 16:34:46 +01:00
parent cea780a9b2
commit 2b0f1f9f89
8 changed files with 35 additions and 7 deletions

View file

@ -1,6 +1,7 @@
Changelog Changelog
========= =========
* :feature:`-` add imprint as flatpage
* :support:`-` mark active menu item as active via context_processor and * :support:`-` mark active menu item as active via context_processor and
corresponding template markup corresponding template markup
* :feature:`-` add links to webmail, phpmyadmin and phppgadmin * :feature:`-` add links to webmail, phpmyadmin and phppgadmin

View file

@ -34,8 +34,6 @@ def navigation(request):
viewmodule = viewfunc.__module__ viewmodule = viewfunc.__module__
if viewmodule == 'contact.views': if viewmodule == 'contact.views':
context['active_item'] = 'contact' context['active_item'] = 'contact'
elif viewmodule == 'about.views':
context['active_item'] = 'about'
elif viewmodule in ( elif viewmodule in (
'hostingpackages.views', 'osusers.views', 'userdbs.views', 'hostingpackages.views', 'osusers.views', 'userdbs.views',
'managemails.views', 'websites.views', 'domains.views', 'managemails.views', 'websites.views', 'domains.views',
@ -45,6 +43,11 @@ def navigation(request):
'allauth.account.views', 'allauth.socialaccount.views' 'allauth.account.views', 'allauth.socialaccount.views'
): ):
context['active_item'] = 'account' context['active_item'] = 'account'
elif (
viewmodule == 'django.contrib.flatpages.views' and
request.path.endswith('/impressum/')
):
context['active_item'] = 'imprint'
else: else:
_LOGGER.debug( _LOGGER.debug(
'no special handling for view %s in module %s, fallback to ' 'no special handling for view %s in module %s, fallback to '

View file

@ -239,7 +239,9 @@ DJANGO_APPS = (
# Admin panel and documentation: # Admin panel and documentation:
'django.contrib.admin', 'django.contrib.admin',
# 'django.contrib.admindocs',
# Flatpages for about page
'django.contrib.flatpages',
'crispy_forms', 'crispy_forms',
) )

View file

@ -18,6 +18,10 @@ urlpatterns = patterns(
url(r'^osuser/', include('osusers.urls')), url(r'^osuser/', include('osusers.urls')),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
) )
urlpatterns += patterns(
'django.contrib.flatpages.views',
url(r'^impressum/$', 'flatpage', {'url': '/impressum/'}, name='imprint'),
)
# Uncomment the next line to serve media files in dev. # Uncomment the next line to serve media files in dev.
# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View file

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnuviechadmin\n" "Project-Id-Version: gnuviechadmin\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-01 15:07+0100\n" "POT-Creation-Date: 2015-02-01 16:31+0100\n"
"PO-Revision-Date: 2015-02-01 15:08+0100\n" "PO-Revision-Date: 2015-02-01 16:31+0100\n"
"Last-Translator: Jan Dittberner <jan@dittberner.info>\n" "Last-Translator: Jan Dittberner <jan@dittberner.info>\n"
"Language-Team: Jan Dittberner <jan@dittberner.info>\n" "Language-Team: Jan Dittberner <jan@dittberner.info>\n"
"Language: de\n" "Language: de\n"
@ -473,6 +473,14 @@ msgstr "phpPgAdmin - PostgreSQL-Datenbankverwaltungswerkzeug"
msgid "phpPgAdmin" msgid "phpPgAdmin"
msgstr "phpPgAdmin" msgstr "phpPgAdmin"
#: templates/base.html:67
msgid "Imprint"
msgstr "Impressum"
#: templates/base.html:68
msgid "Contact"
msgstr "Kontakt"
#: templates/base.html:73 #: templates/base.html:73
msgid "My Account" msgid "My Account"
msgstr "Mein Konto" msgstr "Mein Konto"

View file

@ -64,8 +64,8 @@
<li><a href="{{ phppgadmin_url }}" title="{% trans "phpPgAdmin - PostgreSQL database administration tool" %}"><i class="icon-postgres"></i> {% trans "phpPgAdmin" %}</a></li> <li><a href="{{ phppgadmin_url }}" title="{% trans "phpPgAdmin - PostgreSQL database administration tool" %}"><i class="icon-postgres"></i> {% trans "phpPgAdmin" %}</a></li>
</ul> </ul>
</li> </li>
<li{% if active_item == 'about' %} class="active"{% endif %}><a href="#about">About</a></li> <li{% if active_item == 'imprint' %} class="active"{% endif %}><a href="{% url 'imprint' %}">{% trans "Imprint" %}</a></li>
<li{% if active_item == 'contact' %} class="active"{% endif %}><a href="#contact">Contact</a></li> <li{% if active_item == 'contact' %} class="active"{% endif %}><a href="#contact">{% trans "Contact" %}</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
{% if user.is_authenticated %} {% if user.is_authenticated %}

View file

@ -0,0 +1 @@
{% extends "base.html" %}

View file

@ -0,0 +1,9 @@
{% extends "flatpages/base.html" %}
{% block title %}{{ block.super }} - {{ flatpage.title }}{% endblock title %}
{% block page_title %}{{ flatpage.title }}{% endblock page_title %}
{% block content %}
{{ flatpage.content }}
{% endblock content %}