fix sso login button spacing again

master
Alexander Graf 3 years ago
parent 73ab4327c2
commit 97e79a973f

@ -5,7 +5,7 @@
<form class="form" method="post" role="form"> <form class="form" method="post" role="form">
{{ macros.form_field(form.email) }} {{ macros.form_field(form.email) }}
{{ macros.form_field(form.pw) }} {{ macros.form_field(form.pw) }}
{{ macros.form_fields(fields, label=False, class="btn btn-default", spacing=False) }} {{ macros.form_fields(fields, label=False, class="btn btn-default") }}
</form> </form>
{%- endcall %} {%- endcall %}
{%- endblock %} {%- endblock %}

@ -19,6 +19,7 @@ def login():
fields.append(form.submitAdmin) fields.append(form.submitAdmin)
if str(app.config["WEBMAIL"]).upper() != "NONE": if str(app.config["WEBMAIL"]).upper() != "NONE":
fields.append(form.submitWebmail) fields.append(form.submitWebmail)
fields = [fields]
if form.validate_on_submit(): if form.validate_on_submit():
if form.submitAdmin.data: if form.submitAdmin.data:

@ -18,17 +18,19 @@
{%- endif %} {%- endif %}
{%- endmacro %} {%- endmacro %}
{%- macro form_fields(fields, prepend='', append='', label=True, spacing=True) %} {%- macro form_fields(fields, prepend='', append='', label=True) %}
{%- if spacing %}
{%- set width = (12 / fields|length)|int %} {%- set width = (12 / fields|length)|int %}
{%- else %}
{%- set width = 2 %}
{% endif %}
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
{%- for field in fields %} {%- for field in fields %}
<div class="col-lg-{{ width }} col-xs-12 {{ 'has-error' if field.errors else '' }}"> <div class="col-lg-{{ width }} col-xs-12 {{ 'has-error' if field.errors else '' }}">
{%- if field is iterable %}
{%- for subfield in field %}
{{ form_individual_field(subfield, prepend=prepend, append=append, label=label, **kwargs) }}
{%- endfor %}
{%- else %}
{{ form_individual_field(field, prepend=prepend, append=append, label=label, **kwargs) }} {{ form_individual_field(field, prepend=prepend, append=append, label=label, **kwargs) }}
{%- endif %}
</div> </div>
{%- endfor %} {%- endfor %}
</div> </div>

Loading…
Cancel
Save