{# Extends the base layout template #} {% extends "base.html" %} {# --- Page Title Block --- #} {% block title %}{{ super() }} - Configure Allowlist: {{ server_name }}{% endblock %} {# --- Head Scripts Block --- #} {# Include JavaScript files needed for this page #} {% block head_scripts %} {# Core utilities (showStatusMessage, sendServerActionRequest) #} {# install_config.js might contain toggle switch logic if not globally included #} {# #} {# Specific JS for allowlist actions (add/remove/refresh) #} {% endblock %} {# --- Main Content Block --- #} {% block content %} {# Main heading for the page #}

Configure Allowlist

{# Display server context and installation step if applicable #}

Server: {{ server_name }} {% if new_install %} {# Indicator for multi-step installation workflow #}
(Step 2 of 4 for New Installation) {% endif %}

{# --- Status Message Area --- #} {# Targeted by JavaScript (showStatusMessage) #}
{# Server-side flash messages (handled by base.html) #} {# {% with messages = get_flashed_messages(with_categories=true) %} ... {% endwith %} #} {# --- Section for Adding New Players --- #}
{# Added form-section class for potential common styling #}

Add Players

Enter player names (Gamertags), one per line, to add them to the allowlist.

{# Group for the textarea input #}
{# Optional: Placeholder for JS validation errors for this field #} {#
#}
{# Group for the 'Ignore Player Limit' toggle switch #} {# This setting applies to *all* players being added in this batch #}
Ignore Player Limit: Allow the player(s) being added to join even if the server is full?
{# The hidden checkbox that stores the state #} {# Defaults to unchecked (false) #} {# The clickable visual switch linked to the checkbox #}
{# Associated hidden input to ensure 'false' is sent when checkbox is unchecked #} {# JS in install_config.js should handle disabling this when checkbox is checked #} {# Optional: Placeholder for JS validation errors #} {#
#}
{# --- End Toggle Switch --- #} {# Actions for the 'Add Players' section #}
{# Align button to the right (or center based on theme) #} {# Button triggers the addAllowlistPlayers JS function #}
{# --- End of allowlist-add-section --- #} {# --- Section to Display Current Allowlist --- #}

Current Allowlist

{# This list is populated/updated by fetchAndUpdateAllowlistDisplay() in allowlist.js #}
{# --- End of current-allowlist-section --- #} {# --- Navigation Actions (Conditional) --- #} {% endblock %} {# --- Page-Specific JavaScript Block (at end of body) --- #} {% block body_scripts %} {# Example JavaScript for handling the 'Remove' button clicks #} {# IMPORTANT: This assumes a corresponding DELETE endpoint exists at /api/server//allowlist #} {# The endpoint should likely expect a body like {"players": ["PlayerNameToRemove"]} #} {% endblock %}