Browse Source

Add tela relatorias em parlamentar

pull/548/head
Eduardo Edson Batista Cordeiro Alves 8 years ago
parent
commit
9824a25327
  1. 4
      sapl/parlamentares/urls.py
  2. 20
      sapl/parlamentares/views.py
  3. 2
      sapl/templates/parlamentares/subnav.yaml

4
sapl/parlamentares/urls.py

@ -7,6 +7,7 @@ from sapl.parlamentares.views import (CargoMesaCrud, ColigacaoCrud,
NivelInstrucaoCrud, ParlamentarCrud,
ParticipacaoParlamentarCrud, PartidoCrud,
ProposicaoParlamentarCrud,
RelatoriaParlamentarCrud,
SessaoLegislativaCrud,
TipoAfastamentoCrud, TipoDependenteCrud,
TipoMilitarCrud)
@ -20,7 +21,8 @@ urlpatterns = [
ParlamentarCrud.get_urls() + DependenteCrud.get_urls() +
FiliacaoCrud.get_urls() + MandatoCrud.get_urls() +
ParticipacaoParlamentarCrud.get_urls() +
ProposicaoParlamentarCrud.get_urls()
ProposicaoParlamentarCrud.get_urls() +
RelatoriaParlamentarCrud.get_urls()
)),
url(r'^coligacao/',
include(ColigacaoCrud.get_urls() +

20
sapl/parlamentares/views.py

@ -14,7 +14,7 @@ from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView,
CrudDeleteView, CrudDetailView, CrudListView,
CrudUpdateView)
from sapl.crud.masterdetail import MasterDetailCrud
from sapl.materia.models import Proposicao
from sapl.materia.models import Proposicao, Relatoria
from sapl.utils import permissao_tb_aux, permissoes_parlamentares
from .forms import (ComposicaoColigacaoForm, FiliacaoForm, LegislaturaForm,
@ -25,6 +25,24 @@ from .models import (CargoMesa, Coligacao, ComposicaoColigacao, ComposicaoMesa,
SituacaoMilitar, TipoAfastamento, TipoDependente)
class RelatoriaParlamentarCrud(MasterDetailCrud):
model = Relatoria
parent_field = 'parlamentar'
help_path = ''
class ListView(MasterDetailCrud.ListView):
permission_required = permissoes_parlamentares()
class CreateView(PermissionRequiredMixin, MasterDetailCrud.CreateView):
permission_required = permissoes_parlamentares()
class UpdateView(PermissionRequiredMixin, MasterDetailCrud.UpdateView):
permission_required = permissoes_parlamentares()
class DeleteView(PermissionRequiredMixin, MasterDetailCrud.DeleteView):
permission_required = permissoes_parlamentares()
class ProposicaoParlamentarCrud(MasterDetailCrud):
model = Proposicao
parent_field = 'autor__parlamentar'

2
sapl/templates/parlamentares/subnav.yaml

@ -11,3 +11,5 @@
url: participacao_list
- title: {% trans 'Proposições' %}
url: proposicao_list
- title: {% trans 'Relatorias' %}
url: relatoria_list

Loading…
Cancel
Save