{# Extends the base layout template #} {% extends "base.html" %} {# --- Page Title Block --- #} {% block title %}{{ super() }} - Manage World: {{ server_name }}{% endblock %} {# --- Head Scripts Block --- #} {# Include JavaScript files needed for world installation/export actions #} {% block head_scripts %} {# content_management.js contains triggerWorldInstall AND triggerWorldExport #} {% endblock %} {# --- Main Content Block --- #} {% block content %} {# Main heading for the page #}

Manage World

{# Display server context #}

Server: {{ server_name }}

{# --- Status Message Area --- #} {# Targeted by JavaScript (showStatusMessage) #}
{# Server-side flash messages (handled by base.html) #} {# --- Current World Section --- #}
{# --- Export World Section --- #}
{# Added action-section class for consistency #}

Export Current World

Create a .mcworld from the server's current world.

{# --- Reset World Section --- #}
{# Added action-section class for consistency #}

Reset Current World

Deletes the server's current world.

{# End of sections-container #} {# --- Separator after BOTH sections --- #}
{# --- Import World Section --- #}
{# Use list-section class #}

Import World File

{# Added heading for clarity #} {# Check if world_files list (passed from route) is not empty #} {% if world_files %}

Select a world file (.mcworld) to import into server '{{ server_name }}'.
Warning: This will replace the server's current world data!

{# Responsive wrapper for the table #}
{# Use standard table styling #} {# Header for the filename #} {# Header for the button #} {# Loop through the list of full world file paths #} {% for world_file_path in world_files %} {# Display only the filename part #} {# IMPORTANT: Assumes 'basename' filter is registered in Flask Jinja env #} {# Cell containing the import button #} {% endfor %}
Available World FileAction
{{ world_file_path | basename }} {# Button calls triggerWorldInstall JS function #}
{# --- End .table-responsive-wrapper --- #} {% else %} {# Message displayed if no world files are found #} {# Use consistent styling class #}

{# Or use the table row version if preferred #} No world files (.mcworld) found in the configured content/worlds/ directory.

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