<!-- Delete repo. -->
{% import 'macros.html' as macros %}
{% call macros.panel(title=_("Remove older"), class='default') %}
<div class="panel-body">
  <form data-async data-target="#keepdays-status" action="/api/remove-older/{{ repo_path }}/" method="POST" role="form">
  <div class="form-group">
    <label for="encoding" class="control-label">
        {% trans %}Keep history for:{% endtrans %}</label>
    <select class="form-control" name="keepdays">
      {% set remove_older_values = [
            (-1, _("Forever")),
            (1, _("1 day")),
            (2, _("2 days")),
            (3, _("3 days")),
            (4, _("4 days")),
            (5, _("5 days")),
            (6, _("6 days")),
            (7, _("1 week")),
            (14, _("2 weeks")),
            (21, _("3 weeks")),
            (30, _("1 month")),
            (60, _("2 months")),
            (90, _("3 months")),
            (120, _("4 months")),
            (150, _("5 months")),
            (180, _("6 months")),
            (210, _("7 months")),
            (240, _("8 months")),
            (270, _("9 months")),
            (300, _("10 months")),
            (330, _("11 months")),
            (365, _("1 year")),
            (730, _("2 years")),
            (1095, _("3 years")),
            (1460, _("4 years")),
            (1825, _("5 years")),
      ] %}
      {% for i in remove_older_values %}
      <option {{ attrib(value=i[0], selected=(keepdays == i[0])) }}>{{ i[1] }}</option>
      {% endfor %}
    </select>
  </div>
  <span class="help-block">
     {% trans %}You can parameterize the storage time of earlier versions for each repository. Changing this value may free up disk space.{% endtrans %}
  </span>
  <div>
     <button type="submit" class="btn btn-default">{% trans %}Save changes{% endtrans %}</button>
     <span id="keepdays-status"></span>
  </div>
  </form>
</div>
{% endcall %}

