mirror of
https://github.com/Relintai/pandemonium_demo_projects.git
synced 2024-12-21 13:56:50 +01:00
Finished converting the register page to use the new templates.
This commit is contained in:
parent
9e21d5aab8
commit
15e23dbedf
@ -11,86 +11,42 @@
|
||||
</div>
|
||||
|
||||
[ Register ]
|
||||
func render_register_default(request: WebServerRequest, data: Dictionary) -> void:
|
||||
var b : HTMLBuilder = HTMLBuilder.new()
|
||||
<div class="row mb-4">
|
||||
<div class="col-2"></div>
|
||||
<div class="col-8"> <h2>Registration</h2></div>
|
||||
<div class="col-2"></div>
|
||||
</div>
|
||||
{{ pr(error_str) }}
|
||||
<div class="row mb-4">
|
||||
<div class="col-2"></div>
|
||||
|
||||
# Title
|
||||
b.div("row mb-4")
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
<div class="col-8">
|
||||
<form method="POST">
|
||||
|
||||
b.div("col-8")
|
||||
<div class="form-group">
|
||||
<label for="username_input" class="form_label">Username</label>
|
||||
<input type="text" name="username" {{ qvf(uname_val, 'value="%s"', uname_val)) }} class="form-control" id="username_input">
|
||||
</div>
|
||||
|
||||
b.h2()
|
||||
b.w("Registration")
|
||||
b.ch2()
|
||||
<div class="form-group">
|
||||
<label for="email_input" class="form_label">Email</label>
|
||||
<input type="text" name="email" {{ qvf(email_val, 'value="%s"', email_val)) }} class="form-control" id="email_input">
|
||||
</div>
|
||||
|
||||
b.cdiv()
|
||||
<div class="form-group">
|
||||
<label for="password_input" class="form_label">Password</label>
|
||||
<input type="password" name="password" placeholder="*******" class="form-control" id="password_input">
|
||||
</div>
|
||||
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
b.cdiv()
|
||||
<div class="form-group">
|
||||
<label for="password_check_input" class="form_label">Password again</label>
|
||||
<input type="password" name="password_check" placeholder="*******" class="form-control" id="password_check_input">
|
||||
</div>
|
||||
|
||||
# Errors
|
||||
var error_str : String = data["error_str"]
|
||||
<button type="submit" class="btn btn-outline-primary mt-3">Register</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
if !error_str.empty():
|
||||
b.div("row mb-4")
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
<div class="col-2"></div>
|
||||
</div>
|
||||
|
||||
b.div("col-8")
|
||||
b.div("alert alert-danger").attrib("role", "alert")
|
||||
b.w(error_str)
|
||||
b.cdiv()
|
||||
b.cdiv()
|
||||
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
b.cdiv()
|
||||
|
||||
# Form
|
||||
b.div("row")
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
|
||||
b.div("col-8")
|
||||
|
||||
if true:
|
||||
b.form().method_post()
|
||||
b.csrf_tokenr(request)
|
||||
|
||||
b.div("form-group")
|
||||
b.label().fora("username_input").cls("form_label").f().w("Username").clabel()
|
||||
b.input_text("username", data["uname_val"], "", "form-control", "username_input")
|
||||
b.cdiv()
|
||||
|
||||
b.div("form-group")
|
||||
b.label().fora("email_input").cls("form_label").f().w("Email").clabel()
|
||||
b.input_text("email", data["email_val"], "", "form-control", "email_input")
|
||||
b.cdiv()
|
||||
|
||||
b.div("form-group")
|
||||
b.label().fora("password_input").cls("form_label").f().w("Password").clabel()
|
||||
b.input_password("password", "", "*******", "form-control", "password_input")
|
||||
b.cdiv()
|
||||
|
||||
b.div("form-group")
|
||||
b.label().fora("password_check_input").cls("form_label").f().w("Password again").clabel()
|
||||
b.input_password("password_check", "", "*******", "form-control", "password_check_input")
|
||||
b.cdiv()
|
||||
|
||||
b.button().type("submit").cls("btn btn-outline-primary mt-3").f().w("Register").cbutton()
|
||||
|
||||
b.cform()
|
||||
|
||||
b.cdiv()
|
||||
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
b.cdiv()
|
||||
|
||||
|
||||
b.write_tag()
|
||||
request.body += b.result
|
||||
request.compile_and_send_body()
|
||||
|
@ -1,42 +1,16 @@
|
||||
|
||||
[ RegisterSuccess ]
|
||||
func render_register_success(request: WebServerRequest, data: Dictionary) -> void:
|
||||
var b : HTMLBuilder = HTMLBuilder.new()
|
||||
<div class="row mb-4">
|
||||
<div class="col-2"></div>
|
||||
<div class="col-8"> <h2>Registration successful!</h2></div>
|
||||
<div class="col-2"></div>
|
||||
</div>
|
||||
<div class="row mb-4">
|
||||
<div class="col-2"></div>
|
||||
<div class="col-8">
|
||||
Login Here:<br>
|
||||
<a href="{{ redirect_on_success_url }}">{{ ">> Login <<" }}</a>
|
||||
</div>
|
||||
<div class="col-2"></div>
|
||||
</div>
|
||||
|
||||
# Title
|
||||
b.div("row mb-4")
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
|
||||
b.div("col-8")
|
||||
|
||||
b.h2()
|
||||
b.w("Registration successful!")
|
||||
b.ch2()
|
||||
|
||||
b.cdiv()
|
||||
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
b.cdiv()
|
||||
|
||||
# msg
|
||||
b.div("row")
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
|
||||
b.div("col-8")
|
||||
b.w("Login Here:").br()
|
||||
b.br()
|
||||
b.a(redirect_on_success_url)
|
||||
b.w(">> Login <<")
|
||||
b.ca()
|
||||
b.cdiv()
|
||||
|
||||
b.div("col-2")
|
||||
b.cdiv()
|
||||
b.cdiv()
|
||||
|
||||
b.write_tag()
|
||||
request.body += b.result
|
||||
request.compile_and_send_body()
|
||||
|
Loading…
Reference in New Issue
Block a user