diff --git a/src/applets/disks/disks.html b/src/applets/disks/disks.html index 387cb33..5af5b2f 100644 --- a/src/applets/disks/disks.html +++ b/src/applets/disks/disks.html @@ -10,10 +10,13 @@
-

Current layout:

+


Proposed layout:

-{% for disk in blockdevs["blockdevices"] %} + + + +
@@ -68,12 +90,12 @@ {{ disk['name'] }} ({{(disk['size']/1024000000)|round(0)|int }} GB) - Serial: {{ disk['serial'] }}
{% for child in disk['children'] %} - +

{{ child['name'] }} ({{ (child['size']/1024000000)|round(2) }} GiB)

-

/boot/efi - vfat +

{{ child['mountpoint'] }} + {{ child['fstype'] }}

diff --git a/src/applets/disks/disks_partition.html b/src/applets/disks/disks_partition.html index 5b575dd..2e77737 100644 --- a/src/applets/disks/disks_partition.html +++ b/src/applets/disks/disks_partition.html @@ -3,7 +3,7 @@ diff --git a/src/applets/software/routes.py b/src/applets/software/routes.py index 851dcc7..f40ef6f 100644 --- a/src/applets/software/routes.py +++ b/src/applets/software/routes.py @@ -15,17 +15,31 @@ def webui_software(): else: previous_step_url = menu[menu.index("software")-1] - sources_button = '  ' - blends_button = '  ' + sources_button = '  ' + blends_button = '  ' bottom_menu = sources_button + blends_button - + build_summary() return render_template('software.html', menu=current_app.config['CONFIG']['settings']['menu'], menu_order=current_app.config['CONFIG']['settings']['menu_order'].split(), previous_step = previous_step_url, next_step = next_step_url, - bottom_menu = bottom_menu) + bottom_menu = bottom_menu, + popcon=current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']) + + +@bp.route('/software/settings', methods=['GET', 'POST']) +def software_settings(): + """ + Receive settings for the software applet. + """ + if request.method == 'POST': + popcon = "popcon" in request.form + current_app.config['CONFIG']['recipe']['popcon']['enable_popcon'] = popcon + print(current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']) + build_summary() + return ('', 204) def build_menu(): @@ -36,5 +50,16 @@ def build_menu(): #current_app.config['CONFIG']['settings']['menu']['welcome'] = (build_stringlist()['menu_item'], "/welcome", 10) current_app.config['CONFIG']['settings']['menu']['software'] = ("Software", "/software", 40) -build_menu() +def build_summary(): + """ + Write up a summary of what this module will do. + """ + current_app.config['CONFIG']['Summary']['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']['text'] = "Participate in Popularity Contest: " + str(current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']) + "
No desktop environment selected." + return("ok?") + + +build_menu() diff --git a/src/applets/software/software.html b/src/applets/software/software.html index f01ab7e..663e68f 100644 --- a/src/applets/software/software.html +++ b/src/applets/software/software.html @@ -5,11 +5,23 @@
-
-

-Popularity Contest -

-

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.

Would you like to participate in popcon?

+

+ + +Popularity Contest + + +
+ +

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.


