From: Aleksander Łukasz Date: Tue, 22 Oct 2013 10:01:14 +0000 (+0200) Subject: Fix contact pages X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/b63631cbb789e063f859d447e3010748b595edfb?ds=sidebyside Fix contact pages --- diff --git a/edumed/milurls.py b/edumed/milurls.py index 201f85d..3ad16c7 100644 --- a/edumed/milurls.py +++ b/edumed/milurls.py @@ -1,7 +1,7 @@ from django.conf.urls import include, url, patterns from fnpdjango.utils.urls import i18n_patterns -from .views import mil_home_view +from .views import mil_home_view, mil_contact_view urlpatterns = i18n_patterns('', @@ -9,13 +9,7 @@ urlpatterns = i18n_patterns('', url(r'^kompetencje/', include('curriculum.urls')), url(r'^wez-udzial/', include('comment.urls')), url(r'^zglos/', include('contact.urls')), -) - -urlpatterns += patterns('', - url(r'^kontakt/', 'django.contrib.flatpages.views.flatpage', {'url': 'kontakt/'}, - name="info_contact_pl"), - url(r'^contact/', 'django.contrib.flatpages.views.flatpage', {'url': 'contact/'}, - name="info_contact_en"), + url(r'^kontakt/$', mil_contact_view, name='mil_contact') ) handler404 = 'edumed.views.mil_404_view' diff --git a/edumed/templates/base_mil.html b/edumed/templates/base_mil.html index 1cacefa..fbd42cb 100644 --- a/edumed/templates/base_mil.html +++ b/edumed/templates/base_mil.html @@ -12,7 +12,7 @@ {% if request.LANGUAGE_CODE == 'pl' %}
  • Materiały edukacyjne
  • {% endif %} -
  • {% trans 'Contact' %}
  • +
  • {% trans 'Contact' %}
  • {% lang_switcher %}
  • {% endblock %} diff --git a/edumed/views.py b/edumed/views.py index 009f6a0..a6c1aa6 100755 --- a/edumed/views.py +++ b/edumed/views.py @@ -23,5 +23,8 @@ def mil_home_view(request): def mil_404_view(request): return page_not_found(request, '404_mil.html') +def mil_contact_view(request): + return flatpage(request, url = '/kontakt_mil/' if request.LANGUAGE_CODE == 'pl' else '/contact_mil/') + class AvatarlessProfileEditView(ProfileEditView): form_class = AvatarlessEditProfileForm