|
|
@ -1,7 +1,7 @@ |
|
|
|
import django_filters |
|
|
|
from crispy_forms.bootstrap import FieldWithButtons, InlineRadios, StrictButton |
|
|
|
from crispy_forms.helper import FormHelper |
|
|
|
from crispy_forms.layout import HTML, Button, Div, Field, Fieldset, Layout, Row |
|
|
|
from crispy_forms.templatetags.crispy_forms_field import css_class |
|
|
|
from django import forms |
|
|
|
from django.conf import settings |
|
|
|
from django.contrib.auth import get_user_model |
|
|
@ -13,8 +13,8 @@ from django.contrib.contenttypes.models import ContentType |
|
|
|
from django.core.exceptions import ValidationError |
|
|
|
from django.db import models, transaction |
|
|
|
from django.forms import ModelForm |
|
|
|
from django.utils.translation import ugettext_lazy as _, string_concat |
|
|
|
import django_filters |
|
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
from django.utils.translation import string_concat |
|
|
|
|
|
|
|
from sapl.base.models import Autor, TipoAutor |
|
|
|
from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column, |
|
|
@ -23,12 +23,11 @@ from sapl.materia.models import MateriaLegislativa |
|
|
|
from sapl.sessao.models import SessaoPlenaria |
|
|
|
from sapl.settings import MAX_IMAGE_UPLOAD_SIZE |
|
|
|
from sapl.utils import (RANGE_ANOS, ImageThumbnailFileInput, |
|
|
|
RangeWidgetOverride, autor_label, autor_modal, |
|
|
|
SaplGenericRelation) |
|
|
|
RangeWidgetOverride, SaplGenericRelation, autor_label, |
|
|
|
autor_modal) |
|
|
|
|
|
|
|
from .models import AppConfig, CasaLegislativa |
|
|
|
|
|
|
|
|
|
|
|
ACTION_CREATE_USERS_AUTOR_CHOICE = [ |
|
|
|
('C', _('Criar novo Usuário')), |
|
|
|
('A', _('Associar um usuário existente')), |
|
|
@ -181,7 +180,8 @@ class AutorForm(ModelForm): |
|
|
|
|
|
|
|
autor_select = Row(to_column(('tipo', 3)), |
|
|
|
Div(to_column(('nome', 5)), |
|
|
|
to_column(('cargo', 4)), css_class="div_nome_cargo"), |
|
|
|
to_column(('cargo', 4)), |
|
|
|
css_class="div_nome_cargo"), |
|
|
|
to_column((autor_related, 9)), |
|
|
|
to_column((Div( |
|
|
|
Field('autor_related'), |
|
|
|