From 889cc995698968ad8a6fd2a8e68099d84ead7c9f Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 14 Dec 2016 10:17:25 -0200 Subject: [PATCH] Fix #851 --- sapl/protocoloadm/forms.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sapl/protocoloadm/forms.py b/sapl/protocoloadm/forms.py index 300078e20..375229710 100644 --- a/sapl/protocoloadm/forms.py +++ b/sapl/protocoloadm/forms.py @@ -12,7 +12,7 @@ from django.utils.translation import ugettext_lazy as _ from sapl.base.models import Autor from sapl.crispy_layout_mixin import form_actions, to_row -from sapl.materia.models import UnidadeTramitacao, TipoMateriaLegislativa +from sapl.materia.models import TipoMateriaLegislativa, UnidadeTramitacao from sapl.utils import (RANGE_ANOS, AnoNumeroOrderingFilter, RangeWidgetOverride, autor_label, autor_modal) @@ -332,19 +332,21 @@ class ProtocoloDocumentForm(ModelForm): class ProtocoloMateriaForm(ModelForm): autor = forms.IntegerField(widget=forms.HiddenInput(), required=False) - + tipo_materia = forms.ModelChoiceField( label=_('Tipo de Matéria'), required=True, queryset=TipoMateriaLegislativa.objects.all(), empty_label='Selecione', ) - + numero_paginas = forms.CharField(label=_('Núm. Páginas'), required=True) - - observacao = forms.CharField(required=True, + + observacao = forms.CharField(required=False, widget=forms.Textarea, label='Observação') + assunto_ementa = forms.CharField(required=True, + widget=forms.Textarea, label='Ementa') def clean_autor(self): autor_field = self.cleaned_data['autor'] @@ -361,6 +363,7 @@ class ProtocoloMateriaForm(ModelForm): fields = ['tipo_materia', 'numero_paginas', 'autor', + 'assunto_ementa', 'observacao'] def __init__(self, *args, **kwargs): @@ -377,19 +380,15 @@ class ProtocoloMateriaForm(ModelForm): 'limpar Autor', css_class='btn btn-primary btn-sm'), 10)]) row3 = to_row( + [('assunto_ementa', 12)]) + row4 = to_row( [('observacao', 12)]) self.helper = FormHelper() self.helper.layout = Layout( Fieldset(_('Identificação da Matéria'), - row1, - HTML(autor_label), - HTML(autor_modal), - row2, - row3, - form_actions(save_label='Protocolar Matéria') - ) - ) + row1, HTML(autor_label), HTML(autor_modal), row2, row3, + row4, form_actions(save_label='Protocolar Matéria'))) super(ProtocoloMateriaForm, self).__init__( *args, **kwargs)