<!-- bedrock_server_manager//web/templates/restore_menu.html -->
{# Extends the base layout template #}
{% extends "base.html" %}

{# --- Page Title Block --- #}
{% block title %}{{ super() }} - Restore Menu: {{ server_name }}{% endblock %}

{# --- Main Content Block --- #}
{% block content %}
    {# Main heading for the page #}
<h2>Restore Options</h2>

    {# Display the server context #}
<p style="margin-bottom: 15px;">Server: <strong>{{ server_name }}</strong></p>

    {# --- Status Message Area --- #}
    {# Targeted by JavaScript (showStatusMessage) #}
<div id="status-message-area" class="message-box" style="opacity: 0; transition: opacity 0.5s ease-out;">
    <!-- Status messages from restore actions will appear here -->
</div>

    {# Server-side flash messages (handled by base.html) #}

    {# Section containing the restore options #}
<section id="backup-restore-page" class="restore-menu-section" data-server-name="{{ server_name | e }}">
    <p>Choose a restore action:</p>

    {# Group for restore action buttons/forms #}
    <div class="button-group action-buttons-group" style="margin-bottom: 20px;">

        {# Button to navigate to World backup selection via JS #}
        <button type="button" id="select-world-backup-btn" class="action-button">Select World Backup...</button>

        {# Button to navigate to properties backup selection via JS #}
        <button type="button" id="select-properties-backup-btn" class="action-button">Select Properties Backup...</button>

        {# Button to navigate to allowlist backup selection via JS #}
        <button type="button" id="select-allowlist-backup-btn" class="action-button">Select Allowlist Backup...</button>

        {# Button to navigate to permissions backup selection via JS #}
        <button type="button" id="select-permissions-backup-btn" class="action-button">Select Permissions Backup...</button>

        {# Button to trigger Restore All API call directly via JavaScript #}
        <button type="button" id="restore-all-btn" class="action-button">
            Restore All (Latest)
        </button>

    </div> {# --- End .button-group --- #}

    {# Navigation Link Back #}
    <div class="navigation-link">
        {# Consistent class for back link #}
        <a href="{{ request.url_for('index') }}" class="action-link">
            {# Assuming 'index' is the name of the main dashboard route #}
            « Back to Dashboard
        </a>
    </div>

</section> {# --- End .restore-menu-section --- #}

{% endblock %}

{% block body_scripts %}
<script src="{{ request.url_for('static', path='js/backup_restore.js') }}" defer></script>
{% endblock %}