|
|
@ -35,7 +35,7 @@ from sapl.parlamentares.apps import AppConfig |
|
|
from sapl.rules import SAPL_GROUP_VOTANTE |
|
|
from sapl.rules import SAPL_GROUP_VOTANTE |
|
|
from sapl.utils import (parlamentares_ativos, show_results_filter_set, ratelimit_ip) |
|
|
from sapl.utils import (parlamentares_ativos, show_results_filter_set, ratelimit_ip) |
|
|
|
|
|
|
|
|
from .forms import (ColigacaoFilterSet, FiliacaoForm, FrenteForm, LegislaturaForm, MandatoForm, MesaDiretoraFilterSet, |
|
|
from .forms import (ColigacaoFilterSet, ComposicaoMesaForm, FiliacaoForm, FrenteForm, LegislaturaForm, MandatoForm, MesaDiretoraFilterSet, MesaDiretoraForm, |
|
|
ParlamentarCreateForm, ParlamentarForm, VotanteForm, |
|
|
ParlamentarCreateForm, ParlamentarForm, VotanteForm, |
|
|
ParlamentarFilterSet, PartidoFilterSet, VincularParlamentarForm, |
|
|
ParlamentarFilterSet, PartidoFilterSet, VincularParlamentarForm, |
|
|
BlocoForm, FrenteParlamentarForm, BlocoMembroForm) |
|
|
BlocoForm, FrenteParlamentarForm, BlocoMembroForm) |
|
|
@ -1041,7 +1041,12 @@ class MesaDiretoraCrud(Crud): |
|
|
def get(self, request, *args, **kwargs): |
|
|
def get(self, request, *args, **kwargs): |
|
|
return FilterView.get(self, request, *args, **kwargs) |
|
|
return FilterView.get(self, request, *args, **kwargs) |
|
|
|
|
|
|
|
|
|
|
|
class UpdateView(Crud.UpdateView): |
|
|
|
|
|
form_class = MesaDiretoraForm |
|
|
|
|
|
|
|
|
class CreateView(Crud.CreateView): |
|
|
class CreateView(Crud.CreateView): |
|
|
|
|
|
form_class = MesaDiretoraForm |
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
def get_context_data(self, **kwargs): |
|
|
context = super().get_context_data(**kwargs) |
|
|
context = super().get_context_data(**kwargs) |
|
|
context['subnav_template_name'] = '' |
|
|
context['subnav_template_name'] = '' |
|
|
@ -1066,6 +1071,23 @@ class ComposicaoMesaCrud(MasterDetailCrud): |
|
|
context['subnav_template_name'] = 'parlamentares/subnav_mesa.yaml' |
|
|
context['subnav_template_name'] = 'parlamentares/subnav_mesa.yaml' |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
|
|
form_class = ComposicaoMesaForm |
|
|
|
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
|
|
initial = super().get_initial() |
|
|
|
|
|
initial['mesa_diretora'] = self.object.mesa_diretora |
|
|
|
|
|
return initial |
|
|
|
|
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
|
|
form_class = ComposicaoMesaForm |
|
|
|
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
|
|
initial = super().get_initial() |
|
|
|
|
|
initial['mesa_diretora'] = MesaDiretora.objects.get(pk=self.kwargs['pk']) |
|
|
|
|
|
return initial |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MesaDiretoraView(FormView): |
|
|
class MesaDiretoraView(FormView): |
|
|
template_name = 'parlamentares/composicaomesa_form_old.html' |
|
|
template_name = 'parlamentares/composicaomesa_form_old.html' |
|
|
|