user: clean up admin_form HTML (#400)

Properly scaffold it, remove a superfluous form-group div, and style
the select properly.
This commit is contained in:
Nicolas F 2018-01-03 23:28:39 +01:00 committed by Arylide
parent d00f3686f7
commit 362b3e3dfa
2 changed files with 34 additions and 25 deletions

View File

@ -120,8 +120,12 @@
<div class="form-group"> <div class="form-group">
{% endif %} {% endif %}
{{ field.label(class='control-label') }} {{ field.label(class='control-label') }}
{{ field(title=field.description,**kwargs) | safe }} <div class="input-group input-group-sm">
<button type="submit" class="btn btn-primary">Apply</button> {{ field(title=field.description, class_="form-control",**kwargs) | safe }}
<div class="input-group-btn">
<button type="submit" class="btn btn-primary">Apply</button>
</div>
</div>
{% if field.errors %} {% if field.errors %}
<div class="help-block"> <div class="help-block">
{% if field.errors|length < 2 %} {% if field.errors|length < 2 %}

View File

@ -21,30 +21,35 @@
<a href="{{ url_for('users.view_user_comments', user_name=user.username) }}">View all comments</a> <a href="{{ url_for('users.view_user_comments', user_name=user.username) }}">View all comments</a>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<dl class="dl-horizontal"> <div class="row">
<dt>User ID:</dt> <div class="col-md-12">
<dd>{{ user.id }}</dd> <dl class="dl-horizontal">
<dt>Account created on:</dt> <dt>User ID:</dt>
<dd data-timestamp="{{ user.created_utc_timestamp|int }}">{{ user.created_time.strftime('%Y-%m-%d %H:%M UTC') }}</dd> <dd>{{ user.id }}</dd>
<dt>Email address:</dt> <dt>Account created on:</dt>
<dd>{{ user.email }}</dd> <dd data-timestamp="{{ user.created_utc_timestamp|int }}">{{ user.created_time.strftime('%Y-%m-%d %H:%M UTC') }}</dd>
<dt>User class:</dt> <dt>Email address:</dt>
<dd>{{ user.userlevel_str }}</dd> <dd>{{ user.email }}</dd>
<dt>User status:</dt> <dt>User class:</dt>
<dd>{{ user.userstatus_str }}</dt> <dd>{{ user.userlevel_str }}</dd>
{%- if g.user.is_superadmin -%} <dt>User status:</dt>
<dt>Last login IP:</dt> <dd>{{ user.userstatus_str }}</dt>
<dd>{{ user.ip_string }}</dd><br> {%- if g.user.is_superadmin -%}
{%- endif -%} <dt>Last login IP:</dt>
</dl> <dd>{{ user.ip_string }}</dd><br>
{% if admin_form %} {%- endif -%}
<form method="POST"> </dl>
{{ admin_form.csrf_token }}
<div class="form-group">
{{ render_menu_with_button(admin_form.user_class) }}
</div> </div>
</form> </div>
{% if admin_form %}
<div class="row">
<div class="col-md-6">
<form method="POST">
{{ admin_form.csrf_token }}
{{ render_menu_with_button(admin_form.user_class) }}
</form>
</div>
</div>
<br> <br>
{% endif %} {% endif %}
</div> </div>