{% extends "base.html.j2" %}
{% import "materialize/wtf.html.j2" as wtf %}

{% block main_attribs %} class="service-scheme" data-service="corpus-analysis"{% endblock main_attribs %}

{% block page_content %}
<div class="container">
  <div class="row">
    <div class="col s12">
      <h1 id="title">{{ title }}</h1>
    </div>

    <div class="col s12 m4">
      <p>Fill out the following form to import a corpus.</p>
      <a class="waves-effect waves-light btn" href="{{ url_for('main.dashboard') }}"><i class="material-icons left">arrow_back</i>Back to dashboard</a>
    </div>

    <div class="col s12 m8">
      <form class="nopaque-upload-form" data-progress-modal="progress-modal">
        <div class="card">
          <div class="card-content">
            {{ form.hidden_tag() }}
            <div class="row">
              <div class="col s12 m4">
                {{ wtf.render_field(form.title, material_icon='title') }}
              </div>
              <div class="col s12 m8">
                {{ wtf.render_field(form.description, material_icon='description') }}
              </div>
            </div>
            <div class="row">
              <div class="col s12">
                {{ wtf.render_field(form.archive, accept='.zip', placeholder='Choose an exported ZIP archive') }}
              </div>
            </div>
          </div>
          <div class="card-action right-align">
            {{ wtf.render_field(form.submit, material_icon='send') }}
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
{% endblock page_content %}

{% block modals %}
{{ super() }}
<div id="progress-modal" class="modal">
  <div class="modal-content">
    <h4><i class="material-icons prefix">file_upload</i> Uploading file...</h4>
    <div class="progress">
      <div class="determinate" style="width: 0%"></div>
    </div>
  </div>
  <div class="modal-footer">
    <a href="#!" class="modal-close waves-effect waves-light btn red abort-request">Cancel</a>
  </div>
</div>
{% endblock modals %}
