{# Extends the base layout template #} {% extends "base.html" %} {# --- Page Title Block --- #} {% block title %}{{ super() }} - Select Backup to Restore: {{ server_name }}{% endblock %} {# --- Head Scripts Block --- #} {# Include JavaScript files needed for restore actions #} {% block head_scripts %} {# backup_restore.js contains the triggerRestore function #} {% endblock %} {# --- Main Content Block --- #} {% block content %} {# Main heading for the page #}

Select Backup to Restore

{# Display context: Server Name and Restore Type #}

Server: {{ server_name }}

Restore Type: {{ restore_type | title }}

{# Capitalize restore type #} {# --- Status Message Area --- #} {# Targeted by JavaScript (showStatusMessage) #}
{# Server-side flash messages (handled by base.html) #} {# Section containing the backup selection list #}
{# Use list-section for potential common styling #} {# Check if the backups list (passed from the route) is not empty #} {% if backups %}

Select one of the available backups below to restore. Warning: This will overwrite current data.

{# Wrap table for responsiveness #}
{# Use standard table styling #} {# Fixed width for action #} {# Loop through the list of backup file paths #} {% for backup_path in backups %} {# Display only the filename part using the basename filter #} {# IMPORTANT: Assumes 'basename' filter is registered in Flask Jinja env #} {# Center the button in the actions cell #} {% endfor %}
Backup File Action
{{ backup_path.name }} {# Button triggers the JS restore function #}
{# --- End .table-responsive-wrapper --- #} {% else %} {# Message displayed if the backups list is empty #} {# Use consistent styling with .no-servers-message or similar #}

{# Or use the table row version if preferred #} No backups found for server '{{ server_name }}' of type '{{ restore_type }}'.

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