Streamlined post form handlers for admin console
This commit is contained in:
@ -2,9 +2,9 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<form name="form-update-account" class="form-signin">
|
||||
<form name="form-update-account" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="{{ url_for('admin_views.home') }}">
|
||||
{% include "admin/components/server-alerts.html" %}
|
||||
<h2 class="form-signin-heading">Update Your Account</h2>
|
||||
<h2 class="form-heading">Update Your Account</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-label-group">
|
||||
Please confirm <strong>your current password</strong> before making any changes to your user account.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<form name="form-login" class="form-signin">
|
||||
<form name="form-login" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="{{ url_for('admin_views.home') }}">
|
||||
{% include "admin/components/server-alerts.html" %}
|
||||
<h2 class="form">Log In</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
|
@ -10,9 +10,9 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<form name="form-register" action="" method="" class="form-signin">
|
||||
<form name="form-register" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="{{ url_for('admin_auth.login') }}">
|
||||
{% include "admin/components/server-alerts.html" %}
|
||||
<h2 class="form-signin-heading">Register an Account</h2>
|
||||
<h2 class="form-heading">Register an Account</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-label-group">
|
||||
{{ form.username(class_="form-control", autofocus=true, placeholder="Username") }}
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<form name="form-reset" class="form-signin">
|
||||
<form name="form-reset" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="{{ url_for('admin_auth.login') }}">
|
||||
{% include "admin/components/server-alerts.html" %}
|
||||
<h2 class="form-signin-heading">Reset Password</h2>
|
||||
<h2 class="form-heading">Reset Password</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-label-group">
|
||||
{{ form.username(class_="form-control", autofocus=true, placeholder="Enter Username") }}
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<form name="form-update-password" class="form-signin">
|
||||
<form name="form-update-password" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="{{ url_for('admin_auth.login') }}">
|
||||
{% include "admin/components/server-alerts.html" %}
|
||||
<h2 class="form-signin-heading">Update Password</h2>
|
||||
<h2 class="form-heading">Update Password</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-label-group">
|
||||
{{ form.password(class_="form-control", placeholder="Password") }}
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<form name="form-delete-user" class="form-signin">
|
||||
<form name="form-delete-user" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="{{ url_for('admin_views.users') }}">
|
||||
{% include "admin/components/server-alerts.html" %}
|
||||
<h2 class="form-signin-heading">Delete User ‘{{ user.username }}’?</h2>
|
||||
<h2 class="form-heading">Delete User ‘{{ user.username }}’?</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<p>This action cannot be undone. Deleting an account will mean {{ user.username }} will no longer be able to log in to the admin console.</p>
|
||||
<p>Are you sure you want to proceed?</p>
|
||||
|
@ -1,8 +1,8 @@
|
||||
{% extends "admin/components/datatable.html" %}
|
||||
{% block title %} SKA Referee Test | Upload Questions {% endblock %}
|
||||
{% block content %}
|
||||
<h1>Manage Question Datasets</h1>
|
||||
{% include "admin/components/client-alerts.html" %}
|
||||
<h1>Manage Question Datasets</h1>
|
||||
{% if data %}
|
||||
<table id="question-datasets-table" class="table table-striped" style="width:100%">
|
||||
<thead>
|
||||
@ -56,14 +56,16 @@
|
||||
href="#"
|
||||
class="btn btn-primary edit-question-dataset {% if element.filename == default %}disabled{% endif %}"
|
||||
data-filename="{{ element.filename }}"
|
||||
data-action="default"
|
||||
title="Make Default"
|
||||
>
|
||||
<i class="bi bi-file-earmark-text-fill button-icon"></i>
|
||||
</button>
|
||||
<a
|
||||
href="#"
|
||||
class="btn btn-danger delete-question-dataset {% if element.filename == default %}disabled{% endif %}"
|
||||
class="btn btn-danger edit-question-dataset {% if element.filename == default %}disabled{% endif %}"
|
||||
data-filename="{{ element.filename }}"
|
||||
data-action="delete"
|
||||
title="Delete Dataset"
|
||||
>
|
||||
<i class="bi bi-file-earmark-excel-fill button-icon"></i>
|
||||
@ -80,8 +82,8 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-container">
|
||||
<form name="form-upload-questions" method="post" action="#" class="form-signin" enctype="multipart/form-data">
|
||||
<h2 class="form-signin-heading">Upload Question Dataset</h2>
|
||||
<form name="form-upload-questions" class="form-display" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="" enctype="multipart/form-data">
|
||||
<h2 class="form-heading">Upload Question Dataset</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-upload">
|
||||
{{ form.data_file() }}
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<form name="form-update-user" class="form-signin">
|
||||
<form name="form-update-user" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="{{ url_for('admin_views.users') }}">
|
||||
{% include "admin/components/server-alerts.html" %}
|
||||
<h2 class="form-signin-heading">Update User ‘{{ user.username }}’</h2>
|
||||
<h2 class="form-heading">Update User ‘{{ user.username }}’</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-label-group">
|
||||
{{ form.email(class_="form-control", placeholder="Email Address", value = user.email) }}
|
||||
|
@ -71,8 +71,8 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="form-container">
|
||||
<form name="form-create-user" class="form-signin">
|
||||
<h2 class="form-signin-heading">Create User</h2>
|
||||
<form name="form-create-user" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="">
|
||||
<h2 class="form-heading">Create User</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-label-group">
|
||||
{{ form.username(class_="form-control", placeholder="Enter Username") }}
|
||||
|
@ -43,18 +43,18 @@
|
||||
<td>
|
||||
{% if test.time_limit == None -%}
|
||||
None
|
||||
{% elif test.time_limit == '60' -%}
|
||||
{% elif test.time_limit == 60 -%}
|
||||
1 hour
|
||||
{% elif test.time_limit == '90' -%}
|
||||
{% elif test.time_limit == 90 -%}
|
||||
1 hour 30 min
|
||||
{% elif test.time_limit == '120' -%}
|
||||
{% elif test.time_limit == 120 -%}
|
||||
2 hours
|
||||
{% else -%}
|
||||
{{ test.time_limit }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ test.attempts|length }}
|
||||
{{ test.entries|length }}
|
||||
</td>
|
||||
<td class="row-actions">
|
||||
<a
|
||||
@ -86,8 +86,8 @@
|
||||
{% endif %}
|
||||
{% if form %}
|
||||
<div class="form-container">
|
||||
<form name="form-create-test" class="form-signin">
|
||||
<h2 class="form-signin-heading">Create Exam</h2>
|
||||
<form name="form-create-test" class="form-display form-post" action="{{ url_for(request.endpoint, **request.view_args) }}" data-rel-success="/admin/tests/">
|
||||
<h2 class="form-heading">Create Exam</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-date-input">
|
||||
{{ form.start_date(placeholder="Enter Start Date", class_ = "datepicker") }}
|
||||
|
Reference in New Issue
Block a user