{% extends "nopaque.html.j2" %}

{% block page_content %}
<div class="col s12" id="corpora">
  <h3>My Corpora</h3>
  <p>This service enables you to group your files into corpora. You can create as many as you want and edit them at all times.</p>
  <div class="card">
    <div class="card-content">
      <div class="input-field">
        <i class="material-icons prefix">search</i>
        <input id="search-corpus" class="search" type="search"></input>
        <label for="search-corpus">Search corpus</label>
      </div>
      <table>
        <thead>
          <tr>
            <th></th>
            <th>
              <span class="sort" data-sort="title">Title</span>
              <span class="sort" data-sort="description">Description</span>
            </th>
            <th><span class="sort" data-sort="status">Status</span></th>
            <th></th>
          </tr>
        </thead>
        <tbody class="list"></tbody>
      </table>
      <ul class="pagination"></ul>
    </div>
    <div class="card-action right-align">
      <a class="waves-effect waves-light btn" href="{{ url_for('corpora.add_corpus') }}">New corpus<i class="material-icons right">add</i></a>
    </div>
  </div>
</div>

<div class="col s12" id="jobs">
  <h3>My Jobs</h3>
  <p>A job is the execution of a service provided by nopaque. You can create any number of jobs and let them be processed simultaneously.</p>
  <div class="card">
    <div class="card-content">
      <div class="input-field">
        <i class="material-icons prefix">search</i>
        <input id="search-job" class="search" type="search"></input>
        <label for="search-job">Search job</label>
      </div>
      <table>
        <thead>
          <tr>
            <th><span class="sort" data-sort="service">Service</span></th>
            <th>
              <span class="sort" data-sort="title">Title</span>
              <span class="sort" data-sort="description">Description</span>
            </th>
            <th><span class="sort" data-sort="status">Status</span></th>
            <th></th>
          </tr>
        </thead>
        <tbody class="list"></tbody>
      </table>
      <ul class="pagination"></ul>
    </div>
    <div class="card-action right-align">
      <p><a class="modal-trigger waves-effect waves-light btn" href="#" data-target="new-job-modal"><i class="material-icons left">add</i>New job</a></p>
    </div>
  </div>
</div>

<div id="new-job-modal" class="modal">
  <div class="modal-content">
    <h4>Select a service</h4>
    <div class="row">
      <div class="col s12 m4">
        <a href="{{ url_for('services.service', service='setup_files') }}" style="color: rgba(0,0,0,0.87);">
          <div class="card-panel center-align hoverable">
            <i class="large material-icons" style="color: #ee6e73;">burst_mode</i>
            <p>File setup</p>
            <p class="light">Digital copies of text based research data (books, letters, etc.) often comprise various files and formats. nopaque converts and merges those files to facilitate further processing and the application of other services.</p>
          </div>
        </a>
      </div>
      <div class="col s12 m4">
        <a href="{{ url_for('services.service', service='ocr') }}" style="color: rgba(0,0,0,0.87);">
          <div class="card-panel center-align hoverable">
            <i class="large material-icons" style="color: #ee6e73;">find_in_page</i>
            <p>Optical Character Recognition</p>
            <p class="light">nopaque converts your image data – like photos or scans – into text data through a process called OCR. This step enables you to proceed with further computational analysis of your documents.</p>
          </div>
        </a>
      </div>
      <div class="col s12 m4">
        <a href="{{ url_for('services.service', service='nlp') }}" style="color: rgba(0,0,0,0.87);">
          <div class="card-panel center-align hoverable">
            <i class="large material-icons" style="color: #ee6e73;">format_textdirection_l_to_r</i>
            <p>Natural Language Processing</p>
            <p class="light">By means of computational linguistic data processing (tokenization, lemmatization, part-of-speech tagging and named-entity recognition) nopaque extracts additional information from your text.</p>
          </div>
        </a>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <a href="#!" class="modal-close waves-effect waves-light btn-flat">Close</a>
  </div>
</div>

<script>
  var corpusList = new RessourceList("corpora", nopaque.corporaSubscribers,
                                     "corpus");
  var jobList = new RessourceList("jobs", nopaque.jobsSubscribers, "job");
</script>
{% endblock %}
