Browse Source

Convert comissao subnav to use template tag

pull/202/head
Marcio Mazza 9 years ago
parent
commit
8f2eeadb0c
  1. 6
      comissoes/views.py
  2. 9
      templates/comissoes/comissao_detail.html
  3. 6
      templates/comissoes/subnav.yaml
  4. 2
      templates/sessao/sessaoplenaria_detail.html

6
comissoes/views.py

@ -213,7 +213,7 @@ class ComposicaoView(FormMixin, GenericView):
'composicao_id': composicao_id, 'composicao_id': composicao_id,
'form': form, 'form': form,
'pk': self.kwargs['pk'], '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): def post(self, request, *args, **kwargs):
form = ComposicaoForm(request.POST) form = ComposicaoForm(request.POST)
@ -228,7 +228,7 @@ class ComposicaoView(FormMixin, GenericView):
'composicao_id': int(form.data['periodo']), 'composicao_id': int(form.data['periodo']),
'form': form, 'form': form,
'pk': self.kwargs['pk'], '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): class MateriasView(comissao_crud.CrudDetailView):
@ -411,5 +411,5 @@ class MateriasTramitacaoListView(ListView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super( context = super(
MateriasTramitacaoListView, self).get_context_data(**kwargs) 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 return context

9
templates/comissoes/comissao_detail.html

@ -1,9 +1,6 @@
{% extends "crud/detail.html" %} {% extends "crud/detail.html" %}
{% load i18n %} {% load menus %}
{% block sections_nav %} {% block sections_nav %}
<dl class="sub-nav left"> {% subnav "comissoes/subnav.yaml" %}
<dd><a href="{% url 'comissao:detail' comissao.id %}" class="button secondary">{% trans 'Início' %}</a></dd>
<dd><a href="{% url 'comissao:composicao' comissao.id %}" class="button secondary">{% trans 'Composição' %}</a></dd>
<dd><a href="{% url 'comissao:materias_em_tramitacao' comissao.id %}" class="button secondary">{% trans 'Matérias em Tramitação' %}</a></dd>
</dl>
{% endblock sections_nav %} {% endblock sections_nav %}

6
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

2
templates/sessao/sessaoplenaria_detail.html

@ -1,5 +1,5 @@
{% extends "crud/detail.html" %} {% extends "crud/detail.html" %}
{% load i18n menus %} {% load menus %}
{% block actions %} {% endblock %} {% block actions %} {% endblock %}
{% block sections_nav %} {% block sections_nav %}

Loading…
Cancel
Save