Skip to content
Snippets Groups Projects
Commit 81f6ffb0 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

show join/joined tasks as separate workflow icons

parent 747c5aee
No related branches found
No related tags found
1 merge request!316Joined operations
Pipeline #54548 passed
......@@ -321,18 +321,21 @@ class Task(models.Model):
@property
def task_type_join(self):
# find out if this is a join/joined type of task, or just a regular task
if self.joined_output_task:
# this tasks has a designated output task, so it is an input task (join)
return 'join'
joined_input_tasks = self.joined_input_tasks.all()
if joined_input_tasks.count()>0:
# this task has input tasks, so it is an output task (joined)
return 'joined'
try:
# find out if this is a join/joined type of task, or just a regular task
if self.joined_output_task:
# this tasks has a designated output task, so it is an input task (join)
return 'join'
return 'regular'
joined_input_tasks = self.joined_input_tasks.all()
if joined_input_tasks.count()>0:
# this task has input tasks, so it is an output task (joined)
return 'joined'
return 'regular'
except:
# 'the show must go on', don't crash if anything goes wrong, just show it as 'regular'
return 'regular'
@property
def joined_status(self):
......
......@@ -30,23 +30,22 @@
href="{% url 'workflow-details' task.workflow.id %}"
data-popup-url="{% url 'workflow-details' task.workflow.id %}"
target="_blank"><i class="fas fa-project-diagram"></i> {{ task.workflow.id }}
</a></td>
</a></td>
{% endif %}
{% if task.task_type_join == 'joined' %}
<a class="open-modal btn btn-primary btn-sm"
href="{% url 'workflow-details' task.workflow.id %}"
data-popup-url="{% url 'workflow-details' task.workflow.id %}"
target="_blank"><i class="fas fa-diagram-successor"></i> {{ task.workflow.id }}
</a></td>
</a></td>
{% endif %}
{% if task.task_type_join == 'join' %}
<a class="open-modal btn btn-secondary btn-sm"
href="{% url 'workflow-details' task.workflow.id %}"
data-popup-url="{% url 'workflow-details' task.workflow.id %}"
target="_blank"><i class="fas fa-diagram-predecessor"></i> {{ task.workflow.id }}
</a></td>
</a></td>
{% endif %}
</td>
<td>
{% if user.is_authenticated %}
......
......@@ -18,11 +18,29 @@
</td></tr>
<tr class="{{ task.status }}"><td><b>status</b></td><td>{{ task.status }}</td></tr>
<tr><td><b>workflow</b></td><td>
{% if task.task_type_join == 'regular' %}
<a class="open-modal btn btn-primary btn-sm"
href="{% url 'workflow-details' task.workflow.id %}"
data-popup-url="{% url 'workflow-details' task.workflow.id %}"
target="_blank"><i class="fas fa-project-diagram"></i> {{ task.workflow }}
</a>
href="{% url 'workflow-details' task.workflow.id %}"
data-popup-url="{% url 'workflow-details' task.workflow.id %}"
target="_blank"><i class="fas fa-project-diagram"></i> {{ task.workflow }}
</a></td>
{% endif %}
{% if task.task_type_join == 'joined' %}
<a class="open-modal btn btn-primary btn-sm"
href="{% url 'workflow-details' task.workflow.id %}"
data-popup-url="{% url 'workflow-details' task.workflow.id %}"
target="_blank"><i class="fas fa-diagram-successor"></i> {{ task.workflow }}
</a></td>
{% endif %}
{% if task.task_type_join == 'join' %}
<a class="open-modal btn btn-secondary btn-sm"
href="{% url 'workflow-details' task.workflow.id %}"
data-popup-url="{% url 'workflow-details' task.workflow.id %}"
target="_blank"><i class="fas fa-diagram-predecessor"></i> {{ task.workflow }}
</a></td>
{% endif %}
{% if user.is_staff %}
<a href="/atdb/admin/taskdatabase/workflow/{{ task.workflow }}/change/" class="btn btn-secondary btn-sm" target="_blank" role="button"><i class="fas fa-cog"></i> Edit</a>&nbsp;</td></tr>
{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment