From 489ab3244bdf3ea46a90c4233547e11b9ef45a07 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 15 Jul 2015 18:52:55 -0300 Subject: [PATCH] Add base templates --- sapl/settings.py | 2 +- sapl/urls.py | 2 ++ templates/base.html | 67 ++++++++++++++++++++++++++++++++++++++++++++ templates/index.html | 9 ++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 templates/base.html create mode 100644 templates/index.html diff --git a/sapl/settings.py b/sapl/settings.py index 148131121..7eb00ffe0 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -73,7 +73,7 @@ ROOT_URLCONF = 'sapl.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': ['templates'], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/sapl/urls.py b/sapl/urls.py index e31bc62d6..6b5a56e55 100644 --- a/sapl/urls.py +++ b/sapl/urls.py @@ -15,9 +15,11 @@ Including another URLconf """ from django.conf.urls import include, url from django.contrib import admin +from django.views.generic.base import TemplateView urlpatterns = [ + url(r'^$', TemplateView.as_view(template_name='index.html')), url(r'^admin/', include(admin.site.urls)), url(r'^comissoes/', include('comissoes.urls')), ] diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 000000000..89a701bc3 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,67 @@ +{% load bootstrap3 %} +{% load i18n %} +{% load static from staticfiles %} + + + + {% block title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %} + + + + + + + + {# TODO review these js dependencies #} + + + + + + + {% block extrahead %}{% endblock %} + + + + + +
+ +
+ ... header ... +
+
+ + +
+ + {% block content_title %}{% if title %}

{{ title }}

{% endif %}{% endblock %} + + {% bootstrap_messages %} + + {% block content %}{% endblock %} +
+ + +
+
+ ... footer... +
+
+ + + + diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 000000000..702c799a1 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} +{% load i18n bootstrap3 %} + +{% block content %} +
+

Bem-vindo ao SAPL!

+
+{% endblock %} +