diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index c47d36566..7b09c4067 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -301,9 +301,18 @@ class FrenteCrud(Crud): def form_valid(self, form): return super(Crud.CreateView, self).form_valid(form) + class DetailView(Crud.DetailView): + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['subnav_template_name'] = '' + return context + class UpdateView(Crud.UpdateView): form_class = FrenteForm - + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['subnav_template_name'] = '' + return context class MandatoCrud(MasterDetailCrud): diff --git a/sapl/templates/parlamentares/frente_form.html b/sapl/templates/parlamentares/frente_form.html index bbab780ae..1d71f6b76 100644 --- a/sapl/templates/parlamentares/frente_form.html +++ b/sapl/templates/parlamentares/frente_form.html @@ -57,16 +57,15 @@ function selecionar_parlamentares_frente() { // Seleciona automaticamente todos os parlamentares // que já estão presentes naquela frente - var update_view = {{ update_view }} - if (update_view == 1) { - var frente_id = {{ object.id }} - $.get("/sistema/frente/parlamentares-frente-selected", - {frente_id: frente_id}, - function (data) { - id_list = data['id_list']; - $("div.controls select").val(id_list); - }); - } + {% if object.id %} + var frente_id = {{ object.id }} + $.get("/sistema/frente/parlamentares-frente-selected", + {frente_id: frente_id}, + function (data) { + id_list = data['id_list']; + $("div.controls select").val(id_list); + }); + {% endif %} } function atualiza_parlamentares() {