Some more initial UI work, initial translation support
This commit is contained in:
Binary file not shown.
@@ -1,11 +1,24 @@
|
||||
from applets.software import bp
|
||||
from flask import Flask, request, session, redirect, \
|
||||
url_for, render_template, flash, Blueprint
|
||||
# we use this neat little trick to get config data from the main app
|
||||
from flask import current_ap
|
||||
|
||||
|
||||
@bp.route('/users')
|
||||
def users_root():
|
||||
def build_stringlist():
|
||||
"""
|
||||
Users screen for the webui.
|
||||
Return all the strings that is used in this applet.
|
||||
"""
|
||||
return render_template('users.html')
|
||||
string_dict = {}
|
||||
string_dict['initial_user_text'] = _("Let's set up an initial user.")
|
||||
string_dict['full_name'] = _("Full Name")
|
||||
string_dict['user_name'] = _("Username")
|
||||
string_dict['user_name_available'] = _("This username is available")
|
||||
string_dict['user_name_not_available'] = _("This username is not available")
|
||||
string_dict['user_name_reserved'] = _("This username is reserved by the system")
|
||||
string_dict['user_name_characters'] = _("The username must be one word, lowercase, with no special characters")
|
||||
string_dict['password'] = _("Password")
|
||||
string_dict['password_confirm'] = _("Password (confirm)")
|
||||
string_dict['password_nomatch'] = _("These passwords do now match")
|
||||
string_dict['password_tooshort'] = _("This password is too short")
|
||||
return string_dict
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<p><b> Let's set up an initial user. </b></p>
|
||||
<p><b> {{ string_dict['initial_user_text'] }} </b></p>
|
||||
|
||||
<br>
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
<div style="margin-left: 180px;">
|
||||
|
||||
<div class="field">
|
||||
<label>Full Name</label> <div class="control"><input class="input" type="text" placeholder="Text input">
|
||||
<label>{{ string_dict['full_name'] }}</label> <div class="control"><input class="input" type="text" placeholder="Text input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Username</label>
|
||||
<label>{{ string_dict['user_name'] }}</label>
|
||||
<div class="control has-icons-left has-icons-right">
|
||||
<input class="input is-success" type="text" placeholder="Text input" value="user">
|
||||
<input class="input is-success" type="text" placeholder="Text input" value="" hx-get="/users/username-check" hx-trigger="keyup changed delay:500ms" hx-target="#username-status">
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fas fa-user"></i>
|
||||
</span>
|
||||
@@ -25,20 +25,22 @@
|
||||
<i class="fas fa-check"></i>
|
||||
</span>
|
||||
</div>
|
||||
<p class="help is-success">This username is available</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="password">Password</label>
|
||||
<div class="control">
|
||||
<input class="input" type="password" placeholder="Enter password">
|
||||
<div id="username-status">
|
||||
<p class="help is-success">{{ string_dict['user_name_available'] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="password">Password (confirm)</label>
|
||||
<label class="password">{{ string_dict['password'] }}</label>
|
||||
<div class="control">
|
||||
<input class="input" type="password" placeholder="Enter password (confirm)">
|
||||
<input class="input" type="password" placeholder="{{ string_dict['password'] }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="password">{{ string_dict['password_confirm'] }}</label>
|
||||
<div class="control">
|
||||
<input class="input" type="password" placeholder="{{ string_dict['password_confirm'] }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user