Commit 365e4ebf authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Fixes in the task cards alignment and delete redirect.

parent 2d8816d0
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
<div style="width:350px; display:block; border: #e0e0e0 solid 1px; margin:10px; background:#f8f8f8; margin-bottom:20px">
<div style="width:350px; float:left; border: #e0e0e0 solid 1px; margin:10px; background:#f8f8f8; margin-bottom:20px">
  {% if data.task %}
  <div style="margin-top:5px; padding:10px; text-align:center; border-bottom: #f8f8f8 solid 1px; ">
    <b>{{data.task.name}}</b>
@@ -33,7 +33,11 @@
    {% if task.status == "stopped" or task.status == "created" %}
    <a href="?uuid={{task.uuid}}&action=delete" class="btn btn-action">Delete</a>
    {% else %}
    <a href="?uuid={{task.uuid}}&action=stop&fromlist={{fromlist}}" class="btn btn-action">Stop</a>
    {% if data.task %}
    <a href="?uuid={{task.uuid}}&action=stop" class="btn btn-action">Stop</a>
    {% else  %}
    <a href="?uuid={{task.uuid}}&action=stop&fromlist=True" class="btn btn-action">Stop</a>
    {% endif %}
    {% endif %}
    <!-- Connect -->
    {% if task.interface_port %}
@@ -46,10 +50,10 @@
    {% endif %}
    {% endif %}
    <!-- View log -->
    {% if task.status == "running" %}
    <a href="/task_log/?uuid={{task.uuid}}&action=viewlog" class="btn btn-action">Logs</a>
    {% else %}
    {% if task.status == "created" or task.status == "submitted" %}
    <a href="" class="btn btn-disabled">Logs</a>
    {% else %}
    <a href="/task_log/?uuid={{task.uuid}}&action=viewlog" class="btn btn-action">Logs</a>
    {% endif %}
  </div>
</div>
+1 −3
Original line number Diff line number Diff line
@@ -555,8 +555,8 @@ def tasks(request):
            data['error'] = 'Error in deleting the task'
            logger.error('Error in deleting task with uuid="{}": "{}"'.format(uuid, e))
            return render(request, 'error.html', {'data': data})
        return redirect('/tasks/')

        return redirect('/tasks/')

    # Handle stop action
    elif action=='stop':
@@ -577,9 +577,7 @@ def tasks(request):
            data['error'] = 'Error in getting the task or performing the required action'
            logger.error('Error in getting the task with uuid="{}" or performing the required action: "{}"'.format(uuid, e))
            return render(request, 'error.html', {'data': data})
        return redirect('/tasks/?uuid={}'.format(task.uuid))

        # Redirect
        if fromlist:
            return redirect('/tasks')
        else: