From ca473e6f63c32db5e5f8abf52ef72a8d03f25c45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Fri, 18 Oct 2013 09:42:15 +0200 Subject: [PATCH] Use Django flatpages mechanism for mil home page --- edumed/milurls.py | 8 ++++++-- edumed/templates/base_mil.html | 2 +- edumed/templates/flatpages/mil.html | 10 ++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 edumed/templates/flatpages/mil.html diff --git a/edumed/milurls.py b/edumed/milurls.py index 89a65c5..0b3ea6c 100644 --- a/edumed/milurls.py +++ b/edumed/milurls.py @@ -1,15 +1,19 @@ -from django.conf.urls import include, url +from django.conf.urls import include, url, patterns from fnpdjango.utils.urls import i18n_patterns from .views import MILHomeView urlpatterns = i18n_patterns('', - url(r'^$', MILHomeView.as_view(), name="mil_home"), url(r'^kompetencje/', include('curriculum.urls')), url(r'^wez-udzial/', include('comment.urls')) ) +urlpatterns += patterns('', + url(r'^$', 'django.contrib.flatpages.views.flatpage', {'url': '/'}, name="mil_home_pl"), + url(r'^en/$', 'django.contrib.flatpages.views.flatpage', {'url': '/en/'}, name="mil_home_en") +) + handler404 = 'edumed.views.mil_404_view' diff --git a/edumed/templates/base_mil.html b/edumed/templates/base_mil.html index e5300e6..dec800b 100644 --- a/edumed/templates/base_mil.html +++ b/edumed/templates/base_mil.html @@ -5,7 +5,7 @@ {% load i18n %} {% block top_navigation %} -
  • {% trans 'Consultations' %}
  • +
  • {% trans 'Consultations' %}
  • {% trans 'Competencies' %}
  • {% trans 'Take Part' %}
  • {% if request.LANGUAGE_CODE == 'pl' %} diff --git a/edumed/templates/flatpages/mil.html b/edumed/templates/flatpages/mil.html new file mode 100644 index 0000000..5ac86a6 --- /dev/null +++ b/edumed/templates/flatpages/mil.html @@ -0,0 +1,10 @@ +{% extends "base_mil.html" %} +{% load textile_pl from fnp_markup %} + +{% block title %}{{ flatpage.title }}{% endblock %} + +{% block body %} +
    +{{ flatpage.content|textile_pl }} +
    +{% endblock %} -- 2.20.1