From 9e567237be56f258bb582b8e93201ecee3cbfd1f Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 13 Apr 2016 10:42:19 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Usa=20modulos=20em=20url=20includes=20ao=20?= =?UTF-8?q?inv=C3=A9s=20de=20strings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/urls.py | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/sapl/urls.py b/sapl/urls.py index 2afef0e3c..72facc767 100644 --- a/sapl/urls.py +++ b/sapl/urls.py @@ -17,22 +17,34 @@ from django.conf.urls import include, url from django.contrib import admin from django.views.generic.base import TemplateView +import base.urls +import comissoes.urls +import compilacao.urls +import lexml.urls +import materia.urls +import norma.urls +import painel.urls +import parlamentares.urls +import protocoloadm.urls +import relatorios.urls +import sessao.urls + urlpatterns = [ url(r'^$', TemplateView.as_view(template_name='index.html')), url(r'^admin/', include(admin.site.urls)), - url(r'', include('comissoes.urls')), - url(r'', include('sessao.urls')), - url(r'', include('parlamentares.urls')), - url(r'', include('materia.urls')), - url(r'', include('norma.urls')), - url(r'', include('lexml.urls')), - url(r'', include('painel.urls')), - url(r'', include('protocoloadm.urls')), - url(r'', include('compilacao.urls')), - url(r'', include('relatorios.urls')), + url(r'', include(comissoes.urls)), + url(r'', include(sessao.urls)), + url(r'', include(parlamentares.urls)), + url(r'', include(materia.urls)), + url(r'', include(norma.urls)), + url(r'', include(lexml.urls)), + url(r'', include(painel.urls)), + url(r'', include(protocoloadm.urls)), + url(r'', include(compilacao.urls)), + url(r'', include(relatorios.urls)), # must come at the end # so that base /sistema/ url doesn't capture its children - url(r'', include('base.urls')), + url(r'', include(base.urls)), ] From 8335da8fce3fde267634966c4acc66f9a82e4555 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 13 Apr 2016 11:06:12 -0300 Subject: [PATCH 2/2] Urls com termos no singular --- comissoes/urls.py | 16 ++++---- crud/tests/stub_app/urls.py | 2 +- crud/tests/test_base.py | 22 +++++----- materia/urls.py | 4 +- materia/views.py | 2 +- painel/urls.py | 7 ++-- painel/views.py | 2 +- parlamentares/test_parlamentares.py | 12 +++--- parlamentares/urls.py | 40 +++++++++---------- parlamentares/views.py | 24 +++++------ protocoloadm/urls.py | 22 +++++----- protocoloadm/views.py | 6 +-- relatorios/urls.py | 18 ++++----- static/js/app.js | 2 +- ...entes.html => parlamentar_dependente.html} | 4 +- ....html => parlamentar_dependente_edit.html} | 2 +- ...es_detail.html => parlamentar_detail.html} | 0 ...iliacao.html => parlamentar_filiacao.html} | 4 +- ...it.html => parlamentar_filiacao_edit.html} | 2 +- ...ntares_list.html => parlamentar_list.html} | 0 ..._mandato.html => parlamentar_mandato.html} | 4 +- ...dit.html => parlamentar_mandato_edit.html} | 2 +- templates/parlamentares/subnav.yaml | 6 +-- .../protocoloadm/proposicoes_detail.html | 6 +-- templates/sessao/painel.html | 2 +- 25 files changed, 105 insertions(+), 106 deletions(-) rename templates/parlamentares/{parlamentares_dependentes.html => parlamentar_dependente.html} (80%) rename templates/parlamentares/{parlamentares_filiacao_edit.html => parlamentar_dependente_edit.html} (73%) rename templates/parlamentares/{parlamentares_detail.html => parlamentar_detail.html} (100%) rename templates/parlamentares/{parlamentares_filiacao.html => parlamentar_filiacao.html} (80%) rename templates/parlamentares/{parlamentares_dependentes_edit.html => parlamentar_filiacao_edit.html} (73%) rename templates/parlamentares/{parlamentares_list.html => parlamentar_list.html} (100%) rename templates/parlamentares/{parlamentares_mandato.html => parlamentar_mandato.html} (85%) rename templates/parlamentares/{parlamentares_mandato_edit.html => parlamentar_mandato_edit.html} (73%) diff --git a/comissoes/urls.py b/comissoes/urls.py index 2a70c9ad1..edefa5efd 100644 --- a/comissoes/urls.py +++ b/comissoes/urls.py @@ -11,23 +11,23 @@ from .apps import AppConfig app_name = AppConfig.name urlpatterns = [ - url(r'^comissoes/', include(ComissaoCrud.get_urls())), + url(r'^comissao/', include(ComissaoCrud.get_urls())), - url(r'^comissoes/(?P\d+)/composicao$', + url(r'^comissao/(?P\d+)/composicao$', ComposicaoView.as_view(), name='composicao'), - url(r'^comissoes/(?P\d+)/materias-em-tramitacao$', + url(r'^comissao/(?P\d+)/materias-em-tramitacao$', MateriasTramitacaoListView.as_view(), name='materias_em_tramitacao'), - url(r'^comissoes/(?P\d+)/composicao/(?P\d+)/parlamentar$', + url(r'^comissao/(?P\d+)/composicao/(?P\d+)/parlamentar$', ComissaoParlamentarIncluirView.as_view(), name='comissao_parlamentar'), - url(r'''^comissoes/(?P\d+)/composicao/(?P\d+)/ + url(r'''^comissao/(?P\d+)/composicao/(?P\d+)/ parlamentar/(?P\d+)/edit$''', ComissaoParlamentarEditView.as_view(), name='comissao_parlamentar_edit'), - url(r'^sistema/comissoes/cargo/', include(CargoCrud.get_urls())), - url(r'^sistema/comissoes/periodo-composicao/', + url(r'^sistema/comissao/cargo/', include(CargoCrud.get_urls())), + url(r'^sistema/comissao/periodo-composicao/', include(PeriodoComposicaoCrud.get_urls())), - url(r'^sistema/comissoes/tipo/', include(TipoComissaoCrud.get_urls())), + url(r'^sistema/comissao/tipo/', include(TipoComissaoCrud.get_urls())), ] diff --git a/crud/tests/stub_app/urls.py b/crud/tests/stub_app/urls.py index 66f7fed14..623f167bf 100644 --- a/crud/tests/stub_app/urls.py +++ b/crud/tests/stub_app/urls.py @@ -3,5 +3,5 @@ from django.conf.urls import include, url from .views import CountryCrud urlpatterns = [ - url(r'^countries/', include(CountryCrud.get_urls(), 'stub_app')), + url(r'^country/', include(CountryCrud.get_urls(), 'stub_app')), ] diff --git a/crud/tests/test_base.py b/crud/tests/test_base.py index f8379fb8a..824857a91 100644 --- a/crud/tests/test_base.py +++ b/crud/tests/test_base.py @@ -140,11 +140,11 @@ def test_layout_detail_fieldsets(monkeypatch): def test_reverse(): - assert '/countries/' == reverse('stub_app:country_list') - assert '/countries/create' == reverse('stub_app:country_create') - assert '/countries/2' == reverse('stub_app:country_detail', args=(2,)) - assert '/countries/2/edit' == reverse('stub_app:country_update', args=(2,)) - assert '/countries/2/delete' == reverse( + assert '/country/' == reverse('stub_app:country_list') + assert '/country/create' == reverse('stub_app:country_create') + assert '/country/2' == reverse('stub_app:country_detail', args=(2,)) + assert '/country/2/edit' == reverse('stub_app:country_update', args=(2,)) + assert '/country/2/delete' == reverse( 'stub_app:country_delete', args=(2,)) @@ -199,7 +199,7 @@ def test_flux_list_paginate_detail( CountryCrud.ListView.paginate_by = page_size - res = app.get('/countries/') + res = app.get('/country/') if num_entries == 0: assert_on_list_page(res) @@ -254,7 +254,7 @@ def test_flux_list_create_detail(app, cancel, make_invalid_submit): # to have a couple an option for continent field stub_continent = mommy.make(Continent) - res = app.get('/countries/') + res = app.get('/country/') # on list page assert_on_list_page(res) @@ -293,7 +293,7 @@ def test_flux_list_create_detail(app, cancel, make_invalid_submit): # on redirect to detail page created = Country.objects.get(name=stub_name) - assert res.url.endswith('/countries/%s' % created.id) + assert res.url.endswith('/country/%s' % created.id) res = res.follow() # on detail page @@ -305,7 +305,7 @@ def test_flux_list_create_detail(app, cancel, make_invalid_submit): def get_detail_page(app): stub = mommy.make(Country, name='Country Stub') - res = app.get('/countries/%s' % stub.id) + res = app.get('/country/%s' % stub.id) # on detail page assert_on_detail_page(res, stub.name) return stub, res @@ -333,7 +333,7 @@ def test_flux_detail_update_detail(app, cancel): res = form.submit() # on redirect to detail page - assert res.url.endswith('/countries/%s' % stub.id) + assert res.url.endswith('/country/%s' % stub.id) res = res.follow() # back to detail page @@ -362,7 +362,7 @@ def test_flux_detail_delete_list(app, cancel): res = res.form.submit() # on redirect to list page - assert res.url.endswith('/countries/') + assert res.url.endswith('/country/') res = res.follow() # on list page diff --git a/materia/urls.py b/materia/urls.py index 5513905f1..7a7bce314 100644 --- a/materia/urls.py +++ b/materia/urls.py @@ -35,9 +35,9 @@ urlpatterns = [ ProposicaoTaView.as_view(), name='proposicao_ta'), - url(r'^sistema/proposicoes/tipo/', + url(r'^sistema/proposicao/tipo/', include(TipoProposicaoCrud.get_urls())), - url(r'^sistema/proposicoes/autor/', include(AutorCrud.get_urls())), + url(r'^sistema/proposicao/autor/', include(AutorCrud.get_urls())), url(r'^sistema/materia/tipo/', include(TipoMateriaCrud.get_urls())), url(r'^sistema/materia/regime-tramitacao/', include(RegimeTramitacaoCrud.get_urls())), diff --git a/materia/views.py b/materia/views.py index 084c5d3fd..afe7ede2c 100644 --- a/materia/views.py +++ b/materia/views.py @@ -6,7 +6,7 @@ from string import ascii_letters, digits from django.contrib import messages from django.core.exceptions import ObjectDoesNotExist from django.core.mail import send_mail -from django.core.urlresolvers import reverse, reverse_lazy +from django.core.urlresolvers import reverse from django.http.response import HttpResponseRedirect from django.shortcuts import redirect from django.template import Context, loader diff --git a/painel/urls.py b/painel/urls.py index b210bff05..a6ca948d0 100644 --- a/painel/urls.py +++ b/painel/urls.py @@ -3,8 +3,7 @@ from django.conf.urls import url from .apps import AppConfig from .views import controlador_painel # CronometroPainelCrud, from .views import (cronometro_painel, get_dados_painel, painel_mensagem_view, - painel_parlamentares_view, painel_view, - painel_votacao_view) + painel_parlamentar_view, painel_view, painel_votacao_view) app_name = AppConfig.name @@ -14,8 +13,8 @@ urlpatterns = [ url(r'^painel/controlador$', controlador_painel, name='painel_controlador'), url(r'^painel/mensagem$', painel_mensagem_view, name="painel_mensagem"), - url(r'^painel/parlamentares$', painel_parlamentares_view, - name='painel_parlamentares'), + url(r'^painel/parlamentar$', painel_parlamentar_view, + name='painel_parlamentar'), url(r'^painel/votacao$', painel_votacao_view, name='painel_votacao'), url(r'^painel/cronometro$', cronometro_painel, name='cronometro_painel'), # url(r'^painel/cronometro$', include(CronometroPainelCrud.get_urls())), diff --git a/painel/views.py b/painel/views.py index 5a5398886..a84ffe514 100644 --- a/painel/views.py +++ b/painel/views.py @@ -46,7 +46,7 @@ def painel_mensagem_view(request): return render(request, 'painel/mensagem.html') -def painel_parlamentares_view(request): +def painel_parlamentar_view(request): return render(request, 'painel/parlamentares.html') diff --git a/parlamentares/test_parlamentares.py b/parlamentares/test_parlamentares.py index e61aaf958..81d9b35ed 100644 --- a/parlamentares/test_parlamentares.py +++ b/parlamentares/test_parlamentares.py @@ -53,7 +53,7 @@ def test_filiacao_submit(client): mommy.make(Parlamentar, pk=14) mommy.make(Partido, pk=32) - client.post(reverse('parlamentares:parlamentares_filiacao', + client.post(reverse('parlamentares:parlamentar_filiacao', kwargs={'pk': 14}), {'partido': 32, 'data': '2016-03-22', @@ -70,7 +70,7 @@ def test_dependente_submit(client): mommy.make(Partido, pk=32) mommy.make(TipoDependente, pk=3) - client.post(reverse('parlamentares:parlamentares_dependentes', + client.post(reverse('parlamentares:parlamentar_dependente', kwargs={'pk': 14}), {'nome': 'Eduardo', 'tipo': 3, @@ -86,7 +86,7 @@ def test_dependente_submit(client): @pytest.mark.django_db(transaction=False) def test_form_errors_dependente(client): mommy.make(Parlamentar, pk=14) - response = client.post(reverse('parlamentares:parlamentares_dependentes', + response = client.post(reverse('parlamentares:parlamentar_dependente', kwargs={'pk': 14}), {'salvar': 'salvar'}, follow=True) @@ -103,7 +103,7 @@ def test_form_errors_dependente(client): def test_form_errors_filiacao(client): mommy.make(Parlamentar, pk=14) - response = client.post(reverse('parlamentares:parlamentares_filiacao', + response = client.post(reverse('parlamentares:parlamentar_filiacao', kwargs={'pk': 14}), {'partido': '', 'salvar': 'salvar'}, @@ -120,7 +120,7 @@ def test_mandato_submit(client): mommy.make(Parlamentar, pk=14) mommy.make(Legislatura, pk=5) - client.post(reverse('parlamentares:parlamentares_mandato', + client.post(reverse('parlamentares:parlamentar_mandato', kwargs={'pk': 14}), {'legislatura': 5, 'data_fim_mandato': '2016-01-01', @@ -136,7 +136,7 @@ def test_mandato_submit(client): @pytest.mark.django_db(transaction=False) def test_form_errors_mandato(client): mommy.make(Parlamentar, pk=14) - response = client.post(reverse('parlamentares:parlamentares_mandato', + response = client.post(reverse('parlamentares:parlamentar_mandato', kwargs={'pk': 14}), {'legislatura': '', 'salvar': 'salvar'}, diff --git a/parlamentares/urls.py b/parlamentares/urls.py index 6e0ebb975..6ef8bdf59 100644 --- a/parlamentares/urls.py +++ b/parlamentares/urls.py @@ -15,45 +15,45 @@ from .apps import AppConfig app_name = AppConfig.name urlpatterns = [ - url(r'^parlamentares/', include(ParlamentarCrud.get_urls())), + url(r'^parlamentar/', include(ParlamentarCrud.get_urls())), - url(r'^sistema/parlamentares/legislatura/', + url(r'^sistema/parlamentar/legislatura/', include(LegislaturaCrud.get_urls())), - url(r'^sistema/parlamentares/tipo-dependente/', + url(r'^sistema/parlamentar/tipo-dependente/', include(TipoDependenteCrud.get_urls())), - url(r'^sistema/parlamentares/nivel-instrucao/', + url(r'^sistema/parlamentar/nivel-instrucao/', include(NivelInstrucaoCrud.get_urls())), - url(r'^sistema/parlamentares/coligacao/', + url(r'^sistema/parlamentar/coligacao/', include(ColigacaoCrud.get_urls())), - url(r'^sistema/parlamentares/tipo-afastamento/', + url(r'^sistema/parlamentar/tipo-afastamento/', include(TipoAfastamentoCrud.get_urls())), - url(r'^sistema/parlamentares/tipo-militar/', + url(r'^sistema/parlamentar/tipo-militar/', include(TipoMilitarCrud.get_urls())), - url(r'^sistema/parlamentares/partido/', include(PartidoCrud.get_urls())), + url(r'^sistema/parlamentar/partido/', include(PartidoCrud.get_urls())), url(r'^sistema/mesa-diretora/sessao-legislativa/', include(SessaoLegislativaCrud.get_urls())), url(r'^sistema/mesa-diretora/cargo-mesa/', include(CargoMesaCrud.get_urls())), - url(r'^parlamentares/(?P\d+)/dependentes$', + url(r'^parlamentar/(?P\d+)/dependente$', ParlamentaresDependentesView.as_view(), - name='parlamentares_dependentes'), - url(r'^parlamentares/(?P\d+)/dependentes/(?P\d+)$', + name='parlamentar_dependente'), + url(r'^parlamentar/(?P\d+)/dependente/(?P\d+)$', ParlamentaresDependentesEditView.as_view(), - name='parlamentares_dependentes_edit'), - url(r'^parlamentares/(?P\d+)/filiacao$', + name='parlamentar_dependente_edit'), + url(r'^parlamentar/(?P\d+)/filiacao$', FiliacaoView.as_view(), - name='parlamentares_filiacao'), - url(r'^parlamentares/(?P\d+)/filiacao/(?P\d+)$', + name='parlamentar_filiacao'), + url(r'^parlamentar/(?P\d+)/filiacao/(?P\d+)$', FiliacaoEditView.as_view(), - name='parlamentares_filiacao_edit'), - url(r'^parlamentares/(?P\d+)/mandato$', + name='parlamentar_filiacao_edit'), + url(r'^parlamentar/(?P\d+)/mandato$', MandatoView.as_view(), - name='parlamentares_mandato'), - url(r'^parlamentares/(?P\d+)/mandato/(?P\d+)$', + name='parlamentar_mandato'), + url(r'^parlamentar/(?P\d+)/mandato/(?P\d+)$', MandatoEditView.as_view(), - name='parlamentares_mandato_edit'), + name='parlamentar_mandato_edit'), url(r'^mesa-diretora/$', MesaDiretoraView.as_view(), name='mesa_diretora'), diff --git a/parlamentares/views.py b/parlamentares/views.py index bdee8d5f7..6caed3ec4 100644 --- a/parlamentares/views.py +++ b/parlamentares/views.py @@ -158,13 +158,13 @@ def validate(form, parlamentar, filiacao, request): class ParlamentaresDependentesView(CreateView): - template_name = "parlamentares/parlamentares_dependentes.html" + template_name = "parlamentares/parlamentar_dependente.html" form_class = DependenteForm model = Dependente def get_success_url(self): pk = self.kwargs['pk'] - return reverse('parlamentares:parlamentares_dependentes', + return reverse('parlamentares:parlamentar_dependente', kwargs={'pk': pk}) def get_context_data(self, **kwargs): @@ -196,14 +196,14 @@ class ParlamentaresDependentesView(CreateView): class ParlamentaresDependentesEditView(UpdateView): - template_name = "parlamentares/parlamentares_dependentes_edit.html" + template_name = "parlamentares/parlamentar_dependente_edit.html" form_class = DependenteEditForm model = Dependente pk_url_kwarg = 'dk' def get_success_url(self): pk = self.kwargs['pk'] - return reverse('parlamentares:parlamentares_dependentes', + return reverse('parlamentares:parlamentar_dependente', kwargs={'pk': pk}) def get_context_data(self, **kwargs): @@ -340,13 +340,13 @@ class MesaDiretoraView(FormView): class FiliacaoView(CreateView): - template_name = "parlamentares/parlamentares_filiacao.html" + template_name = "parlamentares/parlamentar_filiacao.html" form_class = FiliacaoForm model = Filiacao def get_success_url(self): pk = self.kwargs['pk'] - return reverse('parlamentares:parlamentares_filiacao', + return reverse('parlamentares:parlamentar_filiacao', kwargs={'pk': pk}) def get_context_data(self, **kwargs): @@ -380,14 +380,14 @@ class FiliacaoView(CreateView): class FiliacaoEditView(UpdateView): - template_name = "parlamentares/parlamentares_filiacao_edit.html" + template_name = "parlamentares/parlamentar_filiacao_edit.html" form_class = FiliacaoEditForm model = Filiacao pk_url_kwarg = 'dk' def get_success_url(self): pk = self.kwargs['pk'] - return reverse('parlamentares:parlamentares_filiacao', + return reverse('parlamentares:parlamentar_filiacao', kwargs={'pk': pk}) def get_context_data(self, **kwargs): @@ -415,13 +415,13 @@ class FiliacaoEditView(UpdateView): class MandatoView(CreateView): - template_name = "parlamentares/parlamentares_mandato.html" + template_name = "parlamentares/parlamentar_mandato.html" model = Mandato form_class = MandatoForm def get_success_url(self): pk = self.kwargs['pk'] - return reverse('parlamentares:parlamentares_mandato', + return reverse('parlamentares:parlamentar_mandato', kwargs={'pk': pk}) def get_context_data(self, **kwargs): @@ -453,14 +453,14 @@ class MandatoView(CreateView): class MandatoEditView(UpdateView): - template_name = "parlamentares/parlamentares_mandato_edit.html" + template_name = "parlamentares/parlamentar_mandato_edit.html" model = Mandato form_class = MandatoEditForm pk_url_kwarg = 'dk' def get_success_url(self): pk = self.kwargs['pk'] - return reverse('parlamentares:parlamentares_mandato', + return reverse('parlamentares:parlamentar_mandato', kwargs={'pk': pk}) def get_context_data(self, **kwargs): diff --git a/protocoloadm/urls.py b/protocoloadm/urls.py index 6e2103ac0..e69decff5 100644 --- a/protocoloadm/urls.py +++ b/protocoloadm/urls.py @@ -81,21 +81,21 @@ urlpatterns = [ # TODO: move to Proposicoes app - url(r'^proposicoes$', + url(r'^proposicao$', ProposicaoView.as_view(), name='proposicao'), - url(r'^proposicoes/proposicao-receber', + url(r'^proposicao/proposicao-receber', ProposicaoReceberView.as_view(), name='proposicao_receber'), - url(r'^proposicoes/proposicoes-naorecebidas', + url(r'^proposicao/proposicao-naorecebidas', ProposicoesNaoRecebidasView.as_view(), - name='proposicoes_naorecebidas'), - url(r'^proposicoes/proposicoes-naoincorporadas', + name='proposicao_naorecebidas'), + url(r'^proposicao/proposicao-naoincorporadas', ProposicoesNaoIncorporadasView.as_view(), - name='proposicoes_naoincorporadas'), - url(r'^proposicoes/proposicoes-incorporadas', + name='proposicao_naoincorporadas'), + url(r'^proposicao/proposicao-incorporadas', ProposicoesIncorporadasView.as_view(), - name='proposicoes_incorporadas'), - url(r'^proposicoes/(?P\d+)/proposicao', + name='proposicao_incorporadas'), + url(r'^proposicao/(?P\d+)/proposicao', ProposicaoDetailView.as_view(), name='proposicao_view'), - url(r'^proposicoes/pesquisar_autores', - pesquisa_autores, name='pesquisar_autores') + url(r'^proposicao/pesquisar_autor', + pesquisa_autores, name='pesquisar_autor') ] diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 74c1c1f5d..c4b3e8b2a 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -293,7 +293,7 @@ class ProposicaoReceberView(TemplateView): class ProposicoesNaoRecebidasView(ListView): - template_name = "protocoloadm/proposicoes_naorecebidas.html" + template_name = "protocoloadm/proposicao_naorecebidas.html" model = Proposicao paginate_by = 10 @@ -302,7 +302,7 @@ class ProposicoesNaoRecebidasView(ListView): class ProposicoesNaoIncorporadasView(ListView): - template_name = "protocoloadm/proposicoes_naoincorporadas.html" + template_name = "protocoloadm/proposicao_naoincorporadas.html" model = Proposicao paginate_by = 10 @@ -313,7 +313,7 @@ class ProposicoesNaoIncorporadasView(ListView): class ProposicoesIncorporadasView(ListView): - template_name = "protocoloadm/proposicoes_incorporadas.html" + template_name = "protocoloadm/proposicao_incorporadas.html" model = Proposicao paginate_by = 10 diff --git a/relatorios/urls.py b/relatorios/urls.py index 9dbcbbec0..a2837818b 100644 --- a/relatorios/urls.py +++ b/relatorios/urls.py @@ -10,22 +10,22 @@ from .views import (relatorio_capa_processo, app_name = AppConfig.name urlpatterns = [ - url(r'^relatorios/materia$', relatorio_materia, name='relatorio_materia'), - url(r'^relatorios/capa_processo$', + url(r'^relatorio/materia$', relatorio_materia, name='relatorio_materia'), + url(r'^relatorio/capa_processo$', relatorio_capa_processo, name='relatorio_capa_processo'), - url(r'^relatorios/ordem_dia$', relatorio_ordem_dia, + url(r'^relatorio/ordem_dia$', relatorio_ordem_dia, name='relatorio_ordem_dia'), - url(r'^relatorios/relatorio_documento_administrativo$', + url(r'^relatorio/relatorio_documento_administrativo$', relatorio_documento_administrativo, name='relatorio_documento_administrativo'), - url(r'^relatorios/espelho$', relatorio_espelho, + url(r'^relatorio/espelho$', relatorio_espelho, name='relatorio_espelho'), - url(r'^relatorios/(?P\d+)/sessao_plenaria$', + url(r'^relatorio/(?P\d+)/sessao_plenaria$', relatorio_sessao_plenaria, name='relatorio_sessao_plenaria'), - url(r'^relatorios/protocolo$', + url(r'^relatorio/protocolo$', relatorio_protocolo, name='relatorio_protocolo'), - url(r'^relatorios/(?P\d+)/(?P\d+)/etiqueta_protocolo$', + url(r'^relatorio/(?P\d+)/(?P\d+)/etiqueta_protocolo$', relatorio_etiqueta_protocolo, name='relatorio_etiqueta_protocolo'), - url(r'^relatorios/pauta_sessao$', + url(r'^relatorio/pauta_sessao$', relatorio_pauta_sessao, name='relatorio_pauta_sessao'), ] diff --git a/static/js/app.js b/static/js/app.js index 03537f188..081b0f347 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -74,7 +74,7 @@ function autorModal() { $( "#pesquisar" ).click(function() { var query = $("#q").val() - $.get("/proposicoes/pesquisar_autores?q="+ query, function( + $.get("/proposicoes/pesquisar_autor?q="+ query, function( data, status){ $("#div-resultado").children().remove(); diff --git a/templates/parlamentares/parlamentares_dependentes.html b/templates/parlamentares/parlamentar_dependente.html similarity index 80% rename from templates/parlamentares/parlamentares_dependentes.html rename to templates/parlamentares/parlamentar_dependente.html index aa790f8e0..5566f62cb 100644 --- a/templates/parlamentares/parlamentares_dependentes.html +++ b/templates/parlamentares/parlamentar_dependente.html @@ -1,4 +1,4 @@ -{% extends "parlamentares/parlamentares_detail.html" %} +{% extends "parlamentares/parlamentar_detail.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block actions %}{% endblock %} @@ -19,7 +19,7 @@ {% for d in dependentes %} - {{d.nome}} + {{d.nome}} {{d.tipo }} {{d.data_nascimento|default_if_none:""}} diff --git a/templates/parlamentares/parlamentares_filiacao_edit.html b/templates/parlamentares/parlamentar_dependente_edit.html similarity index 73% rename from templates/parlamentares/parlamentares_filiacao_edit.html rename to templates/parlamentares/parlamentar_dependente_edit.html index 6f7121b7d..295a72b3e 100644 --- a/templates/parlamentares/parlamentares_filiacao_edit.html +++ b/templates/parlamentares/parlamentar_dependente_edit.html @@ -1,4 +1,4 @@ -{% extends "parlamentares/parlamentares_detail.html" %} +{% extends "parlamentares/parlamentar_detail.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block actions %}{% endblock %} diff --git a/templates/parlamentares/parlamentares_detail.html b/templates/parlamentares/parlamentar_detail.html similarity index 100% rename from templates/parlamentares/parlamentares_detail.html rename to templates/parlamentares/parlamentar_detail.html diff --git a/templates/parlamentares/parlamentares_filiacao.html b/templates/parlamentares/parlamentar_filiacao.html similarity index 80% rename from templates/parlamentares/parlamentares_filiacao.html rename to templates/parlamentares/parlamentar_filiacao.html index 0013946df..ac55ef3a6 100644 --- a/templates/parlamentares/parlamentares_filiacao.html +++ b/templates/parlamentares/parlamentar_filiacao.html @@ -1,4 +1,4 @@ -{% extends "parlamentares/parlamentares_detail.html" %} +{% extends "parlamentares/parlamentar_detail.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block actions %}{% endblock %} @@ -19,7 +19,7 @@ {% for f in filiacoes %} - {{f.partido.sigla}} + {{f.partido.sigla}} {{f.data}} {{f.data_desfiliacao|default_if_none:""}} diff --git a/templates/parlamentares/parlamentares_dependentes_edit.html b/templates/parlamentares/parlamentar_filiacao_edit.html similarity index 73% rename from templates/parlamentares/parlamentares_dependentes_edit.html rename to templates/parlamentares/parlamentar_filiacao_edit.html index 6f7121b7d..295a72b3e 100644 --- a/templates/parlamentares/parlamentares_dependentes_edit.html +++ b/templates/parlamentares/parlamentar_filiacao_edit.html @@ -1,4 +1,4 @@ -{% extends "parlamentares/parlamentares_detail.html" %} +{% extends "parlamentares/parlamentar_detail.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block actions %}{% endblock %} diff --git a/templates/parlamentares/parlamentares_list.html b/templates/parlamentares/parlamentar_list.html similarity index 100% rename from templates/parlamentares/parlamentares_list.html rename to templates/parlamentares/parlamentar_list.html diff --git a/templates/parlamentares/parlamentares_mandato.html b/templates/parlamentares/parlamentar_mandato.html similarity index 85% rename from templates/parlamentares/parlamentares_mandato.html rename to templates/parlamentares/parlamentar_mandato.html index 4cdca75d0..78e6fbeab 100644 --- a/templates/parlamentares/parlamentares_mandato.html +++ b/templates/parlamentares/parlamentar_mandato.html @@ -1,4 +1,4 @@ -{% extends "parlamentares/parlamentares_detail.html" %} +{% extends "parlamentares/parlamentar_detail.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block actions %}{% endblock %} @@ -22,7 +22,7 @@ {% for m in mandatos %} - {{m.legislatura}} + {{m.legislatura}} {{m.coligacao|default_if_none:""}} {{m.data_fim_mandato|default_if_none:""}} {{m.data_expedicao_diploma|default_if_none:""}} diff --git a/templates/parlamentares/parlamentares_mandato_edit.html b/templates/parlamentares/parlamentar_mandato_edit.html similarity index 73% rename from templates/parlamentares/parlamentares_mandato_edit.html rename to templates/parlamentares/parlamentar_mandato_edit.html index 6f7121b7d..295a72b3e 100644 --- a/templates/parlamentares/parlamentares_mandato_edit.html +++ b/templates/parlamentares/parlamentar_mandato_edit.html @@ -1,4 +1,4 @@ -{% extends "parlamentares/parlamentares_detail.html" %} +{% extends "parlamentares/parlamentar_detail.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block actions %}{% endblock %} diff --git a/templates/parlamentares/subnav.yaml b/templates/parlamentares/subnav.yaml index efb862f91..35eae1ffc 100644 --- a/templates/parlamentares/subnav.yaml +++ b/templates/parlamentares/subnav.yaml @@ -1,8 +1,8 @@ - title: Início url: parlamentar_detail - title: Mandatos - url: parlamentares_mandato + url: parlamentar_mandato - title: Filiações Partidárias - url: parlamentares_filiacao + url: parlamentar_filiacao - title: Dependentes - url: parlamentares_dependentes + url: parlamentar_dependente diff --git a/templates/protocoloadm/proposicoes_detail.html b/templates/protocoloadm/proposicoes_detail.html index 1a24c467e..eb1f1faa0 100644 --- a/templates/protocoloadm/proposicoes_detail.html +++ b/templates/protocoloadm/proposicoes_detail.html @@ -4,8 +4,8 @@ {% block sections_nav %} {% endblock sections_nav %} diff --git a/templates/sessao/painel.html b/templates/sessao/painel.html index 536b203fc..4db48e1d7 100644 --- a/templates/sessao/painel.html +++ b/templates/sessao/painel.html @@ -9,7 +9,7 @@