|
|
@ -598,6 +598,15 @@ class OradorCrud(MasterDetailCrud): |
|
|
class ListView(MasterDetailCrud.ListView): |
|
|
class ListView(MasterDetailCrud.ListView): |
|
|
ordering = ['numero_ordem', 'parlamentar'] |
|
|
ordering = ['numero_ordem', 'parlamentar'] |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
sessao_pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=sessao_pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
form_class = OradorForm |
|
|
@ -609,7 +618,7 @@ class OradorCrud(MasterDetailCrud): |
|
|
return reverse('sapl.sessao:orador_list', |
|
|
return reverse('sapl.sessao:orador_list', |
|
|
kwargs={'pk': self.kwargs['pk']}) |
|
|
kwargs={'pk': self.kwargs['pk']}) |
|
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
form_class = OradorForm |
|
|
|
|
|
|
|
|
@ -621,6 +630,75 @@ class OradorCrud(MasterDetailCrud): |
|
|
return initial |
|
|
return initial |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OradorExpedienteCrud(OradorCrud): |
|
|
|
|
|
model = OradorExpediente |
|
|
|
|
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
|
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
|
|
return {'id_sessao': self.kwargs['pk']} |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
sessao_pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=sessao_pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
def get_success_url(self): |
|
|
|
|
|
return reverse('sapl.sessao:orador_list', |
|
|
|
|
|
kwargs={'pk': self.kwargs['pk']}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
|
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
|
|
initial = super(UpdateView, self).get_initial() |
|
|
|
|
|
initial.update({'id_sessao': self.object.sessao_plenaria.id}) |
|
|
|
|
|
initial.update({'numero':self.object.numero_ordem}) |
|
|
|
|
|
|
|
|
|
|
|
return initial |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
sessao_pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=sessao_pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DetailView(MasterDetailCrud.DetailView): |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
sessao_pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=sessao_pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
sessao_pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=sessao_pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OradorExpedienteCrud(OradorCrud): |
|
|
class OradorExpedienteCrud(OradorCrud): |
|
|
model = OradorExpediente |
|
|
model = OradorExpediente |
|
|
|
|
|
|
|
|
@ -631,6 +709,17 @@ class OradorExpedienteCrud(OradorCrud): |
|
|
def get_initial(self): |
|
|
def get_initial(self): |
|
|
return {'id_sessao': self.kwargs['pk']} |
|
|
return {'id_sessao': self.kwargs['pk']} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_success_url(self): |
|
|
def get_success_url(self): |
|
|
return reverse('sapl.sessao:oradorexpediente_list', |
|
|
return reverse('sapl.sessao:oradorexpediente_list', |
|
|
kwargs={'pk': self.kwargs['pk']}) |
|
|
kwargs={'pk': self.kwargs['pk']}) |
|
|
@ -643,6 +732,40 @@ class OradorExpedienteCrud(OradorCrud): |
|
|
'numero': self.object.numero_ordem} |
|
|
'numero': self.object.numero_ordem} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ListView(MasterDetailCrud.ListView): |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
class DetailView(MasterDetailCrud.DetailView): |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
class OradorOrdemDiaCrud(OradorCrud): |
|
|
class OradorOrdemDiaCrud(OradorCrud): |
|
|
model = OradorOrdemDia |
|
|
model = OradorOrdemDia |
|
|
|
|
|
|
|
|
@ -748,6 +871,14 @@ class SessaoCrud(Crud): |
|
|
|
|
|
|
|
|
form_class = SessaoPlenariaForm |
|
|
form_class = SessaoPlenariaForm |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
sessao = context['object'] |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
def get_initial(self): |
|
|
return {'sessao_legislativa': self.object.sessao_legislativa} |
|
|
return {'sessao_legislativa': self.object.sessao_legislativa} |
|
|
|
|
|
|
|
|
@ -788,6 +919,16 @@ class SessaoCrud(Crud): |
|
|
namespace = self.model._meta.app_config.name |
|
|
namespace = self.model._meta.app_config.name |
|
|
return reverse('%s:%s' % (namespace, 'sessaoplenaria_list')) |
|
|
return reverse('%s:%s' % (namespace, 'sessaoplenaria_list')) |
|
|
|
|
|
|
|
|
|
|
|
class DetailView(Crud.DetailView): |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
sessao = context['object'] |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SessaoPermissionMixin(PermissionRequiredForAppCrudMixin, |
|
|
class SessaoPermissionMixin(PermissionRequiredForAppCrudMixin, |
|
|
FormMixin, |
|
|
FormMixin, |
|
|
@ -821,6 +962,10 @@ class PresencaView(FormMixin, PresencaMixin, DetailView): |
|
|
context = FormMixin.get_context_data(self, **kwargs) |
|
|
context = FormMixin.get_context_data(self, **kwargs) |
|
|
context['title'] = '%s <small>(%s)</small>' % ( |
|
|
context['title'] = '%s <small>(%s)</small>' % ( |
|
|
_('Presença'), self.object) |
|
|
_('Presença'), self.object) |
|
|
|
|
|
sessao = context['object'] |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
@method_decorator(permission_required( |
|
|
@method_decorator(permission_required( |
|
|
@ -905,17 +1050,25 @@ class PainelView(PermissionRequiredForAppCrudMixin, TemplateView): |
|
|
cronometro_ordem = cronometro_ordem.seconds |
|
|
cronometro_ordem = cronometro_ordem.seconds |
|
|
cronometro_consideracoes = cronometro_consideracoes.seconds |
|
|
cronometro_consideracoes = cronometro_consideracoes.seconds |
|
|
|
|
|
|
|
|
|
|
|
sessao_pk = kwargs['pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(pk=sessao_pk) |
|
|
context = TemplateView.get_context_data(self, **kwargs) |
|
|
context = TemplateView.get_context_data(self, **kwargs) |
|
|
context.update({ |
|
|
context.update({ |
|
|
'head_title': str(_('Painel Plenário')), |
|
|
'head_title': str(_('Painel Plenário')), |
|
|
'sessao_id': kwargs['pk'], |
|
|
'sessao_id': sessao_pk, |
|
|
'root_pk': kwargs['pk'], |
|
|
'root_pk': sessao_pk, |
|
|
'sessaoplenaria': SessaoPlenaria.objects.get(pk=kwargs['pk']), |
|
|
'sessaoplenaria': sessao, |
|
|
'cronometro_discurso': cronometro_discurso, |
|
|
'cronometro_discurso': cronometro_discurso, |
|
|
'cronometro_aparte': cronometro_aparte, |
|
|
'cronometro_aparte': cronometro_aparte, |
|
|
'cronometro_ordem': cronometro_ordem, |
|
|
'cronometro_ordem': cronometro_ordem, |
|
|
'cronometro_consideracoes': cronometro_consideracoes}) |
|
|
'cronometro_consideracoes': cronometro_consideracoes}) |
|
|
|
|
|
|
|
|
|
|
|
context.update({'sessao_solene': False}) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
context.update({'sessao_solene': True}) |
|
|
|
|
|
|
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1138,6 +1291,10 @@ class MesaView(FormMixin, DetailView): |
|
|
context = FormMixin.get_context_data(self, **kwargs) |
|
|
context = FormMixin.get_context_data(self, **kwargs) |
|
|
context['title'] = '%s <small>(%s)</small>' % ( |
|
|
context['title'] = '%s <small>(%s)</small>' % ( |
|
|
_('Mesa Diretora'), self.object) |
|
|
_('Mesa Diretora'), self.object) |
|
|
|
|
|
sessao = context['object'] |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
def get_success_url(self): |
|
|
def get_success_url(self): |
|
|
@ -1832,6 +1989,10 @@ class ExpedienteView(FormMixin, DetailView): |
|
|
context = FormMixin.get_context_data(self, **kwargs) |
|
|
context = FormMixin.get_context_data(self, **kwargs) |
|
|
context['title'] = '%s <small>(%s)</small>' % ( |
|
|
context['title'] = '%s <small>(%s)</small>' % ( |
|
|
_('Expediente Diversos'), self.object) |
|
|
_('Expediente Diversos'), self.object) |
|
|
|
|
|
sessao = context['object'] |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
@method_decorator(permission_required('sessao.add_expedientesessao')) |
|
|
@method_decorator(permission_required('sessao.add_expedientesessao')) |
|
|
@ -1921,6 +2082,10 @@ class OcorrenciaSessaoView(FormMixin, DetailView): |
|
|
context = FormMixin.get_context_data(self, **kwargs) |
|
|
context = FormMixin.get_context_data(self, **kwargs) |
|
|
context['title'] = 'Ocorrências da Sessão <small>(%s)</small>' % ( |
|
|
context['title'] = 'Ocorrências da Sessão <small>(%s)</small>' % ( |
|
|
self.object) |
|
|
self.object) |
|
|
|
|
|
sessao = context['object'] |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
def delete(self): |
|
|
def delete(self): |
|
|
|