{% extends "_base.html" %}
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="../processes">{% trans %}Processes{% endtrans %}</a>
/ <a href="./{{ data['id'] }}">{{ data['title'] }}</a>
{% endblock %}
{% block body %}
    <section id="process" itemscope itemtype="https://schema.org/WebAPI">
      <h2 itemprop="name">{{ data['title'] }}</h2>
      <div itemprop="description">{{data.description}}</div>
      <p itemprop="keywords">
          {% for kw in data['keywords'] %}
            <span class="badge text-bg-primary bg-primary">{{ kw }}</span>
          {% endfor %}
      </p>
      <meta itemprop="url" content="{{config.server.url}}/processes/{{data.id}}" />
      <div class="row">
        <div class="col-sm-12 col-md-12">
          <table class="table table-striped table-bordered">
            <caption>{% trans %}Inputs{% endtrans %}</caption>
            <thead>
            <tr>
              <th>{% trans %}Id{% endtrans %}</th>
              <th>{% trans %}Title{% endtrans %}</th>
              <th>{% trans %}Data Type{% endtrans %}</th>
              <th>{% trans %}Description{% endtrans %}</th>
            </tr>
            </thead>
            <tbody>
              {% for key, value in data['inputs'].items() %}
              <tr itemprop="parameter" itemscope>
                <td itemprop="id" data-label="ID">
                  {{ key }}
                </td>
                <td itemprop="name" data-label="Title">
                  {{ value.title|striptags|truncate }}
                </td>
                <td itemprop="name" data-label="Data Type">
                  {{ value.schema.type }}
                </td>
                <td itemprop="description" data-label="Description">
                  {{ value.description }}
                </td>
              </tr>
              {% endfor %}
            </tbody>
          </table>
        </div>
        <div class="col-sm-12 col-md-12">
          <table class="table table-striped table-bordered">
            <caption>{% trans %}Outputs{% endtrans %}</caption>
            <thead>
            <tr>
              <th>{% trans %}Id{% endtrans %}</th>
              <th>{% trans %}Title{% endtrans %}</th>
              <th>{% trans %}Description{% endtrans %}</th>
            </tr>
            </thead>
            <tbody>
              {% for key, value in data['outputs'].items() %}
              <tr itemprop="parameter" itemscope>
                <td itemprop="id" data-label="ID">{{ key }}</td>
                <td itemprop="name" data-label="Title">{{ value.title }}</td>
                <td itemprop="description" data-label="Description">
                  {{ value.description | striptags | truncate }}
                </td>
              </tr>
              {% endfor %}
            </tbody>
          </table>
          <h2>{% trans %}Execution modes{% endtrans %}</h2>
          <ul>
            {% if 'sync-execute' in data.jobControlOptions %}<li>{% trans %}Synchronous{% endtrans %}</li>{% endif %}
            {% if 'async-execute' in data.jobControlOptions %}<li>{% trans %}Asynchronous{% endtrans %}</li>{% endif %}
          </ul>
          <h2>{% trans %}Jobs{% endtrans %}</h2>
          <a title="Browse jobs" href="{{config.server.url}}/jobs">{% trans %}Browse jobs{% endtrans %}</a>
          <h2>{% trans %}Links{% endtrans %}</h2>
          <ul>
            {% for link in data['links'] %}
                <li>
                  <a title={{link.title}} type={{link.type}} rel={{link.rel}} href={{link.href}} hreflang={{link.hreflang}}>
                    {{ link['title'] }} ({{ link['type'] }})
                  </a>
                </li>
            {% endfor %}
          </ul>
        </div>
      </div>
    </section>

{% endblock %}
