{% extends "base_form.html" %}

{% load static %}

{% block nav_sel_node %}id-nav-mywf{% endblock %}

{% block right_side_content_top %}
  {% if object %}
    <div class="nav-tabs-custom">
      <ul class="nav nav-tabs" role="tablist" id="id-m-nav-tabs">
        <li class="active">
          <a href="##id-tb-base" role="tab" data-toggle="tab">Base Information</a>
        </li>
        {% block right_side_tab_nav_ext %}
        {% endblock %}
        <li>
          <a href="#id-tb-wf-log" role="tab" data-toggle="tab">Operate history</a>
        </li>
      </ul>
      <div class="tab-content">
        <div class="tab-pane active" id="id-tb-base">
          {% block right_side_tab_base_ctx %}
            {% include "lbworkflow/inc_wf_status.html" %}
          {% endblock %}
        </div>
        {% block right_side_tab_ctx_ext %}
        {% endblock %}
        <div class="tab-pane" id="id-tb-wf-log">
          <a href="{% url 'wf_process_flowchart' process.code %}" target="_blank">Flow Chart</a>
          {% include "lbworkflow/inc_wf_history.html" %}
        </div>
      </div>
    </div>
  {% endif %}
{% endblock %}

{% block right_side_header %}
  <div class="right-btns">
    {% if wf_code %}
      <a target="_black" href="{% url 'wf_process_flowchart' wf_code %}">Flowchart</a>
    {% endif %}
  </div>
  <h1>
    <a href="{% url 'wf_my_wf' %}">My workflow</a>
    &gt;
    {% if object %}
      {{ object }}
    {% else %}
      {{ process.name }}
    {% endif %}
  </h1>
{% endblock %}

{% block form_act_btns %}
  {% if not process_instance.cur_node.is_submitted %}
    <input type="submit" class="btn btn-primary" name="act_submit" value="Submit"/>
  {% endif %}
  <button type="submit" class="btn btn-default" name="act_save">Save</button>
  <button type="button" class="btn btn-default goback" name="act_cancel">Cancel</button>
{% endblock %}

{% block footer_ext %}
  <link href="{% static 'flatpickr/dist/flatpickr.min.css' %}" rel="stylesheet" type="text/css" />
  {{ block.super }}
  <script src="{% static 'blueimp-file-upload/js/vendor/jquery.ui.widget.js' %}"></script>
  <script src="{% static 'blueimp-file-upload/js/jquery.fileupload.js' %}"></script>
  <script src="{% static 'blueimp-file-upload/js/jquery.iframe-transport.js' %}"></script>
  <script src="{% static 'flatpickr/dist/flatpickr.min.js' %}"></script>
{% endblock %}
