{% extends "settings.html" %}
{% block title %}
<title>Configure {{tracker.owner}}/{{tracker.name}} &mdash; {{ cfg("sr.ht", "site-name") }}</title>
{% endblock %}
{% block settings %}
<div class="row">
  <div class="col-md-12">
    <form method="POST" action="{{url_for('settings.export_POST',
        owner=tracker.owner.canonical_name, name=tracker.name)}}">
      {{csrf_token()}}
      <h3>Export tracker dump</h3>
      <p>
        This tool will export a JSON dump which includes all data on this
        tracker.
      </p>
      <button type="submit" class="btn btn-primary">
        Export tracker data
        {{icon('caret-right')}}
      </button>
    </form>
    <form
      method="POST"
      action="{{url_for('settings.import_POST',
        owner=tracker.owner.canonical_name, name=tracker.name)}}"
      enctype="multipart/form-data"
    >
      {{csrf_token()}}
      <h3>Import tracker dump</h3>
      <p>
        This tool will re-import a gzipped JSON dump generated by the export
        tool on this or another todo.sr.ht instance.
      </p>
      <div class="form-group">
        <input
          type="file"
          name="dump"
          class="form-control {{valid.cls('dump')}}"
          required />
        {{valid.summary("dump")}}
      </div>
      <button type="submit" class="btn btn-primary">
        Import tracker data
        {{icon('caret-right')}}
      </button>
    </form>
  </div>
</div>
{% endblock %}
