From ed0db62b6d7a88e7a7862d8abf8976a3d58f3f17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 15 Oct 2013 10:43:22 +0200 Subject: [PATCH] Refactoring - we don't actually need separate mil app --- curriculum/templates/curriculum/competence_detail.html | 2 +- curriculum/templates/curriculum/competence_list.html | 2 +- mil/urls.py => edumed/milurls.py | 7 +++++-- edumed/settings.d/20-basic.py | 2 +- edumed/settings.d/30-apps.py | 1 - .../mil/base.html => edumed/templates/base_mil.html | 8 ++------ edumed/templates/home_mil.html | 5 +++++ edumed/views.py | 5 +++++ mil/__init__.py | 0 mil/views.py | 6 ------ 10 files changed, 20 insertions(+), 18 deletions(-) rename mil/urls.py => edumed/milurls.py (60%) rename mil/templates/mil/base.html => edumed/templates/base_mil.html (75%) create mode 100644 edumed/templates/home_mil.html delete mode 100644 mil/__init__.py delete mode 100644 mil/views.py diff --git a/curriculum/templates/curriculum/competence_detail.html b/curriculum/templates/curriculum/competence_detail.html index d850f31..20125ff 100755 --- a/curriculum/templates/curriculum/competence_detail.html +++ b/curriculum/templates/curriculum/competence_detail.html @@ -1,4 +1,4 @@ -{% extends "mil/base.html" %} +{% extends "base_mil.html" %} {% block title %}{{ object }}{% endblock %} diff --git a/curriculum/templates/curriculum/competence_list.html b/curriculum/templates/curriculum/competence_list.html index 8b1de32..499e316 100755 --- a/curriculum/templates/curriculum/competence_list.html +++ b/curriculum/templates/curriculum/competence_list.html @@ -1,4 +1,4 @@ -{% extends "mil/base.html" %} +{% extends "base_mil.html" %} {% load chunks %} {% block title %}Katalog kompetencji medialnych i informacyjnych{% endblock %} diff --git a/mil/urls.py b/edumed/milurls.py similarity index 60% rename from mil/urls.py rename to edumed/milurls.py index 7f77523..c2f375a 100644 --- a/mil/urls.py +++ b/edumed/milurls.py @@ -1,8 +1,11 @@ from django.conf.urls import patterns, include, url -from .views import root +from .views import MILHomeView urlpatterns = patterns('', - url(r'^$', root, name="root"), + url(r'^$', MILHomeView.as_view(), name="mil_home"), url(r'^kompetencje/', include('curriculum.urls')), ) + + + diff --git a/edumed/settings.d/20-basic.py b/edumed/settings.d/20-basic.py index 340a94c..9d0a384 100644 --- a/edumed/settings.d/20-basic.py +++ b/edumed/settings.d/20-basic.py @@ -25,7 +25,7 @@ ROOT_URLCONF = 'edumed.urls' SUBDOMAIN_URLCONFS = { None: 'edumed.urls', - 'katalog': 'mil.urls', + 'katalog': 'edumed.milurls', } # Python dotted path to the WSGI application used by Django's runserver. diff --git a/edumed/settings.d/30-apps.py b/edumed/settings.d/30-apps.py index f5d04e7..1f9fdb8 100644 --- a/edumed/settings.d/30-apps.py +++ b/edumed/settings.d/30-apps.py @@ -2,7 +2,6 @@ INSTALLED_APPS = ( 'edumed', 'curriculum', 'catalogue', - 'mil', 'fnpdjango', 'south', diff --git a/mil/templates/mil/base.html b/edumed/templates/base_mil.html similarity index 75% rename from mil/templates/mil/base.html rename to edumed/templates/base_mil.html index c7c9cfd..d48be10 100644 --- a/mil/templates/mil/base.html +++ b/edumed/templates/base_mil.html @@ -1,14 +1,10 @@ {% extends "base_super.html" %} {% load subdomainurls %} - {% block top_navigation %} -
  • Konsultacje
  • +{% block top_navigation %} +
  • Konsultacje
  • Kompetencje
  • Weź udział
  • Materiały edukacyjne
  • Kontakt
  • {% endblock %} - -{% block body %} -mil -{% endblock %} \ No newline at end of file diff --git a/edumed/templates/home_mil.html b/edumed/templates/home_mil.html new file mode 100644 index 0000000..4bfb581 --- /dev/null +++ b/edumed/templates/home_mil.html @@ -0,0 +1,5 @@ +{% extends "base_mil.html" } + +{% block body %} +mil +{% endblock %} diff --git a/edumed/views.py b/edumed/views.py index bde67ef..7d4818d 100755 --- a/edumed/views.py +++ b/edumed/views.py @@ -14,5 +14,10 @@ class HomeView(TemplateView): context['package_student_url'] = os.path.join(settings.MEDIA_URL, settings.CATALOGUE_PACKAGE_STUDENT) return context + +class MILHomeView(TemplateView): + template_name = 'base_mil.html' + + class AvatarlessProfileEditView(ProfileEditView): form_class = AvatarlessEditProfileForm diff --git a/mil/__init__.py b/mil/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/mil/views.py b/mil/views.py deleted file mode 100644 index b72a8d9..0000000 --- a/mil/views.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.http import HttpResponse -from django.shortcuts import render - - -def root(request): - return render(request, 'mil/base.html') -- 2.20.1