mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
c00ddea2fc
Added server-side logic for register.html validation Keep form firelds on register.html in the event of wrong input fields to save users from retyping info More button rounding
180 lines
7.4 KiB
HTML
180 lines
7.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>Register - {{ SITE_NAME }}</title>
|
|
<link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}">
|
|
<!-- Tell the browser to be responsive to screen width -->
|
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.min.css">
|
|
{% assets "css_login" -%}
|
|
<link rel="stylesheet" href="{{ ASSET_URL }}">
|
|
{%- endassets %}
|
|
</head>
|
|
|
|
<body class="hold-transition register-page">
|
|
<div class="register-box">
|
|
<div class="card card-outline card-primary">
|
|
<div class="card-header text-center">
|
|
<a href="{{ url_for('index.index') }}" class="h3">
|
|
{% if SETTING.get('site_name') %}
|
|
{{ SITE_NAME }}
|
|
{% else %}
|
|
<b>PowerDNS</b>-Admin
|
|
{% endif %}
|
|
</a>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if error %}
|
|
<div class="alert alert-danger alert-dismissible">
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
|
{{ error }}
|
|
</div>
|
|
{% endif %}
|
|
<p class="login-box-msg">Enter your personal details below</p>
|
|
<form action="{{ url_for('index.register') }}" method="post" novalidate>
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
|
|
|
<div class="form-group">
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-user"></i>
|
|
</span>
|
|
</div>
|
|
<input type="text" class="form-control {{ 'is-invalid' if 'firstname' in error_messages else '' }}" placeholder="First Name" name="firstname" id="firstname" value="{{ request.form.firstname }}" required>
|
|
{% if 'firstname' in error_messages %}
|
|
<div class="invalid-feedback">
|
|
{{ error_messages['firstname'] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-user"></i>
|
|
</span>
|
|
</div>
|
|
<input type="text" class="form-control {{ 'is-invalid' if 'lastname' in error_messages else '' }}" placeholder="Last name" name="lastname" id="lastname" value="{{ request.form.lastname }}" required>
|
|
{% if 'lastname' in error_messages %}
|
|
<div class="invalid-feedback">
|
|
{{ error_messages['lastname'] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-envelope"></i>
|
|
</span>
|
|
</div>
|
|
<input type="email" class="form-control {{ 'is-invalid' if 'email' in error_messages else '' }}" placeholder="Email" name="email" id="email" value="{{ request.form.email }}" required>
|
|
{% if 'email' in error_messages %}
|
|
<div class="invalid-feedback">
|
|
<i class="fas fa-exclamation-triangle"></i>
|
|
{{ error_messages['email'] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<p class="login-box-msg">Enter your account details below</p>
|
|
|
|
<div class="form-group">
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-user"></i>
|
|
</span>
|
|
</div>
|
|
<input type="text" class="form-control {{ 'is-invalid' if 'username' in error_messages else '' }}" placeholder="Username" name="username" id="username" value="{{ request.form.username }}" required>
|
|
{% if 'email' in error_messages %}
|
|
<div class="invalid-feedback">
|
|
{{ error_messages['username'] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-lock"></i>
|
|
</span>
|
|
</div>
|
|
<input type="password" class="form-control {{ 'is-invalid' if 'password' in error_messages else '' }}" placeholder="Password" id="password" name="password" required>
|
|
{% if 'email' in error_messages %}
|
|
<div class="invalid-feedback">
|
|
{{ error_messages['password'] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-lock"></i>
|
|
</span>
|
|
</div>
|
|
<input type="password" class="form-control {{ 'is-invalid' if 'rpassword' in error_messages else '' }}" placeholder="Retype password" id="rpassword" name="rpassword" required>
|
|
{% if 'rpassword' in error_messages %}
|
|
<div class="invalid-feedback">
|
|
{{ error_messages['rpassword'] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
{% if captcha_enable %}
|
|
<p class="login-box-msg">Please complete the CAPTCHA below</p>
|
|
<div class="form-group has-feedback">
|
|
{{ captcha() }}
|
|
<input type="text" class="form-control" placeholder="CAPTCHA" name="captcha"
|
|
data-error="Please complete the CAPTCHA" required>
|
|
<span class="help-block with-errors"></span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<button type="button" class="btn btn-block" id="button_back">Back</button>
|
|
</div>
|
|
<div class="col-4">
|
|
<button type="submit" class="btn btn-primary btn-block">Register</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="login-box-footer">
|
|
<center>
|
|
<p>Powered by <a href="https://github.com/PowerDNS-Admin/PowerDNS-Admin">PowerDNS-Admin</a></p>
|
|
</center>
|
|
</div>
|
|
</div>
|
|
{% assets "js_login" -%}
|
|
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
{% assets "js_validation" -%}
|
|
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
<script>
|
|
$(function () {
|
|
$('#button_back').click(function () {
|
|
window.location.href = '{{ url_for('index.login') }}';
|
|
})
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|