+ + +
diff --git a/src/applets/summary/routes.py b/src/applets/summary/routes.py index e905488..42237e9 100644 --- a/src/applets/summary/routes.py +++ b/src/applets/summary/routes.py @@ -14,13 +14,19 @@ def summary_index(): previous_step_url = menu[menu.index("summary")-1] next_step_url = "install" - print("previous step url: ", previous_step_url) + config = current_app.config['CONFIG'] + print (current_app.config['CONFIG']['Summary']) + html = (str(current_app.config['CONFIG']['Summary']['welcome']) + "
" + str(current_app.config['CONFIG']['Summary']['software'])) + summary = config['Summary'] return render_template('summary.html', menu=current_app.config['CONFIG']['settings']['menu'], menu_order=current_app.config['CONFIG']['settings']['menu_order'].split(), previous_step=previous_step_url, - next_step=next_step_url) + next_step=next_step_url, + config=config, + html=html, + summary=summary) def build_menu(): diff --git a/src/applets/summary/summary.html b/src/applets/summary/summary.html index 611e3d3..375f30e 100644 --- a/src/applets/summary/summary.html +++ b/src/applets/summary/summary.html @@ -3,7 +3,25 @@

Ready to install! Please review all changes.

-

This is the last chance to back out before committing to instal, please ensure all the details are correct.

+

This is the last chance to back out before committing to install, please ensure all the details are correct.

+ +
+ +{% for module in summary %} + +

{{ summary[module]['heading'] }}

+ + +{{ summary[module]['text']|safe }} + +

+ +{% endfor %} + +

+ +
diff --git a/src/applets/users/routes.py b/src/applets/users/routes.py index 1976ac4..e4b1f0d 100644 --- a/src/applets/users/routes.py +++ b/src/applets/users/routes.py @@ -10,7 +10,8 @@ def set_language(LANG): """ Sets language for this applet """ - translations = gettext.translation("users", './applets/users/locales', fallback=True, languages=[LANG]) + translations = gettext.translation("users", './applets/users/locales', + fallback=True, languages=[LANG]) translations.install() _ = translations.gettext @@ -32,18 +33,49 @@ def users_root(): else: previous_step_url = menu[menu.index("users")-1] - root_button = '  ' - ldap_button = '  ' - ad_button = '  ' - csv_button = '  ' + root_button = '  ' + ldap_button = '  ' + ad_button = '  ' + csv_button = '  ' bottom_menu = root_button + ldap_button + ad_button + csv_button + initial_user = current_app.config['CONFIG']['recipe']['users']['users'][0] + + build_summary() + return render_template('users.html', string_dict=string_dict, menu=current_app.config['CONFIG']['settings']['menu'], menu_order=current_app.config['CONFIG']['settings']['menu_order'].split(), previous_step=previous_step_url, next_step=next_step_url, - bottom_menu=bottom_menu) + bottom_menu=bottom_menu, + initial_user=initial_user) + + +@bp.route('/users/user-check/', methods=['GET', 'POST', 'PUT']) +def check_user(): + if request.method == 'POST': + print("Ok, so method is POST") + print("keys are: ", request.form.keys()) + username = request.form["username"] + 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]['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"]: + return('

That username is not available

') + else: + return('

That username is available

') + build_summary() + return("bleh") + def build_stringlist(): @@ -55,6 +87,7 @@ def build_stringlist(): 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_hint'] = _("One word, all lowercase") 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") @@ -73,4 +106,16 @@ def build_menu(): current_app.config['CONFIG']['settings']['menu']['users'] = (build_stringlist()['menu_item'], "/users", 20) print(current_app.config['CONFIG']['settings']['menu']) + +def build_summary(): + """ + Write up a summary of what this module will do. + """ + current_app.config['CONFIG']['Summary']['users'] = {} + current_app.config['CONFIG']['Summary']['users']['heading'] = "Users and Identity" + current_app.config['CONFIG']['Summary']['users']['bleh'] = current_app.config['CONFIG']['recipe']['popcon']['enable_popcon'] + current_app.config['CONFIG']['Summary']['users']['settings'] = current_app.config['CONFIG']['recipe']['users']['users'] + current_app.config['CONFIG']['Summary']['users']['text'] = "Add primary user with the username: " + str(current_app.config['CONFIG']['recipe']['users']['users'][0]['username']) + return("ok?") + build_menu() diff --git a/src/applets/users/users.html b/src/applets/users/users.html index b3522e4..c61bad4 100644 --- a/src/applets/users/users.html +++ b/src/applets/users/users.html @@ -5,45 +5,57 @@
+
+
-
+ +
+ + + +
- -
- + +
+ - - - - +
-

{{ string_dict['user_name_available'] }}

+

{{ string_dict['user_name_hint'] }}

-
- +
+ + + +
-
- +
+ + + +
+ +
diff --git a/src/applets/welcome/routes.py b/src/applets/welcome/routes.py index 6bca1cf..be3a200 100644 --- a/src/applets/welcome/routes.py +++ b/src/applets/welcome/routes.py @@ -11,7 +11,8 @@ def set_language(LANG): """ Sets language for this applet """ - translations = gettext.translation("welcome", './applets/welcome/locales', fallback=True, languages=[LANG]) + translations = gettext.translation("welcome", './applets/welcome/locales', + fallback=True, languages=[LANG]) translations.install() _ = translations.gettext @@ -33,10 +34,12 @@ def welcome_index(): print(request.form["keyboard"]) if "timezone" in request.form.keys(): print(request.form["timezone"]) + global lang lang = current_app.config['CONFIG']['settings']['language'] blkid = lsblk.list_scsi_devices() string_dict = build_stringlist() build_menu() + build_summary() menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ") next_step_url = menu[menu.index("welcome")+1] previous_step_url = menu[menu.index("welcome")-1] @@ -73,6 +76,7 @@ def build_stringlist(): string_dict['language_text'] = _("Language:") string_dict['keylayout_text'] = _("Keyboard Layout:") string_dict['timezone_text'] = _("Time Zone:") + string_dict['basicsettings_text'] = _("Basic Settings:") lang_dict = {} lang_dict['af'] = _("Afrikaans") lang_dict['en'] = _("English (International)") @@ -88,9 +92,21 @@ def build_menu(): """ current_app.config['CONFIG']['settings']['menu']['welcome'] = (build_stringlist()['menu_item'], "/welcome", 10) + +def build_summary(): + """ + Write up a summary of what this module will do. + """ + html = ("Basic settings

Language: " + lang + "

") + if not 'Summary' in current_app.config['CONFIG']: + current_app.config['CONFIG']['Summary'] = {} + current_app.config['CONFIG']['Summary']['welcome'] = {} + current_app.config['CONFIG']['Summary']['welcome']['heading'] = "Basic Settings" + print(current_app.config['CONFIG']['Summary']['welcome']) + text = "Language: " + str(current_app.config['CONFIG']['settings']['language']) + current_app.config['CONFIG']['Summary']['welcome']['text'] = text + return(html) + + set_language(current_app.config['CONFIG']['settings']['language']) build_menu - -#for app in current_app.config['CONFIG']['settings']['apps'].split(): - #print(app) - #current_app.config['CONFIG']['settings']['menu'][app] = (globals[app].build_stringlist()['menu_item'], "/" + app, 10) diff --git a/src/applets/welcome/welcome.html b/src/applets/welcome/welcome.html index 32730f9..59a095b 100644 --- a/src/applets/welcome/welcome.html +++ b/src/applets/welcome/welcome.html @@ -1,7 +1,9 @@ {% extends "layout.html" %} {% block body %} -Debian Image banner +Debian Image banner

{{ string_dict['welcome_text'] }}

{{ string_dict['confirm_text'] }}


@@ -9,7 +11,7 @@
- {{ string_dict['language_text'] }} + {{ string_dict['language_text'] }}