Some more initial changes

This commit is contained in:
Jonathan Carter
2024-12-08 16:55:03 +02:00
parent a61cc67a34
commit 4bc89c5d2b
24 changed files with 53 additions and 117 deletions

View File

@@ -1,8 +1,12 @@
from applets.welcome import bp
from flask import Flask, request, session, redirect, \
url_for, render_template, flash, Blueprint
import gettext
import dmm.lsblk as lsblk
# Set up Gettext
en_i18n = gettext.translation("welcome", './locales', fallback=True, languages=['af', 'en'])
en_i18n.install()
@bp.route('/welcome',methods=['GET', 'POST', 'PUT'])
def welcome_index():
@@ -11,13 +15,19 @@ def welcome_index():
this app in a browser.
"""
blkid = lsblk.list_scsi_devices()
return render_template('welcome.html', blkid=blkid)
#return ("Welcome to System Installer Daemon POC <br />"
# "This is the Welcome Index")
string_dict = build_stringlist()
return render_template('welcome.html', string_dict=string_dict)
@bp.route('/welcome2')
def welcome2_index():
return ("Changins some text in our htmx front-end")
def build_stringlist():
"""
Return all the strings that is used in this applet."
"""
string_dict = {}
string_dict['welcome_text'] = _("Welcome! This setup program will install Debian on to your system.")
string_dict['confirm_text'] = _("Please confirm the following details:")
string_dict['language_text'] = _("Language:")
string_dict['keylayout_text'] = _("Keyboard Layout:")
string_dict['timezone_text'] = _("Time Zone:")
return string_dict