{% extends 'viewflow/base_module.html' %}
{% load i18n viewflow viewflow_frontend material_form material_frontend %}

{% block breadcrumbs_items %}
{% include 'viewflow/includes/breadcrumb_category.html' %}
<a href="{% flowurl activation.flow_class 'index' %}?{{ request|query_back }}">{{ activation.flow_class.process_title }}</a>
<a href="{% flowurl activation.process 'detail' %}?{{ request|query_back }}">#{{ activation.process.pk }}</a>
<a class="active" href="{% flowurl activation.task 'detail' %}?{{ request|query_back }}">{{ activation.flow_task }} / #{{ activation.task.pk }}</a>
{% endblock %}


{% block content %}
{% block left-panel %}
<div class="left-panel">
  {% block left-panel__top %}{% endblock %}
  <div class="card">
    <dmc-form>
      <form role="form" method="POST" enctype="multipart/form-data">
        <div class="card-content">
          <div class="card-title">
            {{ activation.task.summary|default:activation.task.flow_task }}
            <h6>{{ activation.process.summary }}</h6>
          </div>
          {% block task_form %}
          {% csrf_token %}
          {% form form=form %}{% endform %}
          {{ activation.management_form }}
          {% endblock %}
        </div>
        <div class="card-action">
          <div class="row">
            {% block task_actions %}
            <div class="col s3">
              <a class="btn btn-flat black-text" href="{% flowurl activation.task 'detail' %}?{{ request|query_back }}">{% trans 'Detail' %}</a>
            </div>
            <div class="col s9 right-align">
              <button type="submit" name="_continue" class="btn btn-flat">{% trans 'Done and continue on this process' %}</button>
              <button type="submit" name="_done" class="btn primary white-text">{% trans 'Done' %}</button>
            </div>
            {% endblock %}
          </div>
        </div>
      </form>
    </dmc-form>
  </div>
  {% block left-panel__bottom %}{% endblock %}
</div>
{% endblock %}
{% block right-panel %}
<div class="right-panel">
  {% include_process_data activation.process %}
</div>
{% endblock %}
{% endblock %}
