diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 7c4ffadaa..1bfe78950 100755 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -3480,12 +3480,9 @@ class JustificativaAusenciaCrud(MasterDetailCrud): class VotacaoEmBlocoExpediente(PermissionRequiredForAppCrudMixin, ListView): - - model = ExpedienteMateria - template_name = 'sessao/votacao/votacao_bloco_expediente.html' + template_name = 'sessao/votacao/votacao_bloco.html' app_label = AppConfig.label - context_object_name = 'expedientes' - logger = logging.getLogger(__name__) + expediente = True def get_queryset(self): return ExpedienteMateria.objects.filter(sessao_plenaria_id=self.kwargs['pk'], @@ -3503,35 +3500,21 @@ class VotacaoEmBlocoExpediente(PermissionRequiredForAppCrudMixin, ListView): context['sessao_iniciada'] = True context['turno_choices'] = Tramitacao.TURNO_CHOICES context['title'] = SessaoPlenaria.objects.get(id=self.kwargs['pk']) + if self.expediente: + context['expediente'] = True + else: + context['expediente'] = False return context -class VotacaoEmBlocoOrdemDia(PermissionRequiredForAppCrudMixin, ListView): - model = OrdemDia - template_name = 'sessao/votacao/votacao_bloco_ordem.html' - app_label = AppConfig.label - logger = logging.getLogger(__name__) - context_object_name = 'ordem_dia' - parent_field = 'sessao_plenaria' +class VotacaoEmBlocoOrdemDia(VotacaoEmBlocoExpediente): + expediente = False def get_queryset(self): return OrdemDia.objects.filter(sessao_plenaria_id=self.kwargs['pk'], resultado='', retiradapauta=None) - def get_context_data(self, **kwargs): - context = super(VotacaoEmBlocoOrdemDia, - self).get_context_data(**kwargs) - context['pk'] = self.kwargs['pk'] - context['root_pk'] = self.kwargs['pk'] - if not verifica_sessao_iniciada(self.request, self.kwargs['pk']): - context['sessao_iniciada'] = False - return context - context['sessao_iniciada'] = True - context['turno_choices'] = Tramitacao.TURNO_CHOICES - context['title'] = SessaoPlenaria.objects.get(id=self.kwargs['pk']) - return context - class VotacaoEmBlocoSimbolicaView(PermissionRequiredForAppCrudMixin, TemplateView): diff --git a/sapl/templates/sessao/votacao/votacao_bloco.html b/sapl/templates/sessao/votacao/votacao_bloco.html new file mode 100644 index 000000000..ac9b10ce9 --- /dev/null +++ b/sapl/templates/sessao/votacao/votacao_bloco.html @@ -0,0 +1,166 @@ +{% extends "crud/detail.html" %} +{% load i18n crispy_forms_tags %} + +{% block base_content %} + + {% if sessao_iniciada %} +
+ {% endif %} + +{% endblock base_content %} + +{% block extra_js %} + + + +{% endblock extra_js%} diff --git a/sapl/templates/sessao/votacao/votacao_bloco_expediente.html b/sapl/templates/sessao/votacao/votacao_bloco_expediente.html deleted file mode 100644 index 2bcc3a5ae..000000000 --- a/sapl/templates/sessao/votacao/votacao_bloco_expediente.html +++ /dev/null @@ -1,161 +0,0 @@ -{% extends "crud/detail.html" %} -{% load i18n crispy_forms_tags %} - -{% block base_content %} - - {% if sessao_iniciada %} - - {% endif %} - -{% endblock base_content %} - -{% block extra_js %} - - - -{% endblock extra_js%} diff --git a/sapl/templates/sessao/votacao/votacao_bloco_ordem.html b/sapl/templates/sessao/votacao/votacao_bloco_ordem.html deleted file mode 100644 index 628079452..000000000 --- a/sapl/templates/sessao/votacao/votacao_bloco_ordem.html +++ /dev/null @@ -1,162 +0,0 @@ -{% extends "crud/detail.html" %} -{% load i18n crispy_forms_tags %} - -{% block base_content %} - - {% if sessao_iniciada %} - - {% endif %} - -{% endblock base_content %} - -{% block extra_js %} - - - -{% endblock extra_js%}