1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 08:30:00 +00:00

shrink and put user_class menu and button on same line

This commit is contained in:
martstern 2017-05-16 03:13:22 -04:00
parent 8a87ca93a5
commit a19666b495
2 changed files with 29 additions and 5 deletions

View file

@ -91,3 +91,30 @@
{% endif %}
</div>
{% endmacro %}
{% macro render_menu_with_button(field) %}
{% if field.errors %}
<div class="form-group has-error">
{% else %}
<div class="form-group">
{% endif %}
{{ field.label(class='control-label') }}
{{ field(title=field.description,**kwargs) | safe }}
<button type="submit" class="btn btn-primary">Apply</button>
{% if field.errors %}
<div class="help-block">
{% if field.errors|length < 2 %}
{% for error in field.errors %}
{{ error }}
{% endfor %}
{% else %}
<ul>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
</div>
{% endmacro %}

View file

@ -1,7 +1,7 @@
{% extends "layout.html" %}
{% block title %}{{ user.username }} :: {{ config.SITE_NAME }}{% endblock %}
{% block body %}
{% from "_formhelpers.html" import render_field %}
{% from "_formhelpers.html" import render_menu_with_button %}
{% if superadmin %}
<h2>User Information</h2><br>
@ -20,12 +20,9 @@
<div class="form-group row">
<div class="col-md-6">
{{ render_field(form.user_class, class_='form-control')}}
{{ render_menu_with_button(form.user_class)}}
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Apply</button>
</div>
</form>
<br>
{% endif %}