From a19666b49520dea0f29c9fca36514a91685cbe0c Mon Sep 17 00:00:00 2001 From: martstern Date: Tue, 16 May 2017 03:13:22 -0400 Subject: [PATCH] shrink and put user_class menu and button on same line --- nyaa/templates/_formhelpers.html | 27 +++++++++++++++++++++++++++ nyaa/templates/user.html | 7 ++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/nyaa/templates/_formhelpers.html b/nyaa/templates/_formhelpers.html index 2ae1d4d..a84581e 100644 --- a/nyaa/templates/_formhelpers.html +++ b/nyaa/templates/_formhelpers.html @@ -91,3 +91,30 @@ {% endif %} {% endmacro %} + +{% macro render_menu_with_button(field) %} +{% if field.errors %} +
+{% else %} +
+{% endif %} + {{ field.label(class='control-label') }} + {{ field(title=field.description,**kwargs) | safe }} + + {% if field.errors %} +
+ {% if field.errors|length < 2 %} + {% for error in field.errors %} + {{ error }} + {% endfor %} + {% else %} +
    + {% for error in field.errors %} +
  • {{ error }}
  • + {% endfor %} +
+ {% endif %} +
+ {% endif %} +
+{% endmacro %} \ No newline at end of file diff --git a/nyaa/templates/user.html b/nyaa/templates/user.html index f0598bb..cf9a0eb 100644 --- a/nyaa/templates/user.html +++ b/nyaa/templates/user.html @@ -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 %}

User Information


@@ -20,12 +20,9 @@
- {{ render_field(form.user_class, class_='form-control')}} + {{ render_menu_with_button(form.user_class)}}
-
- -

{% endif %}