diff --git a/sigi/apps/crispy_layout_mixin.py b/sigi/apps/crispy_layout_mixin.py index 5f6e57b..1ea1e04 100644 --- a/sigi/apps/crispy_layout_mixin.py +++ b/sigi/apps/crispy_layout_mixin.py @@ -42,10 +42,11 @@ def form_actions(more=[], save_label=_('Salvar')): class FormLayout(Layout): - def __init__(self, label_cancel=_("Cancelar"), *fields): + def __init__(self, *fields): buttons = form_actions(more=[ HTML('%s' % label_cancel)]) + ' class="btn btn-primary" style="background-color:black;">' + ' Cancelar')]) _fields = list(to_fieldsets(fields)) + [to_row([(buttons, 12)])] super(FormLayout, self).__init__(*_fields) diff --git a/sigi/apps/usuarios/forms.py b/sigi/apps/usuarios/forms.py index fa97dbe..d34e739 100644 --- a/sigi/apps/usuarios/forms.py +++ b/sigi/apps/usuarios/forms.py @@ -57,7 +57,10 @@ class UsuarioForm(ModelForm): widget=forms.Select(), choices=TIPO_TELEFONE, label=_(u'Tipo Telefone')) - segundo_ddd = forms.CharField(required=False, max_length=2, label=_(u'DDD')) + segundo_ddd = forms.CharField( + required=False, + max_length=2, + label=_(u'DDD')) segundo_numero = forms.CharField( required=False, max_length=10, label=_(u'Número')) segundo_principal = forms.ChoiceField( @@ -86,12 +89,12 @@ class UsuarioForm(ModelForm): class Meta(object): model = Usuario - fields = [u'username', u'email', u'nome_completo', u'password', u'vinculo', - u'password_confirm', u'email_confirm', u'captcha', u'cpf', u'rg', - u'cargo', u'casa_legislativa'] + fields = [u'username', u'email', u'nome_completo', u'password', + u'vinculo', u'password_confirm', u'email_confirm', + u'captcha', u'cpf', u'rg', u'cargo', u'casa_legislativa'] widgets = {u'email': forms.TextInput( - attrs={u'style': u'text-transform:lowercase;'}),} + attrs={u'style': u'text-transform:lowercase;'}), } def __init__(self, *args, **kwargs): super(UsuarioForm, self).__init__(*args, **kwargs) @@ -210,10 +213,12 @@ class UsuarioEditForm(UsuarioForm): fields = [u'username', u'email', u'nome_completo', u'vinculo', u'email_confirm', u'captcha', u'cpf', u'rg', u'cargo', u'casa_legislativa'] - widgets = {u'username': forms.TextInput(attrs={u'readonly': u'readonly'}), - u'email': forms.TextInput( - attrs={u'style': u'text-transform:lowercase;'}), - } + widgets = {u'username': forms.TextInput( + attrs={u'readonly': u'readonly'}), + u'email': forms.TextInput( + attrs={u'style': u'text-transform:lowercase;'} + ), + } def __init__(self, *args, **kwargs): super(UsuarioEditForm, self).__init__(*args, **kwargs) @@ -307,7 +312,8 @@ class HabilitarEditForm(ModelForm): fields = [u'cpf', u'nome_completo', u'email', u'habilitado'] widgets = { u'cpf': forms.TextInput(attrs={u'readonly': u'readonly'}), - u'nome_completo': forms.TextInput(attrs={u'readonly': u'readonly'}), + u'nome_completo': forms.TextInput(attrs={u'readonly': u'readonly'} + ), u'email': forms.TextInput(attrs={u'readonly': u'readonly'}) } diff --git a/sigi/apps/usuarios/layouts.yaml b/sigi/apps/usuarios/layouts.yaml index 7cd7475..92b8e7d 100644 --- a/sigi/apps/usuarios/layouts.yaml +++ b/sigi/apps/usuarios/layouts.yaml @@ -1,4 +1,3 @@ - CasaLegislativa: Casa Legislativa: - sigla:4 nome @@ -13,18 +12,18 @@ Subsecretaria: - nome:8 sigla Usuario: - Usuário: + Dados do Usuário: - username nome_completo:9 - password password_confirm - email email_confirm - cpf rg casa_legislativa - cargo vinculo Primeiro Telefone: - - primeiro_tipo primeiro_ddd:2 primeiro_numero:6 primeiro_principal + - primeiro_tipo primeiro_ddd:2 primeiro_numero:6 primeiro_principal Segundo Telefone: - - segundo_tipo segundo_ddd:2 segundo_numero:6 segundo_principal + - segundo_tipo segundo_ddd:2 segundo_numero:6 segundo_principal Prove que você é um humano: - - captcha + - captcha UsuarioEdit: Usuário: diff --git a/sigi/apps/usuarios/views.py b/sigi/apps/usuarios/views.py index 6b90025..2ceca77 100644 --- a/sigi/apps/usuarios/views.py +++ b/sigi/apps/usuarios/views.py @@ -12,7 +12,8 @@ from sigi.apps.crud.utils import str2bool from django.contrib.auth.tokens import default_token_generator from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.utils.encoding import force_bytes -from sigi.apps.crud.base import Crud, CrudBaseMixin, CrudCreateView, CrudListView, CrudUpdateView, CrudDetailView +from sigi.apps.crud.base import (Crud, CrudBaseMixin, CrudCreateView, + CrudListView, CrudUpdateView, CrudDetailView) from .forms import (HabilitarEditForm, MudarSenhaForm, UsuarioEditForm, UsuarioForm)