From d33aa42b76ac946c81f0b221b863d0947487ddb4 Mon Sep 17 00:00:00 2001
From: Andreas <andreasv@fsmpi.rwth-aachen.de>
Date: Fri, 16 Jun 2017 09:05:38 +0200
Subject: [PATCH] no longer showing the delete button for jobs that are
 finished

---
 templates/jobs_overview.html | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/templates/jobs_overview.html b/templates/jobs_overview.html
index 9cdd5e1..c9ab2ae 100644
--- a/templates/jobs_overview.html
+++ b/templates/jobs_overview.html
@@ -179,27 +179,29 @@
 								<td>
 									<ul class="list-inline" style="white-space: nowrap;">
 									{% if i.state == "failed" %}
-										<li>
-											<a class="btn btn-default" href="{{url_for('jobs_action', action='clear_failed', jobid=i.id, ref=request.url)}}" title="Löschen" style="background-color: red;">
-												<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
-											</a>
-										</li>
 										<li>
 											<a class="btn btn-default" href="{{url_for('jobs_action', action='retry_failed', jobid=i.id, ref=request.url)}}" title="Neustarten">
 												<span class="fa fa-refresh" aria-hidden="true"></span>
 											</a>
 										</li>
-									{% else %}
 										<li>
-											<a class="btn btn-default" href="{{url_for('jobs_action', action='delete', jobid=i.id, ref=request.url)}}" title="Löschen" style="background-color: red;">
+											<a class="btn btn-default" href="{{url_for('jobs_action', action='clear_failed', jobid=i.id, ref=request.url)}}" title="Löschen" style="background-color: red;">
 												<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
 											</a>
 										</li>
+									{% else %}
 										<li>
 											<a class="btn btn-default" href="{{url_for('jobs_action', action='copy', jobid=i.id, ref=request.url)}}" title="Kopie neu einreihen">
 												<span class="fa fa-refresh" aria-hidden="true"></span>
 											</a>
 										</li>
+										{% if i.state in ["failed", "ready"] %}
+											<li>
+												<a class="btn btn-default" href="{{url_for('jobs_action', action='delete', jobid=i.id, ref=request.url)}}" title="Löschen" style="background-color: red;">
+													<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
+												</a>
+											</li>
+										{% endif %}
 									{% endif %}
 									</ul>
 								</td>
-- 
GitLab