refactor security to Flask-Security - Part 2
This commit is contained in:
25
eveai_app/templates/user/edit_user.html
Normal file
25
eveai_app/templates/user/edit_user.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Update User{% endblock %}
|
||||
|
||||
{% block content_title %}Update User{% endblock %}
|
||||
{% block content_description %}Update given user account{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{% for field in form %}
|
||||
<div class="form-group">
|
||||
{{ field.label }}
|
||||
{{ field(class="form-control", disabled=true) if field.name in ['email', 'user_name'] else field(class="form-control") }}
|
||||
{% if field.errors %}
|
||||
<div class="alert alert-danger">
|
||||
{% for error in field.errors %}
|
||||
<p>{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<button type="submit" class="btn btn-primary">Update User</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -1,9 +1,13 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}User Details{% endblock %}
|
||||
{% block title %}User Registration{% endblock %}
|
||||
|
||||
{% block content_title %}Register User{% endblock %}
|
||||
{% block content_description %}Make a new user account{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form action="" method="post" novalidate>
|
||||
<form action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
<p>
|
||||
{{ form.user_name.label }}<br>
|
||||
{{ form.user_name(size=80) }}
|
||||
@@ -16,6 +20,10 @@
|
||||
{{ form.password.label }}<br>
|
||||
{{ form.password(size=80) }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.confirm_password.label }}<br>
|
||||
{{ form.confirm_password(size=80) }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.first_name.label }}<br>
|
||||
{{ form.first_name(size=80) }}
|
||||
@@ -28,18 +36,6 @@
|
||||
{{ form.is_active.label }}<br>
|
||||
{{ form.is_active() }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.is_tester.label }}<br>
|
||||
{{ form.is_tester() }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.is_admin.label }}<br>
|
||||
{{ form.is_admin() }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.is_super.label }}<br>
|
||||
{{ form.is_super() }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.valid_to.label }}<br>
|
||||
{{ form.valid_to() }}
|
||||
@@ -51,3 +47,8 @@
|
||||
<p>{{ form.submit() }}</p>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content_footer %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user