Use the new qvf method in the login page.

This commit is contained in:
Relintai 2024-02-26 21:36:35 +01:00
parent 52480b4c1d
commit 04d085529a
2 changed files with 2 additions and 6 deletions

View File

@ -11,11 +11,7 @@ func _render(request: WebServerRequest, data: Dictionary) -> String:
if (!error_str.empty()): if (!error_str.empty()):
data[\"error_str\"] = get_and_render_template(@\"LoginErrorStrTemplate\", data) data[\"error_str\"] = get_and_render_template(@\"LoginErrorStrTemplate\", data)
var uname_val : String = data[\"uname_val\"] data[\"username_prev_value\"] = data[\"uname_val\"]
data[\"username_prev_value\"] = \"\"
if (!uname_val.empty()):
data[\"username_prev_value\"] = 'value=\"' + uname_val + '\"'
return get_and_render_template(@\"Login\", data) return get_and_render_template(@\"Login\", data)
" "

View File

@ -17,7 +17,7 @@
<form method="POST"> <form method="POST">
<div class="form-group"> <div class="form-group">
<label for="username_input" class="form_label">Username</label> <label for="username_input" class="form_label">Username</label>
<input type="text" name="username" {{ username_prev_value }} class="form-control" id="username_input"> <input type="text" name="username" {{ qvf(username_prev_value, 'value="%s"', username_prev_value)) }} class="form-control" id="username_input">
</div> </div>
<div class="form-group"> <div class="form-group">