{% load lbworkflow_tags %}

{% for t in agree_transitions  %}
  <a class="{% if is_btn %}btn btn-primary{% endif %}" href="{{ t|app_url:task }}">{{ t.name }}</a>
  <span>|</span>
{% endfor %}
{% for t in other_transitions  %}
  <a class="{% if is_btn %}btn btn-primary{% endif %}" href="{{ t|app_url:task }}">{{ t.name }}</a>
  <span>|</span>
{% endfor %}
{% if task  %}
<a class="{% if is_btn %}btn btn-primary{% endif %}" href="{% url 'wf_add_assignee' %}?wi_id={{ task.pk }}">Add assignee</a>
<span>|</span>
{% endif %}
{% if can_reject  %}
  <a class="{% if is_btn %}btn btn-danger{% endif %}" href="{% url 'wf_reject' %}?wi_id={{ task.pk }}">Reject</a>
  <span>|</span>
{% endif %}
{% if can_back_to %}
  <a class="{% if is_btn %}btn btn-danger{% endif %}" href="{% url 'wf_back_to' %}?wi_id={{ task.pk }}">Back to</a>
  <span>|</span>
{% endif %}
{# TODO hold and add joint #}
{% comment %}
  {% if can_rollback %}
    <a class="{% if is_btn %}btn btn-default{% endif %}"
       href="{% url 'wf_rollback' %}?pk={{ process_instance.pk }}">
      Rollback
    </a>
    <span>|</span>
  {% endif %}
{% endcomment %}
{% if can_give_up %}
  <a class="{% if is_btn %}btn btn-default{% endif %}"
     href="{% url 'wf_give_up' %}?pk={{ process_instance.pk }}">Give up</a>
  <span>|</span>
{% endif %}

{% if not is_btn %}
  {% if can_edit %}
    <a class="{% if is_btn %}btn btn-default{% endif %}" class="with-next" href="{% url 'wf_edit' process_instance.pk %}">Edit</a>
    <span>|</span>
  {% endif %}
  {% if is_wf_admin %}
    <a class="{% if is_btn %}btn btn-danger{% endif %} btn-del" href="{% url 'wf_delete' %}?pk={{ process_instance.pk }}">Delete</a>
    <span>|</span>
  {% endif %}
{% endif %}
