{# Extends the base layout template #} {% extends "base.html" %} {# --- Page Title Block --- #} {% block title %}{{ super() }} - Select Addon: {{ server_name }}{% endblock %} {# --- Head Scripts Block --- #} {# Include JavaScript files needed for addon installation actions #} {% block head_scripts %} {# content_management.js contains the triggerAddonInstall function #} {% endblock %} {# --- Main Content Block --- #} {% block content %} {# Main heading for the page #}

Select Addon to Install

{# Display server context #}

Server: {{ server_name }}

{# --- Status Message Area --- #} {# Targeted by JavaScript (showStatusMessage) #}
{# Server-side flash messages (handled by base.html) #} {# Section containing the addon selection list #}
{# Use list-section class #} {# Check if addon_files list (passed from route) is not empty #} {% if addon_files %}

Select an addon file (.mcaddon or .mcpack) to install to server '{{ server_name }}':

{# Responsive wrapper for the table #}
{# Use standard table styling #} {# Header for the filename #} {# Header for the button #} {# Loop through the list of full addon file paths #} {% for addon_file_path in addon_files %} {# Display only the filename part #} {# IMPORTANT: Assumes 'basename' filter is registered #} {# Cell containing the install button #} {% endfor %}
Available Addon FileAction
{{ addon_file_path | basename }} {# Button calls triggerAddonInstall JS function #}
{# --- End .table-responsive-wrapper --- #} {% else %} {# Message displayed if no addon files are found #} {# Use consistent styling class #}

No addon files (.mcaddon, .mcpack) found in the configured content/addons directory.

{% endif %} {# --- Navigation Link Back --- #} {# Always show the back button #}
{# --- End .select-addon-section --- #} {% endblock %} {# --- Optional Body Scripts Block --- #} {% block body_scripts %} {# No page-specific JS usually needed here, actions are in onclick #} {% endblock %}