{% extends "base.html" %}

{% block title %}Import codebook | Taguette{% endblock %}

{% block contents %}
<h1>Import a codebook</h1>
<p>Use this form to import an existing codebook into your project. Existing tags will not be deleted, new tags will be added alongside them.</p>
{% if error %}
<div class="alert alert-danger">{{ error }}</div>
{% endif %}
<form action="{{ reverse_url('import_codebook', project.id) }}" method="post" enctype='multipart/form-data'>
  {{ xsrf_form_html() }}
  <div class="form-group row">
    <label class="col-sm-2 col-form-label">{% trans %}Project:{% endtrans %}</label>
    <div class="col-sm-10">
      <span class="form-control" style="font-family: monospace, monospace;">{{ project.name }}</span>
    </div>
  </div>
  <div class="form-group row">
    <label for="file" class="col-sm-2 col-form-label">{% trans %}File:{% endtrans %}</label>
    <div class="col-sm-10">
      <input type="file" class="form-control-file" name="file" id="file" accept="text/csv,.csv" />
      <small>{% trans %}Accepted format: CSV{% endtrans %}</small>
    </div>
  </div>
  <div class="form-group row">
    <div class="col-sm-10 offset-sm-2">
      <input type="submit" class="btn btn-primary" value="{% trans %}Review{% endtrans %}" />
      <a href="{{ reverse_url('project', project.id) }}" class="btn btn-secondary">{% trans %}Go back{% endtrans %}</a>
    </div>
  </div>
</form>
{% endblock %}
