{% 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">{{ corpus_file.author }}: {{ corpus_file.title }} ({{ corpus_file.publishing_year }})</h1>
    </div>

    <div class="col s12">
      <form method="POST">
        {{ form.hidden_tag() }}
        <div class="card">
          <div class="card-content">
            <div class="row">
              <div class="col s12 m4">
                {{ wtf.render_field(form.author, material_icon='person') }}
              </div>
              <div class="col s12 m4">
                {{ wtf.render_field(form.title, material_icon='title') }}
              </div>
              <div class="col s12 m4">
                {{ wtf.render_field(form.publishing_year, material_icon='access_time') }}
              </div>
            </div>
          </div>
          <div class="card-action right-align">
            {{ wtf.render_field(form.submit, material_icon='send') }}
          </div>
        </div>
        <br>
        <ul class="collapsible hoverable">
          <li>
            <div class="collapsible-header"><i class="material-icons">edit</i>Edit additional metadata</div>
            <div class="collapsible-body">
              {% for field in form
                 if field.short_name not in ['author', 'csrf_token', 'publishing_year', 'submit', 'title'] %}
              {{ wtf.render_field(field, material_icon=field.label.text[0:1]) }}
              {% endfor %}
            </div>
          </li>
        </ul>
      </form>
    </div>
  </div>
</div>
{% endblock page_content %}
