Skip to content

Commit

Permalink
Add base template to security templates (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwag956 committed May 6, 2019
1 parent 32968e5 commit c3ceca7
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 1 deletion.
30 changes: 30 additions & 0 deletions flask_security/templates/security/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% block doc -%}
<!DOCTYPE html>
<html{% block html_attribs %}{% endblock html_attribs %}>
{%- block html %}
<head>
{%- block head %}
<title>{% block title %}{{ title|default }}{% endblock title %}</title>

{%- block metas %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{%- endblock metas %}

{%- block styles %}
{%- endblock styles %}
{%- endblock head %}
</head>
<body{% block body_attribs %}{% endblock body_attribs %}>
{% block body -%}
{% block navbar %}
{%- endblock navbar %}
{% block content -%}
{%- endblock content %}

{% block scripts %}
{%- endblock scripts %}
{%- endblock body %}
</body>
{%- endblock html %}
</html>
{% endblock doc -%}
5 changes: 4 additions & 1 deletion flask_security/templates/security/change_password.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Change password') }}</h1>
<form action="{{ url_for_security('change_password') }}" method="POST" name="change_password_form">
Expand All @@ -8,4 +11,4 @@ <h1>{{ _('Change password') }}</h1>
{{ render_field_with_errors(change_password_form.new_password_confirm) }}
{{ render_field(change_password_form.submit) }}
</form>

{% endblock %}
4 changes: 4 additions & 0 deletions flask_security/templates/security/forgot_password.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Send password reset instructions') }}</h1>
<form action="{{ url_for_security('forgot_password') }}" method="POST" name="forgot_password_form">
Expand All @@ -7,3 +10,4 @@ <h1>{{ _('Send password reset instructions') }}</h1>
{{ render_field(forgot_password_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
4 changes: 4 additions & 0 deletions flask_security/templates/security/login_user.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Login') }}</h1>
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form">
Expand All @@ -9,3 +12,4 @@ <h1>{{ _('Login') }}</h1>
{{ render_field(login_user_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
4 changes: 4 additions & 0 deletions flask_security/templates/security/register_user.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Register') }}</h1>
<form action="{{ url_for_security('register') }}" method="POST" name="register_user_form">
Expand All @@ -11,3 +14,4 @@ <h1>{{ _('Register') }}</h1>
{{ render_field(register_user_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
4 changes: 4 additions & 0 deletions flask_security/templates/security/reset_password.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Reset password') }}</h1>
<form action="{{ url_for_security('reset_password', token=reset_password_token) }}" method="POST" name="reset_password_form">
Expand All @@ -8,3 +11,4 @@ <h1>{{ _('Reset password') }}</h1>
{{ render_field(reset_password_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
4 changes: 4 additions & 0 deletions flask_security/templates/security/send_confirmation.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Resend confirmation instructions') }}</h1>
<form action="{{ url_for_security('send_confirmation') }}" method="POST" name="send_confirmation_form">
Expand All @@ -7,3 +10,4 @@ <h1>{{ _('Resend confirmation instructions') }}</h1>
{{ render_field(send_confirmation_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
4 changes: 4 additions & 0 deletions flask_security/templates/security/send_login.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Login') }}</h1>
<form action="{{ url_for_security('login') }}" method="POST" name="send_login_form">
Expand All @@ -7,3 +10,4 @@ <h1>{{ _('Login') }}</h1>
{{ render_field(send_login_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}

0 comments on commit c3ceca7

Please sign in to comment.