From 8f2eeadb0c0ccaad7c3790afd44632167e285057 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 2 Feb 2016 13:39:56 -0200 Subject: [PATCH] Convert comissao subnav to use template tag --- comissoes/views.py | 6 +++--- templates/comissoes/comissao_detail.html | 9 +++------ templates/comissoes/subnav.yaml | 6 ++++++ templates/sessao/sessaoplenaria_detail.html | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 templates/comissoes/subnav.yaml diff --git a/comissoes/views.py b/comissoes/views.py index 74d201d3a..c530fd10b 100644 --- a/comissoes/views.py +++ b/comissoes/views.py @@ -213,7 +213,7 @@ class ComposicaoView(FormMixin, GenericView): 'composicao_id': composicao_id, 'form': form, 'pk': self.kwargs['pk'], - 'comissao': Comissao.objects.get(id=self.kwargs['pk'])}) + 'object': Comissao.objects.get(id=self.kwargs['pk'])}) def post(self, request, *args, **kwargs): form = ComposicaoForm(request.POST) @@ -228,7 +228,7 @@ class ComposicaoView(FormMixin, GenericView): 'composicao_id': int(form.data['periodo']), 'form': form, 'pk': self.kwargs['pk'], - 'comissao': Comissao.objects.get(id=self.kwargs['pk'])}) + 'object': Comissao.objects.get(id=self.kwargs['pk'])}) class MateriasView(comissao_crud.CrudDetailView): @@ -411,5 +411,5 @@ class MateriasTramitacaoListView(ListView): def get_context_data(self, **kwargs): context = super( MateriasTramitacaoListView, self).get_context_data(**kwargs) - context['comissao'] = Comissao.objects.get(id=self.kwargs['pk']) + context['object'] = Comissao.objects.get(id=self.kwargs['pk']) return context diff --git a/templates/comissoes/comissao_detail.html b/templates/comissoes/comissao_detail.html index e301b7223..084568163 100644 --- a/templates/comissoes/comissao_detail.html +++ b/templates/comissoes/comissao_detail.html @@ -1,9 +1,6 @@ {% extends "crud/detail.html" %} -{% load i18n %} +{% load menus %} + {% block sections_nav %} - + {% subnav "comissoes/subnav.yaml" %} {% endblock sections_nav %} diff --git a/templates/comissoes/subnav.yaml b/templates/comissoes/subnav.yaml new file mode 100644 index 000000000..bfcefee34 --- /dev/null +++ b/templates/comissoes/subnav.yaml @@ -0,0 +1,6 @@ +- title: Início + url: comissao:detail +- title: Composição + url: comissao:composicao +- title: Matérias em Tramitação + url: comissao:materias_em_tramitacao diff --git a/templates/sessao/sessaoplenaria_detail.html b/templates/sessao/sessaoplenaria_detail.html index 83f819c02..e75fc9fb2 100644 --- a/templates/sessao/sessaoplenaria_detail.html +++ b/templates/sessao/sessaoplenaria_detail.html @@ -1,5 +1,5 @@ {% extends "crud/detail.html" %} -{% load i18n menus %} +{% load menus %} {% block actions %} {% endblock %} {% block sections_nav %}