Various ui work
This commit is contained in:
@@ -18,6 +18,8 @@ def webui_software():
|
|||||||
sources_button = ' <button class="button iis-info"> <i class="fa fa-cloud-download" aria-hidden="true"></i> Edit Sources </button>'
|
sources_button = ' <button class="button iis-info"> <i class="fa fa-cloud-download" aria-hidden="true"></i> Edit Sources </button>'
|
||||||
blends_button = ' <button class="button iis-info"> <i class="fa fa-download" aria-hidden="true"></i> Install a Blend </button>'
|
blends_button = ' <button class="button iis-info"> <i class="fa fa-download" aria-hidden="true"></i> Install a Blend </button>'
|
||||||
bottom_menu = sources_button + blends_button
|
bottom_menu = sources_button + blends_button
|
||||||
|
# Leave out useless buttons until they do more
|
||||||
|
bottom_menu = ''
|
||||||
build_summary()
|
build_summary()
|
||||||
|
|
||||||
return render_template('software.html',
|
return render_template('software.html',
|
||||||
@@ -26,7 +28,8 @@ def webui_software():
|
|||||||
previous_step = previous_step_url,
|
previous_step = previous_step_url,
|
||||||
next_step = next_step_url,
|
next_step = next_step_url,
|
||||||
bottom_menu = bottom_menu,
|
bottom_menu = bottom_menu,
|
||||||
popcon=current_app.config['CONFIG']['recipe']['popcon']['enable_popcon'])
|
popcon=current_app.config['CONFIG']['recipe']['popcon']['enable_popcon'],
|
||||||
|
desktop=current_app.config['CONFIG']['recipe']['install_desktop_environment']['packages'])
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/software/settings', methods=['GET', 'POST'])
|
@bp.route('/software/settings', methods=['GET', 'POST'])
|
||||||
@@ -42,6 +45,19 @@ def software_settings():
|
|||||||
return ('', 204)
|
return ('', 204)
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route('/software/select-desktop', methods=['GET', 'POST'])
|
||||||
|
def software_select_desktop():
|
||||||
|
"""
|
||||||
|
Select a desktop environment for installation
|
||||||
|
"""
|
||||||
|
if request.method == 'POST':
|
||||||
|
desktop = request.form['software-desktop']
|
||||||
|
print(desktop)
|
||||||
|
current_app.config['CONFIG']['recipe']['install_desktop_environment']['packages'] = desktop
|
||||||
|
build_summary()
|
||||||
|
return ('', 204)
|
||||||
|
|
||||||
|
|
||||||
def build_menu():
|
def build_menu():
|
||||||
"""
|
"""
|
||||||
Define menu items and paths.
|
Define menu items and paths.
|
||||||
@@ -58,7 +74,7 @@ def build_summary():
|
|||||||
current_app.config['CONFIG']['Summary']['software'] = {}
|
current_app.config['CONFIG']['Summary']['software'] = {}
|
||||||
current_app.config['CONFIG']['Summary']['software']['heading'] = "Software"
|
current_app.config['CONFIG']['Summary']['software']['heading'] = "Software"
|
||||||
current_app.config['CONFIG']['Summary']['software']['bleh'] = current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']
|
current_app.config['CONFIG']['Summary']['software']['bleh'] = current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']
|
||||||
current_app.config['CONFIG']['Summary']['software']['text'] = "Participate in Popularity Contest: " + str(current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']) + "<br/>No desktop environment selected."
|
current_app.config['CONFIG']['Summary']['software']['text'] = "Participate in Popularity Contest: " + str(current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']) + "<br/>Desktop environment selected: " + str(current_app.config['CONFIG']['recipe']['install_desktop_environment']['packages'])
|
||||||
return("ok?")
|
return("ok?")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,26 +4,45 @@
|
|||||||
<p> <b> Would you like fries with that? </b></p>
|
<p> <b> Would you like fries with that? </b></p>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
<big> Popularity Contest </big>
|
||||||
<div style="background-color: gray; padding: 4px 6px 7px 6px;
|
<br><br>
|
||||||
border-radius: 10px; margin-bottom: 20px;">
|
|
||||||
|
|
||||||
<span style="width: 100%; border-radius: 8px 8px 0 0;"
|
|
||||||
class="tag is-black">
|
|
||||||
Popularity Contest
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div style="padding-left: 15px; padding-right: 15px; background-color: #fff;
|
|
||||||
color: #000;">
|
|
||||||
|
|
||||||
<p>The Popularity Contest (popcon) is a programme where anonymous data is sent back to Debian, tracking the number of packages installed. More information can be obtained at https://popcon.debian.org.</p> <br>
|
<p>The Popularity Contest (popcon) is a programme where anonymous data is sent back to Debian, tracking the number of packages installed. More information can be obtained at https://popcon.debian.org.</p> <br>
|
||||||
|
|
||||||
<input style="background-color: #777777;" type="checkbox" id="popcon"
|
<input style="background-color: #777777;" type="checkbox" id="popcon"
|
||||||
name="popcon" hx-post="/software/settings" hx-trigger="change"
|
name="popcon" hx-post="/software/settings" hx-trigger="change"
|
||||||
{% if popcon %} checked {% endif %}>
|
{% if popcon %} checked {% endif %}>
|
||||||
<label for="popcon"> Participate in PopCon </label><br>
|
<label for="popcon"> Participate in PopCon </label><br>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<big><h3> Desktop Environment </h3></big>
|
||||||
|
<br>
|
||||||
|
<p>Would you like to install a graphical environment for this system?</p>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<form>
|
||||||
|
<div class="control is-link">
|
||||||
|
<div class="select">
|
||||||
|
<select hx-post="/software/select-desktop" hx-target="body" name="software-desktop" style="width: 220px">
|
||||||
|
<option value="" {% if desktop == "None" %} selected=selected {% endif %}> None</option>
|
||||||
|
<option value="task-gnome-desktop" {% if desktop == "task-gnome-desktop" %} selected=selected {% endif %} >GNOME</option>
|
||||||
|
<option value="task-kde-desktop" {% if desktop == "task-kde-desktop" %} selected=selected {% endif %}>KDE Plasma</option>
|
||||||
|
<option value="task-xfce-desktop" {% if desktop == "task-xfce-desktop" %} selected=selected {% endif %}>Xfce</option>
|
||||||
|
<option value="task-lxde-desktop" {% if desktop == "task-lxde-desktop" %} selected=selected {% endif %}>LXDE</option>
|
||||||
|
<option value="task-lxqt-desktop" {% if desktop == "task-lxqt-desktop" %} selected=selected {% endif %}>LXQt</option>
|
||||||
|
<option value="task-mate-desktop" {% if desktop == "task-mate-desktop" %} selected=selected {% endif %}>MATE</option>
|
||||||
|
<option value="lomiri" {% if desktop == "lomiri" %} selected=selected {% endif %}>Lomiri</option>
|
||||||
|
<option value="task-cinnamon-desktop" {% if desktop == "task-cinnamon-desktop" %} selected=selected {% endif %}>Cinnamon</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
<div style="background-color: gray; padding: 4px 6px 7px 6px; border-radius: 10px;">
|
<div style="background-color: gray; padding: 4px 6px 7px 6px; border-radius: 10px;">
|
||||||
<p> <span style="width: 100%; border-radius: 8px 8px 0 0;" class="tag is-black">
|
<p> <span style="width: 100%; border-radius: 8px 8px 0 0;" class="tag is-black">
|
||||||
@@ -56,5 +75,6 @@ Select software from Debian archives</span>
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ def users_root():
|
|||||||
ad_button = ' <button class="button is-light"> <i class="fa fa-address-card" aria-hidden="true"></i> Connect AD </button>'
|
ad_button = ' <button class="button is-light"> <i class="fa fa-address-card" aria-hidden="true"></i> Connect AD </button>'
|
||||||
csv_button = ' <button class="button is-light"> <i class="fa fa-users" aria-hidden="true"></i> Import CSV </button>'
|
csv_button = ' <button class="button is-light"> <i class="fa fa-users" aria-hidden="true"></i> Import CSV </button>'
|
||||||
bottom_menu = root_button + ldap_button + ad_button + csv_button
|
bottom_menu = root_button + ldap_button + ad_button + csv_button
|
||||||
|
bottom_menu = ""
|
||||||
|
|
||||||
initial_user = current_app.config['CONFIG']['recipe']['users']['users'][0]
|
initial_user = current_app.config['CONFIG']['recipe']['users']['users'][0]
|
||||||
|
|
||||||
@@ -55,28 +56,32 @@ def users_root():
|
|||||||
@bp.route('/users/user-check/', methods=['GET', 'POST', 'PUT'])
|
@bp.route('/users/user-check/', methods=['GET', 'POST', 'PUT'])
|
||||||
def check_user():
|
def check_user():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
print("Ok, so method is POST")
|
|
||||||
print("keys are: ", request.form.keys())
|
|
||||||
username = request.form["username"]
|
username = request.form["username"]
|
||||||
fullname = request.form["fullname"]
|
fullname = request.form["fullname"]
|
||||||
password = request.form["password"]
|
|
||||||
password_confirm = request.form["password_confirm"]
|
|
||||||
print(current_app.config['CONFIG']['recipe']['users']['users'][0])
|
|
||||||
print("fullname is: " + fullname)
|
|
||||||
print("password is: " + password)
|
|
||||||
print("password_confirm is: " + password_confirm)
|
|
||||||
current_app.config['CONFIG']['recipe']['users']['users'][0]['username'] = username
|
current_app.config['CONFIG']['recipe']['users']['users'][0]['username'] = username
|
||||||
current_app.config['CONFIG']['recipe']['users']['users'][0]['fullname'] = fullname
|
current_app.config['CONFIG']['recipe']['users']['users'][0]['fullname'] = fullname
|
||||||
current_app.config['CONFIG']['recipe']['users']['users'][0]['password'] = password
|
|
||||||
current_app.config['CONFIG']['recipe']['users']['users'][0]['password_confirm'] = password_confirm
|
|
||||||
if username in ["root", "games"]:
|
if username in ["root", "games"]:
|
||||||
return('<p class="has-text-danger"><b>That username is not available</b> </p>')
|
return('<p class="has-text-danger"><b>That username is not available</b> </p>')
|
||||||
else:
|
else:
|
||||||
return('<p class="has-text-success"><b>That username is available</b> </p>')
|
return('<p class="has-text-success"><b>That username is available</b> </p>')
|
||||||
build_summary()
|
build_summary()
|
||||||
return("bleh")
|
return("")
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route('/users/password-check/', methods=['GET', 'POST', 'PUT'])
|
||||||
|
def check_password():
|
||||||
|
if request.method == 'POST':
|
||||||
|
password = request.form["password"]
|
||||||
|
password_confirm = request.form["password_confirm"]
|
||||||
|
current_app.config['CONFIG']['recipe']['users']['users'][0]['password'] = password
|
||||||
|
current_app.config['CONFIG']['recipe']['users']['users'][0]['password_confirm'] = password_confirm
|
||||||
|
if password != password_confirm:
|
||||||
|
return('<p class="has-text-danger"><b>Passwords do not match</b> </p>')
|
||||||
|
else:
|
||||||
|
return('<p class="has-text-success"><b>Passwords match</b> </p>')
|
||||||
|
build_summary()
|
||||||
|
return("")
|
||||||
|
|
||||||
|
|
||||||
def build_stringlist():
|
def build_stringlist():
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -18,16 +18,22 @@
|
|||||||
<span class="icon is-small is-left">
|
<span class="icon is-small is-left">
|
||||||
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
|
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
|
||||||
</span>
|
</span>
|
||||||
|
<!-- <span class="icon is-small is-right">
|
||||||
|
<img src="/static/icons/emblem-default-symbolic.svg">
|
||||||
|
</span> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>{{ string_dict['user_name'] }}</label>
|
<label>{{ string_dict['user_name'] }}</label>
|
||||||
<div class="control has-icons-left has-icons-right">
|
<div class="control has-icons-left has-icons-right">
|
||||||
<input class="input is-success" type="text" placeholder="{{ string_dict['user_name'] }}" value="{% if initial_user['username'] %}{{ initial_user['username'] }}{% endif %}" name="username" hx-post="/users/user-check" hx-trigger="keyup changed delay:200ms" hx-trigger="load" hx-target="#username-status">
|
<input class="input" type="text" placeholder="{{ string_dict['user_name'] }}" value="{% if initial_user['username'] %}{{ initial_user['username'] }}{% endif %}" name="username" hx-post="/users/user-check" hx-trigger="keyup changed delay:200ms" hx-trigger="load" hx-target="#username-status">
|
||||||
<span class="icon is-small is-left">
|
<span class="icon is-small is-left">
|
||||||
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
|
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
|
||||||
</span>
|
</span>
|
||||||
|
<!-- <span class="icon is-small is-right">
|
||||||
|
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
|
||||||
|
</span> -->
|
||||||
</div>
|
</div>
|
||||||
<div id="username-status">
|
<div id="username-status">
|
||||||
<p> {{ string_dict['user_name_hint'] }}</p>
|
<p> {{ string_dict['user_name_hint'] }}</p>
|
||||||
@@ -37,7 +43,7 @@
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="password">{{ string_dict['password'] }}</label>
|
<label class="password">{{ string_dict['password'] }}</label>
|
||||||
<div class="control has-icons-left has-icons-right">
|
<div class="control has-icons-left has-icons-right">
|
||||||
<input class="input" name="password" type="password" placeholder="{{ string_dict['password'] }}" value="{% if initial_user['password'] %}{{ initial_user['password'] }}{% endif %}" hx-post="/users/user-check" hx-trigger="keyup changed delay:200ms" hx-target="#username-status">
|
<input class="input" name="password" type="password" placeholder="{{ string_dict['password'] }}" value="{% if initial_user['password'] %}{{ initial_user['password'] }}{% endif %}" hx-post="/users/password-check" hx-trigger="keyup changed delay:200ms" hx-target="#password-status">
|
||||||
<span class="icon is-small is-left">
|
<span class="icon is-small is-left">
|
||||||
<i class="fa fa-address-card" aria-hidden="true"></i>
|
<i class="fa fa-address-card" aria-hidden="true"></i>
|
||||||
</span>
|
</span>
|
||||||
@@ -47,10 +53,13 @@
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="password">{{ string_dict['password_confirm'] }}</label>
|
<label class="password">{{ string_dict['password_confirm'] }}</label>
|
||||||
<div class="control has-icons-left has-icons-right">
|
<div class="control has-icons-left has-icons-right">
|
||||||
<input class="input" name="password_confirm" type="password" placeholder="{{ string_dict['password_confirm'] }}" value="{% if initial_user['password_confirm'] %}{{ initial_user['password_confirm'] }}{% endif %}" hx-post="/users/user-check" hx-trigger="keyup changed delay:200ms" hx-target="#password-status">
|
<input class="input" name="password_confirm" type="password" placeholder="{{ string_dict['password_confirm'] }}" value="{% if initial_user['password_confirm'] %}{{ initial_user['password_confirm'] }}{% endif %}" hx-post="/users/password-check" hx-trigger="keyup changed delay:200ms" hx-target="#password-status">
|
||||||
<span class="icon is-small is-left">
|
<span class="icon is-small is-left">
|
||||||
<i class="fa fa-address-card" aria-hidden="true"></i>
|
<i class="fa fa-address-card" aria-hidden="true"></i>
|
||||||
</span>
|
</span>
|
||||||
|
<div id="password-status">
|
||||||
|
<p> </p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,8 @@
|
|||||||
<p><b> {{ string_dict['welcome_text'] }} </b></p>
|
<p><b> {{ string_dict['welcome_text'] }} </b></p>
|
||||||
<p>{{ string_dict['confirm_text'] }} </p> <br />
|
<p>{{ string_dict['confirm_text'] }} </p> <br />
|
||||||
|
|
||||||
<!--
|
<form action="/welcome" method="POST">
|
||||||
<div style="float: left; padding-left: 100px;">
|
<i class="fa fa-language" aria-hidden="true"></i> {{ string_dict['language_text'] }}
|
||||||
<button class="button is-dark" style="height: 180px;">
|
|
||||||
<img src="/static/icons/language.jpg" width="96px" alt="{{ string_dict['language_text'] }}" />
|
|
||||||
<div class="control is-link" width="180px">
|
<div class="control is-link" width="180px">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<select hx-post="/welcome" hx-target="body" name="lang" style="width: 220px">
|
<select hx-post="/welcome" hx-target="body" name="lang" style="width: 220px">
|
||||||
@@ -21,35 +19,20 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</form>
|
||||||
</div>
|
<br>
|
||||||
-->
|
|
||||||
|
|
||||||
<button class="button is-dark" style="float: left; margin-left: 100px; background-color: #242424; padding: 25px;">
|
<form>
|
||||||
<img src="/static/icons/language.jpg" width="96px" alt="{{ string_dict['language_text'] }}" />
|
<i class="fa fa-keyboard-o" aria-hidden="true"></i> {{ string_dict['keylayout_text'] }}
|
||||||
<br> {{ string_dict['language_text'] }} {{ selected_lang }}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<div style="float: left; position: relative; top: -10px; padding-left: 100px;"
|
|
||||||
<button class="button is-dark">
|
|
||||||
<img src="/static/icons/keyboard.png" width="90px" />
|
|
||||||
<div class="control is-link">
|
<div class="control is-link">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<select hx-post="/welcome" hx-target="body" name="keyboard" style="width: 220px">
|
<select hx-post="/welcome" hx-target="body" name="keyboard" style="width: 220px">
|
||||||
<option>en-us</option>
|
<option>en-us</option>
|
||||||
<option>en-za</option>
|
<option>en-uk</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</form>
|
||||||
</div>
|
<br />
|
||||||
-->
|
|
||||||
|
|
||||||
<div style="float: left; margin-left: 100px; background-color: #242424; padding: 25px;">
|
|
||||||
<img src="/static/icons/keyboard,png" width="96px" /><br>
|
|
||||||
Keyboard
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user