diff --git a/sigi/apps/home/urls.py b/sigi/apps/home/urls.py new file mode 100644 index 0000000..5d2b601 --- /dev/null +++ b/sigi/apps/home/urls.py @@ -0,0 +1,7 @@ +# coding: utf-8 +from django.conf.urls import patterns, url + + +urlpatterns = patterns('sigi.apps.home.views', + url(r'^$', 'index', name='sigi_index'), +) diff --git a/sigi/context_processors.py b/sigi/apps/home/views.py similarity index 87% rename from sigi/context_processors.py rename to sigi/apps/home/views.py index acc314f..d0a187f 100644 --- a/sigi/context_processors.py +++ b/sigi/apps/home/views.py @@ -1,21 +1,42 @@ -#-*- coding:utf-8 -*- -from itertools import cycle +# -*- coding: utf-8 -*- +# +# sigi.apps.home.views +# +# Copyright (c) 2016 by Interlegis +# +# GNU General Public License (GPL) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. +# import datetime +from django.shortcuts import render from django.utils.translation import ugettext as _ - +from itertools import cycle from sigi.apps.casas.models import CasaLegislativa from sigi.apps.convenios.models import Convenio, Projeto from sigi.apps.diagnosticos.models import Diagnostico from sigi.apps.metas.models import Meta from sigi.apps.servicos.models import TipoServico +from django.views.decorators.cache import never_cache +from django.contrib.auth.decorators import login_required - -def charts_data(request): - """ - Busca informacoes para a criacao dos graficos e resumos - """ - +@never_cache +@login_required +def index(request): convenios = Convenio.objects.all() convenios_assinados = convenios.exclude(data_retorno_assinatura=None) @@ -24,14 +45,14 @@ def charts_data(request): tabela_resumo_diagnostico = busca_informacoes_diagnostico() dados_graficos_convenio_projeto = [(1, grafico_convenio_projeto(convenios)), (2, grafico_convenio_projeto(convenios_assinados))] - return { + context = { 'tabela_resumo_camara': tabela_resumo_camara, 'tabela_resumo_seit': tabela_resumo_seit, 'tabela_resumo_diagnostico': tabela_resumo_diagnostico, 'dados_graficos_convenio_projeto': dados_graficos_convenio_projeto, 'metas': Meta.objects.all(), } - + return render(request, 'index.html', context) def busca_informacoes_camara(): """ diff --git a/sigi/settings/base.py b/sigi/settings/base.py index 0a20afe..c50c041 100644 --- a/sigi/settings/base.py +++ b/sigi/settings/base.py @@ -31,7 +31,6 @@ MANAGERS = ADMINS SITE_ID = 1 TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + ( - 'sigi.context_processors.charts_data', 'django.core.context_processors.request', ) # List of callables that know how to import templates from various sources. diff --git a/sigi/urls.py b/sigi/urls.py index 4ca1707..38fe8f9 100644 --- a/sigi/urls.py +++ b/sigi/urls.py @@ -25,7 +25,7 @@ urlpatterns = patterns( url(r'^ocorrencias/', include('sigi.apps.ocorrencias.urls')), url(r'^eventos/', include('sigi.apps.eventos.urls')), url(r'^pentaho/(?P(plugin|api)/.*)$', pentaho_proxy), - + url(r'^', include('sigi.apps.home.urls')), url(r'^', include(admin.site.urls)), # to enable language selection diff --git a/sigiStatic/css/base_site.css b/sigiStatic/css/base_site.css index 84efad4..f8b1c52 100644 --- a/sigiStatic/css/base_site.css +++ b/sigiStatic/css/base_site.css @@ -233,3 +233,8 @@ h1 { .container-flex > div[class*='col-'] #map div, .row-flex > div[class*='col-'] #map div { width: initial; } + +.pilllabel { + display: block; + padding: 10px; +} \ No newline at end of file diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html index 9c50b07..179db60 100644 --- a/templates/admin/base_site.html +++ b/templates/admin/base_site.html @@ -54,14 +54,6 @@

{% trans 'É recomendado o uso das informações aqui fornecidas fora do âmbito do Interlegis' %}.

{% trans 'SIGI é um software livre e seus fontes estão disponíveis no' %} Colab.

-
- -
{% endif %} diff --git a/templates/index.html b/templates/index.html index eafc72a..3e332a2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -12,160 +12,30 @@ - - - {# Highcharts scripts #} - {# #} - {# #} - {##} - {# #} - {# end highcharts scripts #}