{% extends 'layout_repo.html' %}
{% from 'include/panel.html' import panel %}
{% from 'include/modal_dialog.html' import modal_dialog, button_confirm, modal_confirm %}
{% set active_page='repo' %}
{% set active_repo_page='settings' %}
{% block title %}
  {% trans %}Settings{% endtrans %}
{% endblock %}
{% block content %}
  {% call panel(title=_("General Settings"), description=_('You can modify the backup repository settings to suit your requirements. These settings allow you to adjust the notification period, retention period, and display format (encoding) of the repository to align with your preferred frequency, data storage duration, and localization needs.'), class="default") %}
    <form method="post" action="{{ url_for() }}">
      {{ form }}
    </form>
  {% endcall %}
  <!-- Delete repo. -->
  {% call panel(title=_("Delete repository"), description=_('Deleting the repository will permanently delete all related resources including files, history, status etc.'), class="danger") %}
    <div class="panel-body">
      <span class=" font-weight-bold">{% trans %}Deleted repository cannot be restored!{% endtrans %}</span>
      <div>
        {{ button_confirm(label=_('Delete'), target="#delete-repo-modal", disabled=not is_maintainer, redirect=url_for('/'), url=url_for('delete', repo)) }}
      </div>
      {% if not is_maintainer %}
        <span class="form-text">{% trans %}Ask your administrator if you want to delete this repository.{% endtrans %}</span>
      {% endif %}
    </div>
  {% endcall %}
  <!-- Delete Repo Modal -->
  {{ modal_confirm(
  id="delete-repo-modal",
  title=_('Confirmation required'),
  message=_("You are about to permanently delete this repository. Deleted repository CANNOT be restored! Are you ABSOLUTELY sure?"),
  fields=['action'],
  submit=_('Delete'),
  confirm_value=repo.display_name) }}
{% endblock %}
