diff --git a/README.md b/README.md
index 8b37084..31e0a7d 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,20 @@
-Dependencies
+# Welcome
+
+Welcome to System Installer, a powerful toolkit for setting up an installer for operating systems.
+
+Dependencies:
- flask
- - flask-babel
- pytest
- coverage
- - libjs-htmx
- - libjs-material-design-lite
- - xapp-gtk3-module
+ - libxapp-gtk3-module
+ - gettext
+Recommended:
+ - libjs-htmx (needed if the web front-end is to be used)
+ - sass-stylesheets-bulma (needed if the web front-end is to be used)
## Development
### Translations
-Upstream PyBabel documentation:
-https://python-babel.github.io/flask-babel/index.html#translating-applications
-
-in the ./daemon directory, run the following to regenerate the translations file:
-
-```pybabel extract -F babel.cfg -o messages.pot .```
+-- TODO --
diff --git a/src/applets/disks/disks.html b/src/applets/disks/disks.html
index 1cb217f..2e0af87 100644
--- a/src/applets/disks/disks.html
+++ b/src/applets/disks/disks.html
@@ -26,7 +26,9 @@
Proposed layout:
-
+
+
+
diff --git a/src/applets/users/__pycache__/routes.cpython-312.pyc b/src/applets/users/__pycache__/routes.cpython-312.pyc
index 6f7cf21..4c06c18 100644
Binary files a/src/applets/users/__pycache__/routes.cpython-312.pyc and b/src/applets/users/__pycache__/routes.cpython-312.pyc differ
diff --git a/src/applets/users/routes.py b/src/applets/users/routes.py
index 1126a58..3992633 100644
--- a/src/applets/users/routes.py
+++ b/src/applets/users/routes.py
@@ -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
diff --git a/src/applets/users/users.html b/src/applets/users/users.html
index c8aa0c6..b3522e4 100644
--- a/src/applets/users/users.html
+++ b/src/applets/users/users.html
@@ -1,7 +1,7 @@
{% extends "layout.html" %}
{% block body %}
-
Let's set up an initial user.
+
{{ string_dict['initial_user_text'] }}
@@ -10,14 +10,14 @@
-
+
-
+
-
+
@@ -25,20 +25,22 @@
-
This username is available
-
-
-
-
-
-
+
+
{{ string_dict['user_name_available'] }}
-
+
-
+
+
+
+
+
+
+
+
diff --git a/src/applets/welcome/__pycache__/routes.cpython-312.pyc b/src/applets/welcome/__pycache__/routes.cpython-312.pyc
index f65f4b4..5203f8d 100644
Binary files a/src/applets/welcome/__pycache__/routes.cpython-312.pyc and b/src/applets/welcome/__pycache__/routes.cpython-312.pyc differ
diff --git a/src/applets/welcome/routes.py b/src/applets/welcome/routes.py
index 6cbc542..00686ed 100644
--- a/src/applets/welcome/routes.py
+++ b/src/applets/welcome/routes.py
@@ -1,12 +1,21 @@
from applets.welcome 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_app
import gettext
import dmm.lsblk as lsblk
# Set up Gettext
-en_i18n = gettext.translation("welcome", './locales', fallback=True, languages=['af', 'en'])
-en_i18n.install()
+def set_language(LANG):
+ """
+ Sets language for this applet
+ """
+ translations = gettext.translation("welcome", './applets/welcome/locales', fallback=True, languages=[LANG])
+ translations.install()
+ _ = translations.gettext
+
+set_language('en')
@bp.route('/welcome',methods=['GET', 'POST', 'PUT'])
def welcome_index():
@@ -14,9 +23,20 @@ def welcome_index():
The page you'd get if you access the root of
this app in a browser.
"""
+ if request.method == 'POST':
+ if "lang" in request.form.keys():
+ current_app.config['CONFIG']['global_settings']['language'] = request.form["lang"]
+ LANG = current_app.config['CONFIG']['global_settings']['language']
+ set_language(LANG)
+ FORMLANG = request.form["lang"]
+ if "keyboard" in request.form.keys():
+ print(request.form["keyboard"])
+ if "timezone" in request.form.keys():
+ print(request.form["timezone"])
+ lang = current_app.config['CONFIG']['global_settings']['language']
blkid = lsblk.list_scsi_devices()
string_dict = build_stringlist()
- return render_template('welcome.html', string_dict=string_dict)
+ return render_template('welcome.html', string_dict=string_dict, selected_lang=lang)
def build_stringlist():
@@ -29,5 +49,12 @@ def build_stringlist():
string_dict['language_text'] = _("Language:")
string_dict['keylayout_text'] = _("Keyboard Layout:")
string_dict['timezone_text'] = _("Time Zone:")
+ lang_dict = {}
+ lang_dict['af'] = _("Afrikaans")
+ lang_dict['en'] = _("English (International)")
+ lang_dict['en-us'] = _("English (United States)")
+ lang_dict['en-uk'] = _("English (United Kingdom)")
+ lang_dict['en-za'] = _("English (South Africa)")
+ string_dict['lang_list'] = lang_dict
return string_dict
diff --git a/src/applets/welcome/welcome.html b/src/applets/welcome/welcome.html
index f1ac5ce..2653092 100644
--- a/src/applets/welcome/welcome.html
+++ b/src/applets/welcome/welcome.html
@@ -1,38 +1,43 @@
{% extends "layout.html" %}
{% block body %}
-
+
+
{{ string_dict['welcome_text'] }}
{{ string_dict['confirm_text'] }}
+
+
+
diff --git a/src/static/system-installer.css b/src/static/system-installer.css
deleted file mode 100644
index 69a3ff1..0000000
--- a/src/static/system-installer.css
+++ /dev/null
@@ -1,13 +0,0 @@
-body {
- display: flex;
- font-family: Noto Sans;
- min-width: 1150px;
- min-height: 600px;
- overflow: hidden;
-}
-
-
-html {
- /* Overwrite the white that is set by bulma.css */
- background-color: transparent;
-}
diff --git a/src/static/system-installer.css b/src/static/system-installer.css
new file mode 120000
index 0000000..6db37bc
--- /dev/null
+++ b/src/static/system-installer.css
@@ -0,0 +1 @@
+system-installer-dark.css
\ No newline at end of file
diff --git a/src/system-installer-daemon b/src/system-installer-daemon
index 5e14a43..2acdc35 100755
--- a/src/system-installer-daemon
+++ b/src/system-installer-daemon
@@ -9,24 +9,32 @@ from waitress import serve
import logging
import dmm.lsblk as lsblk
import importlib
+import yaml
# configuration
VERSION = "0.00"
-BABEL_TRANSLATION_DIRECTORIES="translations"
-BABEL_DOMAIN="translations"
SECRET_KEY = "exampls"
DEV_MODE = True
APPS = "main welcome users disks software summary"
+CONFIGFILE="templates/dmm-installer-template.yaml"
if DEV_MODE:
print("Note: Starting in devmode!")
DEBUG = True
tracebacks = True
+# import config
+global config
+config_contents = open(CONFIGFILE, "r")
+config = yaml.safe_load(config_contents)
+
+print(type(config))
+print(config)
+
# create our application in flask
app = Flask(__name__)
app.config.from_object(__name__)
-
+app.config['CONFIG'] = config
# Register blueprints here
for APP in APPS.split(" "):
diff --git a/src/system-installer-web-client b/src/system-installer-web-client
index 8f832a4..e772577 100755
--- a/src/system-installer-web-client
+++ b/src/system-installer-web-client
@@ -14,7 +14,7 @@ def on_closed():
window = webview.create_window('System Installer', LOCATION,
transparent=True, easy_drag=False, frameless=True,
width=1050, focus=True, zoomable=True,
- confirm_close=True)
+ confirm_close=True, resizable=True)
window.events.closed += on_closed
webview.start()
diff --git a/src/templates/header.html b/src/templates/header.html
index 0958aa4..abb84fc 100644
--- a/src/templates/header.html
+++ b/src/templates/header.html
@@ -1,14 +1,16 @@
-