|
@ -1,7 +1,6 @@ |
|
|
|
|
|
|
|
|
import os |
|
|
import os |
|
|
|
|
|
|
|
|
import django_filters |
|
|
|
|
|
from crispy_forms.bootstrap import Alert, FormActions, InlineRadios |
|
|
from crispy_forms.bootstrap import Alert, FormActions, InlineRadios |
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.layout import (HTML, Button, Column, Div, Field, Fieldset, |
|
|
from crispy_forms.layout import (HTML, Button, Column, Div, Field, Fieldset, |
|
@ -22,8 +21,8 @@ from django.utils.encoding import force_text |
|
|
from django.utils.html import format_html |
|
|
from django.utils.html import format_html |
|
|
from django.utils.safestring import mark_safe |
|
|
from django.utils.safestring import mark_safe |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
|
|
import django_filters |
|
|
|
|
|
|
|
|
import sapl |
|
|
|
|
|
from sapl.base.models import Autor, TipoAutor |
|
|
from sapl.base.models import Autor, TipoAutor |
|
|
from sapl.comissoes.models import Comissao |
|
|
from sapl.comissoes.models import Comissao |
|
|
from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_PUBLIC, |
|
|
from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_PUBLIC, |
|
@ -42,6 +41,7 @@ from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, |
|
|
MateriaPesquisaOrderingFilter, RangeWidgetOverride, |
|
|
MateriaPesquisaOrderingFilter, RangeWidgetOverride, |
|
|
autor_label, autor_modal, models_with_gr_for_model, |
|
|
autor_label, autor_modal, models_with_gr_for_model, |
|
|
qs_override_django_filter) |
|
|
qs_override_django_filter) |
|
|
|
|
|
import sapl |
|
|
|
|
|
|
|
|
from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial, |
|
|
from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial, |
|
|
DocumentoAcessorio, Numeracao, Proposicao, Relatoria, |
|
|
DocumentoAcessorio, Numeracao, Proposicao, Relatoria, |
|
@ -73,7 +73,7 @@ class AdicionarVariasAutoriasFilterSet(django_filters.FilterSet): |
|
|
self.form.helper.form_method = 'GET' |
|
|
self.form.helper.form_method = 'GET' |
|
|
self.form.helper.layout = Layout( |
|
|
self.form.helper.layout = Layout( |
|
|
Fieldset(_('Filtrar Autores'), |
|
|
Fieldset(_('Filtrar Autores'), |
|
|
row1, form_actions(save_label='Filtrar')) |
|
|
row1, form_actions(label='Filtrar')) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -86,7 +86,7 @@ class ReceberProposicaoForm(Form): |
|
|
self.helper.layout = Layout( |
|
|
self.helper.layout = Layout( |
|
|
Fieldset( |
|
|
Fieldset( |
|
|
_('Incorporar Proposição'), row1, |
|
|
_('Incorporar Proposição'), row1, |
|
|
form_actions(save_label='Buscar Proposição') |
|
|
form_actions(label='Buscar Proposição') |
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
|
super(ReceberProposicaoForm, self).__init__(*args, **kwargs) |
|
|
super(ReceberProposicaoForm, self).__init__(*args, **kwargs) |
|
@ -113,7 +113,7 @@ class MateriaSimplificadaForm(ModelForm): |
|
|
Fieldset( |
|
|
Fieldset( |
|
|
_('Formulário Simplificado'), |
|
|
_('Formulário Simplificado'), |
|
|
row1, row2, row3, row4, row5, |
|
|
row1, row2, row3, row4, row5, |
|
|
form_actions(save_label='Salvar') |
|
|
form_actions(label='Salvar') |
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
|
super(MateriaSimplificadaForm, self).__init__(*args, **kwargs) |
|
|
super(MateriaSimplificadaForm, self).__init__(*args, **kwargs) |
|
@ -151,7 +151,7 @@ class AcompanhamentoMateriaForm(ModelForm): |
|
|
row1 = to_row([('email', 10)]) |
|
|
row1 = to_row([('email', 10)]) |
|
|
|
|
|
|
|
|
row1.append( |
|
|
row1.append( |
|
|
Column(form_actions(save_label='Cadastrar'), css_class='col-md-2') |
|
|
Column(form_actions(label='Cadastrar'), css_class='col-md-2') |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
self.helper = FormHelper() |
|
|
self.helper = FormHelper() |
|
@ -602,7 +602,7 @@ class MateriaLegislativaFilterSet(django_filters.FilterSet): |
|
|
HTML(autor_label), |
|
|
HTML(autor_label), |
|
|
HTML(autor_modal), |
|
|
HTML(autor_modal), |
|
|
row4, row5, row6, row7, row8, row9, row10, |
|
|
row4, row5, row6, row7, row8, row9, row10, |
|
|
form_actions(save_label='Pesquisar')) |
|
|
form_actions(label='Pesquisar')) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
@ -689,7 +689,7 @@ class AutoriaForm(ModelForm): |
|
|
self.helper = FormHelper() |
|
|
self.helper = FormHelper() |
|
|
self.helper.layout = Layout( |
|
|
self.helper.layout = Layout( |
|
|
Fieldset(_('Autoria'), |
|
|
Fieldset(_('Autoria'), |
|
|
row1, 'data_relativa', form_actions(save_label='Salvar'))) |
|
|
row1, 'data_relativa', form_actions(label='Salvar'))) |
|
|
|
|
|
|
|
|
if not kwargs['instance']: |
|
|
if not kwargs['instance']: |
|
|
self.fields['autor'].choices = [] |
|
|
self.fields['autor'].choices = [] |
|
@ -747,7 +747,7 @@ class AutoriaMultiCreateForm(Form): |
|
|
self.helper.layout = Layout( |
|
|
self.helper.layout = Layout( |
|
|
Fieldset( |
|
|
Fieldset( |
|
|
_('Autorias'), row1, row2, 'data_relativa', 'autores', |
|
|
_('Autorias'), row1, row2, 'data_relativa', 'autores', |
|
|
form_actions(save_label='Incluir Autores Selecionados'))) |
|
|
form_actions(label='Incluir Autores Selecionados'))) |
|
|
|
|
|
|
|
|
self.fields['autor'].choices = [] |
|
|
self.fields['autor'].choices = [] |
|
|
|
|
|
|
|
@ -792,7 +792,7 @@ class AcessorioEmLoteFilterSet(django_filters.FilterSet): |
|
|
self.form.helper.form_method = 'GET' |
|
|
self.form.helper.form_method = 'GET' |
|
|
self.form.helper.layout = Layout( |
|
|
self.form.helper.layout = Layout( |
|
|
Fieldset(_('Documentos Acessórios em Lote'), |
|
|
Fieldset(_('Documentos Acessórios em Lote'), |
|
|
row1, row2, form_actions(save_label='Pesquisar'))) |
|
|
row1, row2, form_actions(label='Pesquisar'))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PrimeiraTramitacaoEmLoteFilterSet(django_filters.FilterSet): |
|
|
class PrimeiraTramitacaoEmLoteFilterSet(django_filters.FilterSet): |
|
@ -824,7 +824,7 @@ class PrimeiraTramitacaoEmLoteFilterSet(django_filters.FilterSet): |
|
|
self.form.helper.form_method = 'GET' |
|
|
self.form.helper.form_method = 'GET' |
|
|
self.form.helper.layout = Layout( |
|
|
self.form.helper.layout = Layout( |
|
|
Fieldset(_('Primeira Tramitação'), |
|
|
Fieldset(_('Primeira Tramitação'), |
|
|
row1, row2, form_actions(save_label='Pesquisar'))) |
|
|
row1, row2, form_actions(label='Pesquisar'))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TramitacaoEmLoteFilterSet(django_filters.FilterSet): |
|
|
class TramitacaoEmLoteFilterSet(django_filters.FilterSet): |
|
@ -865,7 +865,7 @@ class TramitacaoEmLoteFilterSet(django_filters.FilterSet): |
|
|
self.form.helper.form_method = 'GET' |
|
|
self.form.helper.form_method = 'GET' |
|
|
self.form.helper.layout = Layout( |
|
|
self.form.helper.layout = Layout( |
|
|
Fieldset(_('Tramitação em Lote'), |
|
|
Fieldset(_('Tramitação em Lote'), |
|
|
row1, row2, form_actions(save_label='Pesquisar'))) |
|
|
row1, row2, form_actions(label='Pesquisar'))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TipoProposicaoForm(ModelForm): |
|
|
class TipoProposicaoForm(ModelForm): |
|
@ -1303,8 +1303,12 @@ class ConfirmarProposicaoForm(ProposicaoForm): |
|
|
if self.proposicao_incorporacao_obrigatoria != 'N': |
|
|
if self.proposicao_incorporacao_obrigatoria != 'N': |
|
|
itens_incorporacao.append(to_column(('numero_de_paginas', 4))) |
|
|
itens_incorporacao.append(to_column(('numero_de_paginas', 4))) |
|
|
|
|
|
|
|
|
itens_incorporacao.append(to_column((FormActions(Submit( |
|
|
itens_incorporacao.append( |
|
|
'incorporar', _('Incorporar'), css_class='pull-right')), 12))) |
|
|
to_column( |
|
|
|
|
|
(form_actions(label=_('Incorporar'), |
|
|
|
|
|
name='incorporar'), 12) |
|
|
|
|
|
) |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
fields.append( |
|
|
fields.append( |
|
|
Fieldset(_('Registro de Incorporação'), *itens_incorporacao)) |
|
|
Fieldset(_('Registro de Incorporação'), *itens_incorporacao)) |
|
@ -1313,10 +1317,14 @@ class ConfirmarProposicaoForm(ProposicaoForm): |
|
|
Fieldset( |
|
|
Fieldset( |
|
|
_('Registro de Devolução'), |
|
|
_('Registro de Devolução'), |
|
|
to_column(('justificativa_devolucao', 12)), |
|
|
to_column(('justificativa_devolucao', 12)), |
|
|
to_column((FormActions(Submit( |
|
|
to_column( |
|
|
'devolver', _('Devolver'), |
|
|
(form_actions(label=_('Devolver'), |
|
|
css_class='btn-danger pull-right')), 12)) |
|
|
name='devolver', |
|
|
)) |
|
|
css_class='btn-danger pull-right'), 12) |
|
|
|
|
|
) |
|
|
|
|
|
) |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
self.helper = FormHelper() |
|
|
self.helper = FormHelper() |
|
|
self.helper.layout = Layout(*fields) |
|
|
self.helper.layout = Layout(*fields) |
|
|
|
|
|
|
|
@ -1662,7 +1670,7 @@ class EtiquetaPesquisaForm(forms.Form): |
|
|
Fieldset( |
|
|
Fieldset( |
|
|
('Formulário de Etiqueta'), |
|
|
('Formulário de Etiqueta'), |
|
|
row1, row2, |
|
|
row1, row2, |
|
|
form_actions(save_label='Pesquisar') |
|
|
form_actions(label='Pesquisar') |
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@ -1730,7 +1738,7 @@ class FichaPesquisaForm(forms.Form): |
|
|
Fieldset( |
|
|
Fieldset( |
|
|
('Formulário de Ficha'), |
|
|
('Formulário de Ficha'), |
|
|
row1, |
|
|
row1, |
|
|
form_actions(save_label='Pesquisar') |
|
|
form_actions(label='Pesquisar') |
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@ -1764,6 +1772,6 @@ class FichaSelecionaForm(forms.Form): |
|
|
Fieldset( |
|
|
Fieldset( |
|
|
('Selecione a ficha que deseja imprimir'), |
|
|
('Selecione a ficha que deseja imprimir'), |
|
|
row1, |
|
|
row1, |
|
|
form_actions(save_label='Gerar Impresso') |
|
|
form_actions(label='Gerar Impresso') |
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
|