From 1e9a7d22839601264d8b96c6365d820638979de7 Mon Sep 17 00:00:00 2001 From: nucleogenic Date: Thu, 22 Sep 2022 01:20:22 +0100 Subject: [PATCH] Move flattening of file type lists to template layer --- python/web/src/templates/index.html | 12 ++++++++++-- python/web/src/web.py | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/python/web/src/templates/index.html b/python/web/src/templates/index.html index 4eb43528..580d46d5 100644 --- a/python/web/src/templates/index.html +++ b/python/web/src/templates/index.html @@ -156,8 +156,16 @@
  • {{ _("Select a valid SCSI ID and LUN to attach to. Unless you know what you're doing, always use LUN 0.", url="https://en.wikipedia.org/wiki/Logical_unit_number") }}
  • {{ _("If RaSCSI was unable to detect the media type associated with the image, you get to choose the type from the dropdown.") }}
  • -
  • {{ _("Recognized image file types: %(valid_image_suffixes)s", valid_image_suffixes=valid_image_suffixes) }}
  • -
  • {{ _("Recognized archive file types: %(ARCHIVE_FILE_SUFFIXES)s", ARCHIVE_FILE_SUFFIXES=ARCHIVE_FILE_SUFFIXES) }}
  • +
  • + {{ _("Recognized image file types:") }} + {% set comma = joiner(", ") %} + {% for extension in valid_image_suffixes %}{{ comma() }}.{{ extension}}{% endfor %} +
  • +
  • + {{ _("Recognized archive file types:") }} + {% set comma = joiner(", ") %} + {% for extension in ARCHIVE_FILE_SUFFIXES %}{{ comma() }}.{{ extension}}{% endfor %} +
  • diff --git a/python/web/src/web.py b/python/web/src/web.py index 288113fb..41db5e2a 100644 --- a/python/web/src/web.py +++ b/python/web/src/web.py @@ -149,7 +149,7 @@ def index(): server_info["scmo"] ) - valid_image_suffixes = "." + ", .".join( + valid_image_suffixes = ( server_info["schd"] + server_info["scrm"] + server_info["scmo"] + @@ -198,7 +198,7 @@ def index(): username=username, auth_active=auth_active(AUTH_GROUP)["status"], PROPERTIES_SUFFIX=PROPERTIES_SUFFIX, - ARCHIVE_FILE_SUFFIXES="." + ", .".join(ARCHIVE_FILE_SUFFIXES), + ARCHIVE_FILE_SUFFIXES=ARCHIVE_FILE_SUFFIXES, REMOVABLE_DEVICE_TYPES=ractl_cmd.get_removable_device_types(), DISK_DEVICE_TYPES=ractl_cmd.get_disk_device_types(), PERIPHERAL_DEVICE_TYPES=ractl_cmd.get_peripheral_device_types(),