{% extends "base.html" %}
{% block title %}Confirm Import of backup information{% endblock %}
{% block body %}
  <h2>Datastore Admin: Import backup information</h2>
  {% if error %}
    <div class="ae-errorbox">{{error}}</div>
    <a href="{{ cancel_url|escape }}"><button>Back</button></a>
  {% else %}
    {% if not other_backup_info_files and not selected_backup_info_file %}
      <div class="ae-errorbox">No backup information files were found.</div>
      <a href="{{ cancel_url|escape }}"><button>Back</button></a>
    {% else %}
      <form action="{{base_path}}/{{form_target}}" method="post" style="width:39.39em;">
        <input type="hidden" name="xsrf_token" value="{{xsrf_token|escape}}">
        {% if not other_backup_info_files %}
          <b>Confirm import of:</b>
          <input type="hidden" name="gs_handle" value="{{selected_backup_info_file}}">{{selected_backup_info_file|escape}}
        {% else %}
          {% if selected_backup_info_file %}
            <b>Confirm import of:</b><br/>
            <input type="radio" name="gs_handle" value="{{selected_backup_info_file}}" checked>{{selected_backup_info_file|escape}}</br>
          {% else %}
            {% if backup_info_specified %}
              <b>Requested backup was not found, available backups:</b><br/>
            {% else %}
              <b>Select an available backup:</b><br/>
            {% endif %}
          {% endif %}
          {% for backup_info_file in other_backup_info_files %}
            <input type="radio" name="gs_handle" value="{{backup_info_file}}">{{backup_info_file|escape}}</br>
          {% endfor %}
        {% endif %}
        <input type="Submit" name="Import" value="Add to backup list">
        <input type="Submit" name="Restore" value="Restore from backup">
        <a href="{{ cancel_url|escape }}">Cancel</a>
      </form>
    {% endif %}
  {% endif %}
{% endblock %}

