diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index b820245..c493c4f 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -20,6 +20,8 @@ from sigi.apps.inventario.models import Bem from sigi.apps.servicos.models import Servico from sigi.apps.metas.models import PlanoDiretor from sigi.apps.ocorrencias.models import Ocorrencia +from django.utils.translation import ugettext as _ + class TelefonesInline(generic.GenericTabularInline): model = Telefone @@ -157,7 +159,7 @@ class CasaLegislativaAdmin(admin.ModelAdmin): DiagnosticoInline, BemInline, ServicoInline, PlanoDiretorInline, OcorrenciaInline, ) list_display = ('nome','municipio','logradouro', 'ult_alt_endereco', 'get_convenios') list_display_links = ('nome',) - list_filter = ('tipo', 'municipio', 'search_text') + list_filter = ('tipo', 'municipio__uf__nome', 'convenio__projeto') ordering = ('nome','municipio__uf') queyrset = queryset_ascii fieldsets = ( diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index ba70269..f3d745c 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -36,13 +36,13 @@ class CasaLegislativa(models.Model): # Guarda um campo para ser usado em buscas em caixa baixa e sem acento search_text = SearchField(field_names=['nome']) - search_text.projeto_filter = True + # search_text.projeto_filter = True tipo = models.ForeignKey(TipoCasaLegislativa, verbose_name="Tipo") cnpj = models.CharField('CNPJ', max_length=32, blank=True) observacoes = models.TextField(u'observações', blank=True) # num_parlamentares = models.PositiveIntegerField('Número de parlamentares') codigo_interlegis = models.CharField('Código Interlegis', max_length=3, blank=True) - codigo_interlegis.ts_filter = True + # codigo_interlegis.ts_filter = True # Informações de contato logradouro = models.CharField( @@ -50,11 +50,13 @@ class CasaLegislativa(models.Model): help_text='Avenida, rua, praça, jardim, parque...' ) bairro = models.CharField(max_length=100, blank=True) + municipio = models.ForeignKey( 'contatos.Municipio', verbose_name='município' ) - municipio.uf_filter = True + # municipio.uf_filter = True + cep = models.CharField(max_length=32) email = models.EmailField('e-mail', max_length=128, blank=True) pagina_web = models.URLField( @@ -263,7 +265,7 @@ class Funcionario(models.Model): casa_legislativa = models.ForeignKey(CasaLegislativa) nome = models.CharField('nome completo', max_length=60, blank=False) - nome.alphabetic_filter = True + # nome.alphabetic_filter = True sexo = models.CharField(max_length=1, choices=SEXO_CHOICES, default="M") nota = models.CharField(max_length=70, null=True, blank=True) email = models.CharField('e-mail', max_length=75, blank=True) diff --git a/sigi/apps/contatos/models.py b/sigi/apps/contatos/models.py index c3a9dc7..3f483c9 100644 --- a/sigi/apps/contatos/models.py +++ b/sigi/apps/contatos/models.py @@ -5,6 +5,8 @@ from django.contrib.contenttypes import generic from sigi.apps.utils import SearchField from django.core.validators import MaxValueValidator, MinValueValidator + + class UnidadeFederativa(models.Model): """ Modelo que representa um estado brasileiro """ @@ -21,7 +23,7 @@ class UnidadeFederativa(models.Model): unique=True, help_text='Código do estado segundo IBGE.' ) - nome = models.CharField(max_length=25) + nome = models.CharField('Nome UF', max_length=25) # Campo de busca em caixa baixa sem acento search_text = SearchField(field_names=['nome']) sigla = models.CharField( diff --git a/sigi/apps/convenios/templates/convenios/carrinho.html b/sigi/apps/convenios/templates/convenios/carrinho.html index 620421d..07e3536 100644 --- a/sigi/apps/convenios/templates/convenios/carrinho.html +++ b/sigi/apps/convenios/templates/convenios/carrinho.html @@ -1,5 +1,5 @@ {% extends "admin/carrinho.html" %} -{% load adminmedia admin_list i18n %} +{% load admin_list i18n %} {% block extrastyle %} {{ block.super }} {% include "admin/tabs_style.html" %} diff --git a/sigi/apps/convenios/urls.py b/sigi/apps/convenios/urls.py index 9386b9d..3c692e8 100644 --- a/sigi/apps/convenios/urls.py +++ b/sigi/apps/convenios/urls.py @@ -5,7 +5,8 @@ from django.conf.urls import patterns, url urlpatterns = patterns('sigi.apps.convenios.views', url(r'^reports/$', 'report', name='convenios-report'), url(r'^carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), - url(r'^carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), - url(r'^carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), - # url(r'^$', '', name=''), + url(r'^carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), #tagerror + url(r'^carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), #tagerror + url(r'^csv/$', 'export_csv', name='convenios-csv'), + url(r'^reportsRegiao/(?P\w+)/$', 'report_regiao', name='convenios-report_regiao_pdf'), ) \ No newline at end of file diff --git a/sigi/apps/convenios/views.py b/sigi/apps/convenios/views.py index 070d0d5..a06f195 100644 --- a/sigi/apps/convenios/views.py +++ b/sigi/apps/convenios/views.py @@ -39,7 +39,7 @@ def get_for_qs(get,qs): kwargs = {} ids = 0 for k,v in get.iteritems(): - if not (k == 'page' or k == 'pop' or k == 'q'): + if k not in ['page', 'pop', 'q', '_popup']: if not k == 'o': if k == "ot": qs = query_ordena(qs,get["o"],get["ot"]) diff --git a/sigi/apps/diagnosticos/urls.py b/sigi/apps/diagnosticos/urls.py index e5f8efd..98286e2 100644 --- a/sigi/apps/diagnosticos/urls.py +++ b/sigi/apps/diagnosticos/urls.py @@ -30,6 +30,11 @@ urlpatterns = patterns('sigi.apps.diagnosticos.views', # Reports diagnosticos url(r'^diagnostico/(?P\w+).pdf$', 'diagnostico_pdf', name='diagnostico-pdf'), + + # Graficos de perguntas + url(r'^graficos/$', 'graficos', name="diagnosticos-graficos"), #tagerror + url(r'^api/$', 'grafico_api', name="diagnosticos-grafico-api"), #tagerror + ) urlpatterns += patterns('django.contrib.auth.views', diff --git a/sigi/apps/mesas/admin.py b/sigi/apps/mesas/admin.py index 7fb7af4..6aada65 100644 --- a/sigi/apps/mesas/admin.py +++ b/sigi/apps/mesas/admin.py @@ -16,7 +16,7 @@ class LegislaturaAdmin(admin.ModelAdmin): list_display = ('numero', 'casa_legislativa', 'uf', 'data_inicio', 'data_fim', 'data_eleicao', 'total_parlamentares') raw_id_fields = ('casa_legislativa',) list_display_links = ('numero',) - list_filter = ('casa_legislativa', ) + list_filter = ('casa_legislativa__municipio__uf', ) search_fields = ('casa_legislativa__nome', 'casa_legislativa__municipio__nome' ) inlines = (MandatoInline,) diff --git a/sigi/apps/parlamentares/admin.py b/sigi/apps/parlamentares/admin.py index c7e0c72..9fe27e7 100644 --- a/sigi/apps/parlamentares/admin.py +++ b/sigi/apps/parlamentares/admin.py @@ -21,6 +21,7 @@ class PartidoAdmin(admin.ModelAdmin): list_display_links = ('nome', 'sigla') search_fields = ('nome', 'sigla') + class ParlamentarAdmin(admin.ModelAdmin): inlines = (TelefonesInline, MandatosInline) list_display = ('nome_completo', 'nome_parlamentar', 'sexo') diff --git a/sigi/apps/servicos/urls.py b/sigi/apps/servicos/urls.py index 76ea424..2951d11 100644 --- a/sigi/apps/servicos/urls.py +++ b/sigi/apps/servicos/urls.py @@ -9,4 +9,5 @@ urlpatterns = patterns('sigi.apps.servicos.views', url(r'^manifesta/$', 'casa_manifesta_view', name="casa-manifesta-view"), url(r'^munatenjson/(?P\w+)/$', 'municipios_atendidos', name="municipios-atendidos"), url(r'^mapa/(?P\w+)/$', MapaView.as_view(), name="servicos-mapa"), + # url(r'^listacasas/(?P\w+)', 'casas_usam_servico', name="casas-usam-servico"), ) \ No newline at end of file diff --git a/sigi/settings.py b/sigi/settings.py index a7c2d56..2b402d5 100644 --- a/sigi/settings.py +++ b/sigi/settings.py @@ -12,7 +12,6 @@ https://docs.djangoproject.com/en/dev/ref/settings/ import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) - # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ @@ -54,6 +53,9 @@ INSTALLED_APPS = ( # Third-party apps 'localflavor', 'reporting', + 'django_extensions', + 'googlecharts', + 'treemenus', ) MIDDLEWARE_CLASSES = ( @@ -83,7 +85,7 @@ DATABASES = { # Internationalization # https://docs.djangoproject.com/en/dev/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'pt-br' TIME_ZONE = 'UTC' diff --git a/sigi/urls.py b/sigi/urls.py index cc64a0d..ef22ffe 100644 --- a/sigi/urls.py +++ b/sigi/urls.py @@ -1,6 +1,8 @@ #-*- coding:utf-8 -*- from django.conf.urls import patterns, include, url -from django.views.generic.base import RedirectView +from django.views.generic.base import RedirectView, TemplateView +from django.conf import settings +from django.conf.urls.static import static from django.contrib import admin admin.autodiscover() @@ -13,8 +15,16 @@ urlpatterns = patterns('', url(r'^sigi/convenios/convenio/', include('sigi.apps.convenios.urls')), url(r'^sigi/diagnosticos/', include('sigi.apps.diagnosticos.urls')), url(r'^sigi/servidores/', include('sigi.apps.servidores.urls')), - url(r'^sigi/dashboard/', include('sigi.apps.metas.urls')), url(r'^sigi/servicos/', include('sigi.apps.servicos.urls')), + url(r'^sigi/dashboard/', include('sigi.apps.metas.urls')), + url(r'^sigi/', include(admin.site.urls)), -) +) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + +if settings.DEBUG: + urlpatterns = patterns('', + url(r'^404/$', TemplateView.as_view(template_name='404.html')), + url(r'^500/$', TemplateView.as_view(template_name='500.html')), + url(r'^503/$', TemplateView.as_view(template_name='503.html')), + ) + urlpatterns diff --git a/templates/admin/tabs_style.html b/templates/admin/tabs_style.html index 61bbcb1..939c1d3 100644 --- a/templates/admin/tabs_style.html +++ b/templates/admin/tabs_style.html @@ -1,14 +1,14 @@ - + - - - - - - + + + + + + - - + {% load staticfiles %} + + +