|
@ -1,7 +1,8 @@ |
|
|
from datetime import timedelta |
|
|
from datetime import timedelta |
|
|
|
|
|
|
|
|
from crispy_forms.bootstrap import (Alert, FieldWithButtons, FormActions, |
|
|
from crispy_forms.bootstrap import (Alert, FieldWithButtons, FormActions, |
|
|
InlineRadios, StrictButton) |
|
|
InlineCheckboxes, InlineRadios, |
|
|
|
|
|
StrictButton) |
|
|
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, |
|
|
Layout, Row, Submit) |
|
|
Layout, Row, Submit) |
|
@ -1249,20 +1250,20 @@ class DispositivoEdicaoAlteracaoForm(ModelForm): |
|
|
|
|
|
|
|
|
class TextNotificacoesForm(Form): |
|
|
class TextNotificacoesForm(Form): |
|
|
|
|
|
|
|
|
type_notificacoes = forms.ChoiceField( |
|
|
type_notificacoes = forms.MultipleChoiceField( |
|
|
label=_('Níveis de Notificações'), |
|
|
label=_('Níveis de Notificações'), |
|
|
choices=[('default', _('Dispositivos sem Notificações!')), |
|
|
choices=[('default', _('Dispositivos sem Notificações!')), |
|
|
('success', _('Informações!')), |
|
|
('success', _('Informações!')), |
|
|
('info', _('Boas Práticas!')), |
|
|
('info', _('Boas Práticas!')), |
|
|
('warning', _('Alertas!')), |
|
|
('warning', _('Alertas!')), |
|
|
('danger', _('Erros!'))], |
|
|
('danger', _('Erros!'))], |
|
|
required=False) |
|
|
required=False, |
|
|
|
|
|
widget=widgets.CheckboxSelectMultiple()) |
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
|
|
|
field_type_notificacoes = to_row([(Field( |
|
|
field_type_notificacoes = to_row([(InlineCheckboxes( |
|
|
'type_notificacoes', |
|
|
'type_notificacoes'), 10), |
|
|
template="compilacao/layout/bootstrap_btn_checkbox.html"), 10), |
|
|
|
|
|
(Submit('submit-form', _('Filtrar'), |
|
|
(Submit('submit-form', _('Filtrar'), |
|
|
css_class='btn btn-primary pull-right'), 2)]) |
|
|
css_class='btn btn-primary pull-right'), 2)]) |
|
|
|
|
|
|
|
|