Browse Source

Add base templates

pull/6/head
Marcio Mazza 10 years ago
parent
commit
489ab3244b
  1. 2
      sapl/settings.py
  2. 2
      sapl/urls.py
  3. 67
      templates/base.html
  4. 9
      templates/index.html

2
sapl/settings.py

@ -73,7 +73,7 @@ ROOT_URLCONF = 'sapl.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [], 'DIRS': ['templates'],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [

2
sapl/urls.py

@ -15,9 +15,11 @@ Including another URLconf
""" """
from django.conf.urls import include, url from django.conf.urls import include, url
from django.contrib import admin from django.contrib import admin
from django.views.generic.base import TemplateView
urlpatterns = [ urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='index.html')),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'^comissoes/', include('comissoes.urls')), url(r'^comissoes/', include('comissoes.urls')),
] ]

67
templates/base.html

@ -0,0 +1,67 @@
{% load bootstrap3 %}
{% load i18n %}
{% load static from staticfiles %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>{% block title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<link href="{% static "bootstrap/css/bootstrap.min.css" %}" rel="stylesheet"/>
<style type="text/css">
body {
padding: 10px 20px 40px;
}
</style>
<link href="{% static "bootstrap/css/bootstrap-theme.min.css" %}" rel="stylesheet"/>
{# TODO review these js dependencies #}
<script src="{% static "admin/js/jquery-1.9.1.min.js" %}"></script>
<script src="{% static "admin/js/jquery-migrate-1.2.1.min.js" %}"></script>
<script src="{% static "bootstrap/js/bootstrap.min.js" %}"></script>
<script type="text/javascript">
//<![CDATA[
(function($) {
$(document).ready(function() {
$('input[type="submit"]').addClass('btn');
$('[title]').tooltip();
});
}(jQuery));
//]]>
</script>
{% block extrahead %}{% endblock %}
</head>
<body>
<!-- Container -->
<div class="container-fluid">
<header>
... header ...
<hr/>
</header>
<!-- Content -->
<div id="content" class="{% block coltype %}colM{% endblock %}">
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
{% bootstrap_messages %}
{% block content %}{% endblock %}
</div>
<!-- END Content -->
<footer id="footer">
<hr/>
... footer...
</footer>
</div>
<!-- END Container -->
</body>
</html>

9
templates/index.html

@ -0,0 +1,9 @@
{% extends "base.html" %}
{% load i18n bootstrap3 %}
{% block content %}
<div id="content-main">
<h1>Bem-vindo ao SAPL!</h1>
</div>
{% endblock %}
Loading…
Cancel
Save