Move flattening of file type lists to template layer

This commit is contained in:
nucleogenic 2022-09-22 01:20:22 +01:00
parent 4ef2e20b4f
commit 1e9a7d2283
No known key found for this signature in database
GPG Key ID: 04A5E4E319C4271D
2 changed files with 12 additions and 4 deletions

View File

@ -156,8 +156,16 @@
<li>{{ _("Select a valid SCSI ID and <a href=\"%(url)s\">LUN</a> to attach to. Unless you know what you're doing, always use LUN 0.", url="https://en.wikipedia.org/wiki/Logical_unit_number") }}
</li>
<li>{{ _("If RaSCSI was unable to detect the media type associated with the image, you get to choose the type from the dropdown.") }}</li>
<li>{{ _("Recognized image file types: %(valid_image_suffixes)s", valid_image_suffixes=valid_image_suffixes) }}</li>
<li>{{ _("Recognized archive file types: %(ARCHIVE_FILE_SUFFIXES)s", ARCHIVE_FILE_SUFFIXES=ARCHIVE_FILE_SUFFIXES) }}</li>
<li>
{{ _("Recognized image file types:") }}
{% set comma = joiner(", ") %}
{% for extension in valid_image_suffixes %}{{ comma() }}.{{ extension}}{% endfor %}
</li>
<li>
{{ _("Recognized archive file types:") }}
{% set comma = joiner(", ") %}
{% for extension in ARCHIVE_FILE_SUFFIXES %}{{ comma() }}.{{ extension}}{% endfor %}
</li>
</ul>
</details>

View File

@ -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(),