|
|
@ -1,6 +1,5 @@ |
|
|
from math import ceil |
|
|
from math import ceil |
|
|
|
|
|
|
|
|
import rtyaml |
|
|
|
|
|
from crispy_forms.bootstrap import FormActions |
|
|
from crispy_forms.bootstrap import FormActions |
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit |
|
|
from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit |
|
|
@ -8,6 +7,7 @@ from django import template |
|
|
from django.core.urlresolvers import reverse, reverse_lazy |
|
|
from django.core.urlresolvers import reverse, reverse_lazy |
|
|
from django.utils import formats |
|
|
from django.utils import formats |
|
|
from django.utils.translation import ugettext as _ |
|
|
from django.utils.translation import ugettext as _ |
|
|
|
|
|
import rtyaml |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def heads_and_tails(list_of_lists): |
|
|
def heads_and_tails(list_of_lists): |
|
|
@ -43,10 +43,12 @@ def form_actions(more=[Div(css_class='clearfix')], |
|
|
doubleclick = 'return true;' |
|
|
doubleclick = 'return true;' |
|
|
|
|
|
|
|
|
return FormActions( |
|
|
return FormActions( |
|
|
|
|
|
*more, |
|
|
Submit(name, label, css_class=css_class, |
|
|
Submit(name, label, css_class=css_class, |
|
|
# para impedir resubmissão do form |
|
|
# para impedir resubmissão do form |
|
|
onclick=doubleclick), |
|
|
onclick=doubleclick), |
|
|
*more) |
|
|
css_class='form-group row justify-content-between' |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SaplFormLayout(Layout): |
|
|
class SaplFormLayout(Layout): |
|
|
@ -58,7 +60,7 @@ class SaplFormLayout(Layout): |
|
|
if not buttons: |
|
|
if not buttons: |
|
|
buttons = form_actions(label=save_label, more=[ |
|
|
buttons = form_actions(label=save_label, more=[ |
|
|
HTML('<a href="{{ view.cancel_url }}"' |
|
|
HTML('<a href="{{ view.cancel_url }}"' |
|
|
' class="btn btn-inverse">%s</a>' % cancel_label) |
|
|
' class="btn btn-dark">%s</a>' % cancel_label) |
|
|
if cancel_label else None]) |
|
|
if cancel_label else None]) |
|
|
|
|
|
|
|
|
_fields = list(to_fieldsets(fields)) |
|
|
_fields = list(to_fieldsets(fields)) |
|
|
|