From f7c6c0c2ca2574879c361787d49bb97931787382 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Thu, 28 Apr 2016 12:14:36 -0300 Subject: [PATCH 01/12] =?UTF-8?q?Init=20crud=20legisla=C3=A7=C3=A3o=20cita?= =?UTF-8?q?da?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/materia/views.py b/materia/views.py index 345123cda..cfd237477 100644 --- a/materia/views.py +++ b/materia/views.py @@ -258,7 +258,6 @@ class LegislacaoCitadaCrud(MasterDetailCrud): self.initial['tipo'] = self.object.norma.tipo.id self.initial['numero'] = self.object.norma.numero self.initial['ano'] = self.object.norma.ano - return self.initial class DetailView(MasterDetailCrud.DetailView): From bc19e7b3741928b429634766181a049b6eb97c0d Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 4 May 2016 10:29:39 -0300 Subject: [PATCH 02/12] =?UTF-8?q?Disabilita=20localiza=C3=A7=C3=A3o=20atua?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/forms.py | 6 ++++++ materia/views.py | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/materia/forms.py b/materia/forms.py index 11c786949..624c48f9d 100644 --- a/materia/forms.py +++ b/materia/forms.py @@ -155,6 +155,12 @@ class RelatoriaForm(ModelForm): return cleaned_data + class Meta: + model = Relatoria + fields = ['data_designacao_relator', 'comissao', 'parlamentar', + 'data_destituicao_relator', 'tipo_fim_relatoria'] + widgets = {'comissao': forms.Select(attrs={'disabled': 'disabled'})} + class TramitacaoForm(ModelForm): diff --git a/materia/views.py b/materia/views.py index cfd237477..5ff808576 100644 --- a/materia/views.py +++ b/materia/views.py @@ -57,7 +57,21 @@ ProposicaoCrud = Crud.build(Proposicao, '') StatusTramitacaoCrud = Crud.build(StatusTramitacao, 'status_tramitacao') UnidadeTramitacaoCrud = Crud.build(UnidadeTramitacao, 'unidade_tramitacao') -RelatoriaCrud = MasterDetailCrud.build(Relatoria, 'materia', '') + +class RelatoriaCrud(MasterDetailCrud): + model = Relatoria + parent_field = 'materia' + help_path = '' + + class CreateView(MasterDetailCrud.CreateView): + form_class = RelatoriaForm + + def get_initial(self): + self.initial['comissao'] = 8 + return self.initial + + class UpdateView(MasterDetailCrud.UpdateView): + form_class = RelatoriaForm class RelatoriaCrud(MasterDetailCrud): From dcb6820139c108d323038091b96ec2423a67904c Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Thu, 5 May 2016 08:59:13 -0300 Subject: [PATCH 03/12] =?UTF-8?q?Valida=20localiza=C3=A7=C3=A3o=20atual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/forms.py | 14 +++++++++++++ materia/views.py | 53 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/materia/forms.py b/materia/forms.py index 624c48f9d..9d2738218 100644 --- a/materia/forms.py +++ b/materia/forms.py @@ -159,8 +159,22 @@ class RelatoriaForm(ModelForm): model = Relatoria fields = ['data_designacao_relator', 'comissao', 'parlamentar', 'data_destituicao_relator', 'tipo_fim_relatoria'] + widgets = {'comissao': forms.Select(attrs={'disabled': 'disabled'})} + def clean(self): + cleaned_data = self.cleaned_data + + try: + comissao = Comissao.objects.get(id=self.initial['comissao']) + except ObjectDoesNotExist: + msg = _('A localização atual deve ser uma comissão.') + raise ValidationError(msg) + else: + cleaned_data['comissao'] = comissao + + return cleaned_data + class TramitacaoForm(ModelForm): diff --git a/materia/views.py b/materia/views.py index 5ff808576..f8db7131c 100644 --- a/materia/views.py +++ b/materia/views.py @@ -67,8 +67,21 @@ class RelatoriaCrud(MasterDetailCrud): form_class = RelatoriaForm def get_initial(self): - self.initial['comissao'] = 8 - return self.initial + materia = MateriaLegislativa.objects.get(id=self.kwargs['pk']) + + loc_atual = Tramitacao.objects.filter( + materia=materia).last() + + if loc_atual is None: + localizacao = 0 + else: + comissao = loc_atual.unidade_tramitacao_destino.comissao + if comissao: + localizacao = comissao.pk + else: + localizacao = 0 + + return {'comissao': localizacao} class UpdateView(MasterDetailCrud.UpdateView): form_class = RelatoriaForm @@ -400,6 +413,42 @@ class AcompanhamentoExcluirView(TemplateView): return HttpResponseRedirect(self.get_redirect_url()) +class DocumentoAcessorioEditView(CreateView): + template_name = "materia/documento_acessorio_edit.html" + form_class = DocumentoAcessorioForm + + def get(self, request, *args, **kwargs): + materia = MateriaLegislativa.objects.get(id=kwargs['pk']) + documento = DocumentoAcessorio.objects.get(id=kwargs['id']) + form = DocumentoAcessorioForm(instance=documento, excluir=True) + return self.render_to_response({'object': materia, 'form': form}) + + def post(self, request, *args, **kwargs): + form = self.get_form() + materia = MateriaLegislativa.objects.get(id=kwargs['pk']) + documento = DocumentoAcessorio.objects.get(id=kwargs['id']) + if form.is_valid(): + if 'Excluir' in request.POST: + documento.delete() + elif 'salvar' in request.POST: + documento.materia = materia + documento.tipo = form.cleaned_data['tipo'] + documento.data = form.cleaned_data['data'] + documento.nome = form.cleaned_data['nome'] + documento.autor = form.cleaned_data['autor'] + documento.ementa = form.cleaned_data['ementa'] + documento.save() + return redirect(self.get_success_url()) + else: + return self.render_to_response({'form': form, + 'object': materia, + 'doc': documento}) + + def get_success_url(self): + pk = self.kwargs['pk'] + return reverse('materia:documento_acessorio', kwargs={'pk': pk}) + + def load_email_templates(templates, context={}): emails = [] From d491e0be2d361e676932c1300f872622c186ef8e Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Thu, 5 May 2016 09:03:26 -0300 Subject: [PATCH 04/12] Fix qa e testes --- protocoloadm/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 5f874ef78..19e67e9ba 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -4,7 +4,7 @@ from datetime import date, datetime from braces.views import FormValidMessageMixin from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse -from django.db.models import Max, Q +from django.db.models import Q, Max from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ From c9d78fc1838416100fa92533705a9f4c2985190e Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Thu, 5 May 2016 09:22:51 -0300 Subject: [PATCH 05/12] =?UTF-8?q?Init=20crud=20documento=20acess=C3=B3rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/forms.py | 1 - materia/views.py | 72 ------------------------------------------------ 2 files changed, 73 deletions(-) diff --git a/materia/forms.py b/materia/forms.py index 9d2738218..e8bc7389d 100644 --- a/materia/forms.py +++ b/materia/forms.py @@ -119,7 +119,6 @@ class DocumentoAcessorioForm(ModelForm): class Meta: model = DocumentoAcessorio fields = ['tipo', 'nome', 'data', 'autor', 'ementa', 'arquivo'] - widgets = {'autor': forms.HiddenInput()} def clean_autor(self): diff --git a/materia/views.py b/materia/views.py index f8db7131c..10b0e382c 100644 --- a/materia/views.py +++ b/materia/views.py @@ -342,42 +342,6 @@ class MateriaLegislativaCrud(Crud): list_field_names = ['tipo', 'numero', 'ano', 'data_apresentacao'] -class DocumentoAcessorioView(CreateView): - template_name = "materia/documento_acessorio.html" - form_class = DocumentoAcessorioForm - - def get(self, request, *args, **kwargs): - materia = MateriaLegislativa.objects.get(id=kwargs['pk']) - docs = DocumentoAcessorio.objects.filter( - materia_id=kwargs['pk']).order_by('data') - form = DocumentoAcessorioForm() - - return self.render_to_response( - {'object': materia, - 'form': form, - 'docs': docs}) - - def post(self, request, *args, **kwargs): - form = self.get_form() - materia = MateriaLegislativa.objects.get(id=kwargs['pk']) - docs_list = DocumentoAcessorio.objects.filter( - materia_id=kwargs['pk']) - - if form.is_valid(): - documento_acessorio = form.save(commit=False) - documento_acessorio.materia = materia - documento_acessorio.save() - return self.form_valid(form) - else: - return self.render_to_response({'form': form, - 'object': materia, - 'docs': docs_list}) - - def get_success_url(self): - pk = self.kwargs['pk'] - return reverse('materia:documento_acessorio', kwargs={'pk': pk}) - - class AcompanhamentoConfirmarView(TemplateView): def get_redirect_url(self): @@ -413,42 +377,6 @@ class AcompanhamentoExcluirView(TemplateView): return HttpResponseRedirect(self.get_redirect_url()) -class DocumentoAcessorioEditView(CreateView): - template_name = "materia/documento_acessorio_edit.html" - form_class = DocumentoAcessorioForm - - def get(self, request, *args, **kwargs): - materia = MateriaLegislativa.objects.get(id=kwargs['pk']) - documento = DocumentoAcessorio.objects.get(id=kwargs['id']) - form = DocumentoAcessorioForm(instance=documento, excluir=True) - return self.render_to_response({'object': materia, 'form': form}) - - def post(self, request, *args, **kwargs): - form = self.get_form() - materia = MateriaLegislativa.objects.get(id=kwargs['pk']) - documento = DocumentoAcessorio.objects.get(id=kwargs['id']) - if form.is_valid(): - if 'Excluir' in request.POST: - documento.delete() - elif 'salvar' in request.POST: - documento.materia = materia - documento.tipo = form.cleaned_data['tipo'] - documento.data = form.cleaned_data['data'] - documento.nome = form.cleaned_data['nome'] - documento.autor = form.cleaned_data['autor'] - documento.ementa = form.cleaned_data['ementa'] - documento.save() - return redirect(self.get_success_url()) - else: - return self.render_to_response({'form': form, - 'object': materia, - 'doc': documento}) - - def get_success_url(self): - pk = self.kwargs['pk'] - return reverse('materia:documento_acessorio', kwargs={'pk': pk}) - - def load_email_templates(templates, context={}): emails = [] From 86e127169f297282604c7d2f47de5325f152e6f8 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Thu, 5 May 2016 12:06:35 -0300 Subject: [PATCH 06/12] Monta layout para autor --- materia/forms.py | 4 ++++ materia/views.py | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/materia/forms.py b/materia/forms.py index e8bc7389d..a1f6f9462 100644 --- a/materia/forms.py +++ b/materia/forms.py @@ -131,6 +131,10 @@ class DocumentoAcessorioForm(ModelForm): if autor_field: return str(Autor.objects.get(id=autor_field)) + def __init__(self, *args, **kwargs): + super(DocumentoAcessorioForm, self).__init__(*args, **kwargs) + self.helper = FormHelper() + class RelatoriaForm(ModelForm): diff --git a/materia/views.py b/materia/views.py index 10b0e382c..5b597ed38 100644 --- a/materia/views.py +++ b/materia/views.py @@ -166,7 +166,14 @@ class DocumentoAcessorioCrud(MasterDetailCrud): class CreateView(MasterDetailCrud.CreateView): form_class = DocumentoAcessorioForm +<<<<<<< c9d78fc1838416100fa92533705a9f4c2985190e def __init__(self, *args, **kwargs): +======= + def get_form(self, form_class=None): + form = super(CreateView, self).get_form(form_class) + form.helper.layout = self.get_layout() + +>>>>>>> Monta layout para autor autor_row = crispy_layout_mixin.to_row( [('autor', 0), (Button('pesquisar', @@ -176,6 +183,7 @@ class DocumentoAcessorioCrud(MasterDetailCrud): 'Limpar Autor', css_class='btn btn-primary btn-sm'), 10)]) +<<<<<<< c9d78fc1838416100fa92533705a9f4c2985190e self.helper = FormHelper() self.helper.layout = crispy_layout_mixin.SaplFormLayout( *self.get_layout()) @@ -199,6 +207,13 @@ class DocumentoAcessorioCrud(MasterDetailCrud): context = super(CreateView, self).get_context_data(**kwargs) context['helper'] = self.helper return context +======= + form.helper.layout[0][2][0] = autor_row + form.helper.layout[0][1].append(HTML(sapl.utils.autor_label)) + form.helper.layout[0][1].append(HTML(sapl.utils.autor_modal)) + + return form +>>>>>>> Monta layout para autor class UpdateView(MasterDetailCrud.UpdateView): form_class = DocumentoAcessorioForm From c25ef9ffa8c436cd10451dcde74e2cab2a12d222 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 9 May 2016 10:37:21 -0300 Subject: [PATCH 07/12] =?UTF-8?q?Adicona=20busca=20de=20autor=20na=20cria?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20documento=20acess=C3=B3rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/forms.py | 4 ---- materia/views.py | 24 +++++++++--------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/materia/forms.py b/materia/forms.py index a1f6f9462..e8bc7389d 100644 --- a/materia/forms.py +++ b/materia/forms.py @@ -131,10 +131,6 @@ class DocumentoAcessorioForm(ModelForm): if autor_field: return str(Autor.objects.get(id=autor_field)) - def __init__(self, *args, **kwargs): - super(DocumentoAcessorioForm, self).__init__(*args, **kwargs) - self.helper = FormHelper() - class RelatoriaForm(ModelForm): diff --git a/materia/views.py b/materia/views.py index 5b597ed38..80c5c0edd 100644 --- a/materia/views.py +++ b/materia/views.py @@ -166,14 +166,8 @@ class DocumentoAcessorioCrud(MasterDetailCrud): class CreateView(MasterDetailCrud.CreateView): form_class = DocumentoAcessorioForm -<<<<<<< c9d78fc1838416100fa92533705a9f4c2985190e def __init__(self, *args, **kwargs): -======= - def get_form(self, form_class=None): - form = super(CreateView, self).get_form(form_class) - form.helper.layout = self.get_layout() - ->>>>>>> Monta layout para autor + super(CreateView, self).__init__(*args, **kwargs) autor_row = crispy_layout_mixin.to_row( [('autor', 0), (Button('pesquisar', @@ -183,7 +177,6 @@ class DocumentoAcessorioCrud(MasterDetailCrud): 'Limpar Autor', css_class='btn btn-primary btn-sm'), 10)]) -<<<<<<< c9d78fc1838416100fa92533705a9f4c2985190e self.helper = FormHelper() self.helper.layout = crispy_layout_mixin.SaplFormLayout( *self.get_layout()) @@ -202,18 +195,19 @@ class DocumentoAcessorioCrud(MasterDetailCrud): ' class="btn btn-inverse">Cancelar')])) super(CreateView, self).__init__(*args, **kwargs) + self.helper = FormHelper() + self.helper.layout = Layout( + crispy_layout_mixin.to_row(self.get_layout()[0][1]), + HTML(sapl.utils.autor_label), + HTML(sapl.utils.autor_modal), + crispy_layout_mixin.to_row(self.get_layout()[0][2]), + crispy_layout_mixin.to_row(self.get_layout()[0][3]), + ) def get_context_data(self, **kwargs): context = super(CreateView, self).get_context_data(**kwargs) context['helper'] = self.helper return context -======= - form.helper.layout[0][2][0] = autor_row - form.helper.layout[0][1].append(HTML(sapl.utils.autor_label)) - form.helper.layout[0][1].append(HTML(sapl.utils.autor_modal)) - - return form ->>>>>>> Monta layout para autor class UpdateView(MasterDetailCrud.UpdateView): form_class = DocumentoAcessorioForm From 3d9698e1f4de2baa9186e5f894bf239a217197bc Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 9 May 2016 11:19:58 -0300 Subject: [PATCH 08/12] =?UTF-8?q?Esconde=20campo=20n=C3=A3o=20usado=20de?= =?UTF-8?q?=20autor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/materia/forms.py b/materia/forms.py index e8bc7389d..186c6ba09 100644 --- a/materia/forms.py +++ b/materia/forms.py @@ -121,6 +121,8 @@ class DocumentoAcessorioForm(ModelForm): fields = ['tipo', 'nome', 'data', 'autor', 'ementa', 'arquivo'] widgets = {'autor': forms.HiddenInput()} + widgets = {'autor': forms.HiddenInput()} + def clean_autor(self): autor_field = self.cleaned_data['autor'] try: From d4a6be0a24f1f11de7cca1096bb3151d16b9539b Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 9 May 2016 12:14:33 -0300 Subject: [PATCH 09/12] =?UTF-8?q?Define=20layout=20documento=20acess=C3=B3?= =?UTF-8?q?rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/materia/views.py b/materia/views.py index 80c5c0edd..d02b0a427 100644 --- a/materia/views.py +++ b/materia/views.py @@ -2,6 +2,7 @@ import os from datetime import datetime from random import choice from string import ascii_letters, digits +from crispy_layout_mixin import form_actions from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Button @@ -167,7 +168,6 @@ class DocumentoAcessorioCrud(MasterDetailCrud): form_class = DocumentoAcessorioForm def __init__(self, *args, **kwargs): - super(CreateView, self).__init__(*args, **kwargs) autor_row = crispy_layout_mixin.to_row( [('autor', 0), (Button('pesquisar', From 64044c8c53817d7b57bc0a7a2bf0de58ce64d09c Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 9 May 2016 13:07:12 -0300 Subject: [PATCH 10/12] Fix qa --- materia/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/materia/views.py b/materia/views.py index d02b0a427..7a805036f 100644 --- a/materia/views.py +++ b/materia/views.py @@ -2,7 +2,6 @@ import os from datetime import datetime from random import choice from string import ascii_letters, digits -from crispy_layout_mixin import form_actions from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Button From 9cc3f6bed9b42e9ab211149aedb3a007b6cc4792 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 11 May 2016 10:45:37 -0300 Subject: [PATCH 11/12] Remove duplicidade do helper --- materia/views.py | 95 ++++++++++++++++++------------------------------ 1 file changed, 35 insertions(+), 60 deletions(-) diff --git a/materia/views.py b/materia/views.py index 7a805036f..2cc57d3ae 100644 --- a/materia/views.py +++ b/materia/views.py @@ -155,6 +155,39 @@ class TramitacaoCrud(MasterDetailCrud): return HttpResponseRedirect(url) +def montar_row_autor(): + autor_row = crispy_layout_mixin.to_row( + [('autor', 0), + (Button('pesquisar', + 'Pesquisar Autor', + css_class='btn btn-primary btn-sm'), 2), + (Button('limpar', + 'Limpar Autor', + css_class='btn btn-primary btn-sm'), 10)]) + + return autor_row + + +def montar_helper_documento_acessorio(self): + autor_row = montar_row_autor() + self.helper = FormHelper() + self.helper.layout = crispy_layout_mixin.SaplFormLayout( + *self.get_layout()) + + # Adiciona o novo campo 'autor' e mecanismo de busca + self.helper.layout[0][0].append(HTML(sapl.utils.autor_label)) + self.helper.layout[0][0].append(HTML(sapl.utils.autor_modal)) + self.helper.layout[0][1] = autor_row + + # Remove botões que estão fora do form + self.helper.layout[1].pop() + + # Adiciona novos botões dentro do form + self.helper.layout[0][2][0].insert(1, form_actions(more=[ + HTML('Cancelar')])) + + class DocumentoAcessorioCrud(MasterDetailCrud): model = DocumentoAcessorio parent_field = 'materia' @@ -167,41 +200,8 @@ class DocumentoAcessorioCrud(MasterDetailCrud): form_class = DocumentoAcessorioForm def __init__(self, *args, **kwargs): - autor_row = crispy_layout_mixin.to_row( - [('autor', 0), - (Button('pesquisar', - 'Pesquisar Autor', - css_class='btn btn-primary btn-sm'), 2), - (Button('limpar', - 'Limpar Autor', - css_class='btn btn-primary btn-sm'), 10)]) - - self.helper = FormHelper() - self.helper.layout = crispy_layout_mixin.SaplFormLayout( - *self.get_layout()) - - # Adiciona o novo campo 'autor' e mecanismo de busca - self.helper.layout[0][0].append(HTML(sapl.utils.autor_label)) - self.helper.layout[0][0].append(HTML(sapl.utils.autor_modal)) - self.helper.layout[0][1] = autor_row - - # Remove botões que estão fora do form - self.helper.layout[1].pop() - - # Adiciona novos botões dentro do form - self.helper.layout[0][3][0].insert(1, form_actions(more=[ - HTML('Cancelar')])) - + montar_helper_documento_acessorio(self) super(CreateView, self).__init__(*args, **kwargs) - self.helper = FormHelper() - self.helper.layout = Layout( - crispy_layout_mixin.to_row(self.get_layout()[0][1]), - HTML(sapl.utils.autor_label), - HTML(sapl.utils.autor_modal), - crispy_layout_mixin.to_row(self.get_layout()[0][2]), - crispy_layout_mixin.to_row(self.get_layout()[0][3]), - ) def get_context_data(self, **kwargs): context = super(CreateView, self).get_context_data(**kwargs) @@ -212,32 +212,7 @@ class DocumentoAcessorioCrud(MasterDetailCrud): form_class = DocumentoAcessorioForm def __init__(self, *args, **kwargs): - autor_row = crispy_layout_mixin.to_row( - [('autor', 0), - (Button('pesquisar', - 'Pesquisar Autor', - css_class='btn btn-primary btn-sm'), 2), - (Button('limpar', - 'Limpar Autor', - css_class='btn btn-primary btn-sm'), 10)]) - - self.helper = FormHelper() - self.helper.layout = crispy_layout_mixin.SaplFormLayout( - *self.get_layout()) - - # Adiciona o novo campo 'autor' e mecanismo de busca - self.helper.layout[0][0].append(HTML(sapl.utils.autor_label)) - self.helper.layout[0][0].append(HTML(sapl.utils.autor_modal)) - self.helper.layout[0][1] = autor_row - - # Remove botões que estão fora do form - self.helper.layout[1].pop() - - # Adiciona novos botões dentro do form - self.helper.layout[0][3][0].insert(1, form_actions(more=[ - HTML('Cancelar')])) - + montar_helper_documento_acessorio(self) super(UpdateView, self).__init__(*args, **kwargs) def get_context_data(self, **kwargs): From 734eb034fc8fdddf80e3d0b0d86512f7f3befd36 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 11 May 2016 10:55:17 -0300 Subject: [PATCH 12/12] =?UTF-8?q?Modifica=20row=20dos=20bot=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/materia/views.py b/materia/views.py index 2cc57d3ae..93c322221 100644 --- a/materia/views.py +++ b/materia/views.py @@ -183,7 +183,7 @@ def montar_helper_documento_acessorio(self): self.helper.layout[1].pop() # Adiciona novos botões dentro do form - self.helper.layout[0][2][0].insert(1, form_actions(more=[ + self.helper.layout[0][3][0].insert(1, form_actions(more=[ HTML('Cancelar')]))