Browse Source

Redesign "auth" templates

sh4nks 9 years ago
parent
commit
d3a7f7a738

+ 4 - 19
flaskbb/templates/macros.html

@@ -114,12 +114,8 @@
 
 {%- macro render_field(field, with_label=True, div_class='', rows='') -%}
 <div class="form-group{%- if field.errors %} has-error{%- endif %}">
-    {% if div_class %}
-    <div class="{{ div_class }}">
-    {% else %}
-    <div class="col-sm-5">
-    {% endif %}
 
+    <div class="{%- if div_class -%}{{ div_class }}{%- else -%}col-sm-5{%- endif -%}">
         {% if with_label %}
             <label>{{ field.label.text }}</label>
         {% endif %}
@@ -222,25 +218,14 @@
 
 
 {%- macro horizontal_boolean_field(field, div_class='') -%}
-{%- if div_class %}
-<div class="{{ div_class }}">
-{%- else %}
-<div class="col-sm-offset-3 col-sm-3">
-{%- endif %}
-    <div class="checkbox">
-        {{ field(**kwargs) }}
-        {{ field_label(field) }}
-    </div>
+<div class="{%- if div_class -%}{{ div_class }}{%- else -%}col-sm-offset-3 col-sm-3{%- endif -%}">
+    {{ render_boolean_field(field, **kwargs) }}
 </div>
 {%- endmacro -%}
 
 
 {%- macro horizontal_submit_field(field, div_class='', input_class='') -%}
-{% if div_class %}
-<div class="{{ div_class }}">
-{% else %}
-<div class="col-sm-offset-3 col-sm-9">
-{% endif %}
+<div class="{%- if div_class -%}{{ div_class }}{%- else -%}col-sm-offset-3 col-sm-3{%- endif -%}">
     {{ field(class=input_class or 'btn btn-success') }}
 </div>
 {%- endmacro -%}

+ 21 - 0
flaskbb/themes/aurora/templates/auth/forgot_password.html

@@ -0,0 +1,21 @@
+{% set page_title = _("Request Password") %}
+
+{% extends theme("layout.html") %}
+{% block content %}
+{% from theme("macros.html") import horizontal_field %}
+
+<div class="panel page-panel">
+    <div class="panel-heading page-head">
+        {% trans %}Reset Password{% endtrans %}
+    </div>
+
+    <div class="panel-body">
+        <form class="form-horizontal" role="form" method="POST">
+            {{ form.hidden_tag() }}
+            {{ horizontal_field(form.email) }}
+            {{ horizontal_field(form.submit)}}
+        </form>
+    </div>
+</div>
+
+{% endblock %}

+ 30 - 0
flaskbb/themes/aurora/templates/auth/login.html

@@ -0,0 +1,30 @@
+{% set page_title = _("Login") %}
+
+{% extends theme("layout.html") %}
+{% from theme("macros.html") import horizontal_field, render_boolean_field %}
+{% block content %}
+
+<div class="panel page-panel">
+    <div class="panel-heading page-head">
+        {% trans %}Login{% endtrans %}
+    </div>
+
+    <div class="panel-body">
+        <form class="form-horizontal" role="form" method="POST">
+            {{ form.hidden_tag() }}
+            {{ horizontal_field(form.login)}}
+            {{ horizontal_field(form.password)}}
+            {{ horizontal_field(form.remember_me) }}
+            {{ horizontal_field(form.submit) }}
+
+            <div class="form-group">
+                <div class="col-sm-offset-3 col-sm-4">
+                    <a class="pull-left" href="{{ url_for('auth.register') }}"><small>{% trans %}Not a member yet?{% endtrans %}</small></a>
+                    <a class="pull-right" href="{{ url_for('auth.forgot_password') }}"><small>{% trans %}Forgot Password?{% endtrans %}</small></a>
+                </div>
+            </div>
+        </form>
+    </div>
+</div>
+
+{% endblock %}

+ 22 - 0
flaskbb/themes/aurora/templates/auth/reauth.html

@@ -0,0 +1,22 @@
+{% set page_title = _("Refresh Login") %}
+{% set active_forum_nav=True %}
+
+{% extends theme("layout.html") %}
+{% block content %}
+{% from theme("macros.html") import horizontal_field %}
+
+<div class="panel page-panel">
+    <div class="panel-heading page-head">
+        {% trans %}Refresh Login{% endtrans %}
+    </div>
+
+    <div class="panel-body">
+        <form class="form-horizontal" role="form" method="POST">
+            {{ form.hidden_tag() }}
+            {{ horizontal_field(form.password)}}
+            {{ horizontal_field(form.submit)}}
+        </form>
+    </div>
+</div>
+
+{% endblock %}

+ 30 - 0
flaskbb/themes/aurora/templates/auth/register.html

@@ -0,0 +1,30 @@
+{% set page_title = _("Register") %}
+
+{% extends theme("layout.html") %}
+{% block content %}
+{% from theme("macros.html") import horizontal_field %}
+
+<div class="panel page-panel">
+    <div class="panel-heading page-head">
+        {% trans %}Register{% endtrans %}
+    </div>
+
+    <div class="panel-body">
+        <form class="form-horizontal" role="form" method="POST">
+            {{ form.hidden_tag() }}
+            {{ horizontal_field(form.username)}}
+            {{ horizontal_field(form.email)}}
+            {{ horizontal_field(form.password)}}
+            {{ horizontal_field(form.confirm_password)}}
+
+            {% if config["RECAPTCHA_ENABLED"] %}
+                {{ horizontal_field(form.recaptcha) }}
+            {% endif %}
+
+            {{ horizontal_field(form.accept_tos)}}
+            {{ horizontal_field(form.submit)}}
+        </form>
+    </div>
+</div>
+
+{% endblock %}

+ 18 - 0
flaskbb/themes/aurora/templates/auth/reset_password.html

@@ -0,0 +1,18 @@
+{% set page_title = _("Reset Password") %}
+
+{% extends theme("layout.html") %}
+{% block content %}
+{% from theme("macros.html") import horizontal_field %}
+
+<form class="form-horizontal" role="form" method="POST">
+    <h2>{% trans %}Reset Password{% endtrans %}</h2>
+    <hr>
+        {{ form.hidden_tag() }}
+        {{ form.token }}
+        {{ horizontal_field(form.email) }}
+        {{ horizontal_field(form.password) }}
+        {{ horizontal_field(form.confirm_password)}}
+        {{ horizontal_field(form.submit)}}
+</form>
+
+{% endblock %}