wcs/wcs/templates/wcs/backoffice/workflow.html

180 lines
5.5 KiB
HTML

{% extends "wcs/backoffice/base.html" %}
{% load i18n %}
{% block appbar-title %}{{ workflow.name }}{% endblock %}
{% block appbar-actions %}
{% if not workflow.is_readonly %}
<a rel="popup" href="edit">{% trans "change title" %}</a>
{% endif %}
{% endblock %}
{% block content %}
{{ view.last_modification_block|safe }}
<div class="splitcontent-left">
<div class="bo-block">
<h3>{% trans "Possible Status" %}</h3>
{% if not workflow.possible_status %}
<p>{% trans "There are not yet any status defined in this workflow." %}</p>
{% else %}
{% if workflow.is_readonly %}
<ul id="status-list" class="biglist">
{% else %}
<p class="hint">{% trans "Use drag and drop with the handles to reorder status." %}</p>
<ul id="status-list" class="biglist sortable">
{% endif %}
{% spaceless %}
{% for status in workflow.possible_status %}
<li class="biglistitem {% if status.get_visibility_restricted_roles %}hidden-status{% endif %}"
id="itemId_{{ status.id }}">
<a href="status/{{ status.id }}/" {% if status.colour %}style="border-color: #{{status.colour}}"{% endif %}
>{{ status.name }}</a></li>
{% endfor %}
{% endspaceless %}
</ul>
{% endif %}
</div>
</div>
<div class="splitcontent-right">
<div class="bo-block">
<h3>{% trans "Workflow Functions" %}
{% if not workflow.is_readonly %}
<span class="change">(<a rel="popup" href="functions/new">{% trans "add function" %}</a>)</span>
{% endif %}
</h3>
<ul id="roles-list" class="biglist">
{% for workflow_role in view.get_workflow_roles %}
<li class="biglistitem">
{% if not workflow.is_readonly %}
<a rel="popup" href="functions/{{ workflow_role.0|slice:"1:" }}">{{ workflow_role.1 }}</a>
{% else %}
<a>{{ workflow_role.1 }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% if not workflow.is_default %}
<div class="bo-block">
<h3>{% trans "Workflow Variables" %}
{% if not workflow.is_readonly %}
<span class="change">(<a rel="popup" href="variables/">{% trans "change" %}</a>)</span>
{% endif %}
</h3>
{% if workflow.variables_formdef %}
<ul class="biglist">
{% for field in workflow.variables_formdef.fields %}
{% if field.varname %}
<li><a href="variables/fields/{{ field.id }}">{{ field.label }}
{% if '*' not in field.varname %}
<code class="varname">{{ "{{" }} form_option_{{ field.varname }} }}</code>
{% endif %}
</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
<div class="bo-block">
<h3>{% trans "Global Actions" %}
{% if not workflow.is_readonly %}
<span class="change">(<a rel="popup" href="global-actions/new">{% trans "add global action" %}</a>)</span>
{% endif %}
</h3>
{% if workflow.is_readonly %}
<ul class="biglist">
{% else %}
<ul id="status-list" class="biglist sortable" data-order-function="update_actions_order">
{% endif %}
{% for action in workflow.global_actions %}
<li class="biglistitem" id="itemId_{{ action.id }}"><a href="global-actions/{{ action.id }}/">{{ action.name }}</a></li>
{% endfor %}
</ul>
</div>
<div class="bo-block">
<h3>{% trans "Criticality Levels" %}
{% if not workflow.is_readonly %}
<span class="change">(<a rel="popup" href="criticality-levels/new">{% trans "add criticality level" %}</a>)</span>
{% endif %}
</h3>
{% if workflow.is_readonly %}
<ul class="biglist">
{% else %}
<ul class="biglist sortable criticality-levels" data-order-function="update_criticality_levels_order">
{% endif %}
{% spaceless %}
{% for level in workflow.criticality_levels %}
<li class="biglistitem" id="itemId_{{ level.id }}"
{% if level.colour %}style="border-left-color: #{{ level.colour }}"{% endif %}>
<a rel="popup" href="criticality-levels/{{ level.id }}">{{ level.name }}</a>
</li>
{% endfor %}
{% endspaceless %}
</ul>
</div>
<div class="bo-block">
<h3>{% trans "Backoffice Fields" %}
{% if not workflow.is_readonly %}
<span class="change">(<a rel="popup" href="backoffice-fields/">{% trans "change" %}</a>)</span>
{% endif %}
</h3>
{% if workflow.backoffice_fields_formdef %}
<ul class="biglist">
{% for field in workflow.backoffice_fields_formdef.fields %}
{% if field.varname %}
<li><a href="backoffice_fields/fields/{{ field.id }}">{{ field.label }}
{% if field.varname %}
<code class="varname">{{ "{{" }} form_var_{{ field.varname }} }}</code>
{% endif %}
</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %} {# not workflow.is_default #}
</div>
<br style="clear:both;"/>
{% if workflow.possible_status %}
<div class="bo-block">
{{ view.graphviz|safe }}
<div class="full-screen-link"><a href="schema.svg">{% trans "Full Screen" %}</a></div>
</div>
{% endif %}
{% with formdefs=workflow.formdefs carddefs=workflow.carddefs %}
{% if formdefs or carddefs %}
<div class="section">
<h3>{% trans "Usage" %}</h3>
<div>
{% if formdefs %}
<p>{% trans "This workflow is used for the following forms:" %}
<ul class="objects-list single-links">
{% for formdef in formdefs %}
<li><a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% if carddefs %}
<p>{% trans "This workflow is used for the following card models:" %}
<ul class="objects-list single-links">
{% for carddef in carddefs %}
<li><a href="{{ carddef.get_admin_url }}">{{ carddef.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endif %}
{% endwith %}
{% endblock %}