diff --git a/atdb/atdb/settings/base.py b/atdb/atdb/settings/base.py index 080ef9e46e81495da3f8a5e2b6206f6f612cefb1..65c60282ab49cb6882064eb1c61c0b4507cd4ba2 100644 --- a/atdb/atdb/settings/base.py +++ b/atdb/atdb/settings/base.py @@ -44,7 +44,8 @@ INSTALLED_APPS = [ 'django_extensions', 'bootstrap_pagination', 'django_tables2', - 'bootstrap3' + 'bootstrap3', + 'fontawesome-free' ] MIDDLEWARE = [ diff --git a/atdb/requirements/base.txt b/atdb/requirements/base.txt index 30cbbb07cce63b0558a0a78a862fb32451a41f8d..c52d7065c7e389f671bdbd370b3da06d3a492a40 100644 --- a/atdb/requirements/base.txt +++ b/atdb/requirements/base.txt @@ -9,3 +9,4 @@ whitenoise==5.0.1 six==1.15.0 django-tables2==2.3.4 django-bootstrap3==14.2.0 +fontawesome-free==5.15.2 \ No newline at end of file diff --git a/atdb/taskdatabase/templates/taskdatabase/base.html b/atdb/taskdatabase/templates/taskdatabase/base.html index b15c3365d08413bd67cc339936732dde09cad8d1..913f2c681584b166466ec4bea3f8144141bd0a2c 100644 --- a/atdb/taskdatabase/templates/taskdatabase/base.html +++ b/atdb/taskdatabase/templates/taskdatabase/base.html @@ -1,6 +1,8 @@ <!DOCTYPE html> {% load static %} + + <html lang="en"> <head> @@ -13,14 +15,16 @@ <!-- loads the path to static files --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> - <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script> + <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> + <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script> <link rel="stylesheet" type="text/css" href="{% static 'taskdatabase/style.css' %}"/> <link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css" integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns" crossorigin="anonymous"> + <link href="{% static 'fontawesome_free/css/all.min.css' %}" rel="stylesheet" type="text/css"> + <link rel="icon" href="{% static 'favicon.ico' %}"> {% block extra_js %}{% endblock %} diff --git a/atdb/taskdatabase/templates/taskdatabase/filter_buttons.html b/atdb/taskdatabase/templates/taskdatabase/filter_buttons.html index b95ee0cdb8bdccb5648547bc0faa5104a70a3143..2207c0ae0442d9e03ef9ffc367be477a3011bad0 100644 --- a/atdb/taskdatabase/templates/taskdatabase/filter_buttons.html +++ b/atdb/taskdatabase/templates/taskdatabase/filter_buttons.html @@ -9,7 +9,6 @@ <a href="{% url 'task-set-filter' 'processing' %}" class="btn btn-secondary btn-sm" role="button">processing</a> <a href="{% url 'task-set-filter' 'processed' %}" class="btn btn-success btn-sm" role="button">processed</a> <a href="{% url 'task-set-filter' 'validated' %}" class="btn btn-primary btn-sm" role="button">validated</a> - <a href="{% url 'task-set-filter' 'scrub' %}" class="btn btn-secondary btn-sm" role="button">to scrub</a> <a href="{% url 'task-set-filter' 'scrubbing' %}" class="btn btn-secondary btn-sm" role="button">scrubbing</a> <a href="{% url 'task-set-filter' 'scrubbed' %}" class="btn btn-primary btn-sm" role="button">scrubbed</a> <a href="{% url 'task-set-filter' 'archiving' %}" class="btn btn-secondary btn-sm" role="button">archiving</a> diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index c563eba698e603f943b5c8283ff1b99d3ba9fc48..7e4b758bde910ffd0c19df7e784417b5d223eca4 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -5,11 +5,12 @@ <div class="container-fluid details-container"> - {% include 'taskdatabase/pagination.html' %} - + {% include 'taskdatabase/filter_buttons.html' %} + <div class="row"> <div class="col-sm-12 col-md-12 col-lg-12"> - {% include 'taskdatabase/filter_buttons.html' %} + {% include 'taskdatabase/pagination.html' %} + {% if my_tasks %} <div class="panel panel-success"> @@ -21,6 +22,7 @@ <tr> <th width="5%">ID</th> <th>Priority</th> + <th>Hold</th> <th>Status</th> <th>Project</th> <th>SAS_ID</th> @@ -47,7 +49,9 @@ {% include 'taskdatabase/pagination.html' %} </div> -<p class="footer"> Version 1.0.0 (2 mar 2021 - 15:00) +<p class="footer"> Version 1.0.0 (2 mar 2021 - 17:00) + + <script type="text/javascript"> (function(seconds) { var refresh, diff --git a/atdb/taskdatabase/templates/taskdatabase/tasks.html b/atdb/taskdatabase/templates/taskdatabase/tasks.html index 929f2fdbc9f817b654ab21071662932fefb02b6e..ffb307543aa8d6aeed0ab12ba439a29cc8da4c09 100644 --- a/atdb/taskdatabase/templates/taskdatabase/tasks.html +++ b/atdb/taskdatabase/templates/taskdatabase/tasks.html @@ -14,6 +14,19 @@ <a href="{% url 'task-change-priority' task.pk '10' my_tasks.number %}" class="btn btn-primary btn-sm" role="button">+10</a> </td> + + {% if task.resume %} + <td> + <a href="{% url 'task-hold-resume' task.pk 'hold' my_tasks.number %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-pause"></i> hold</a> + </td> + {% endif %} + + {% if not task.resume %} + <td> + <a href="{% url 'task-hold-resume' task.pk 'resume' my_tasks.number %}" class="btn btn-success btn-sm" role="button"><i class="fas fa-play"></i> resume</a> + </td> + {% endif %} + <td>{{ task.status }}</td> <td>{{ task.project }}</td> @@ -37,7 +50,6 @@ <a href="{% url 'task-setstatus-view' task.pk 'staged' my_tasks.number %}" class="btn btn-primary btn-sm" role="button">staged</a> <a href="{% url 'task-setstatus-view' task.pk 'processed' my_tasks.number %}" class="btn btn-primary btn-sm" role="button">processed</a> <a href="{% url 'task-setstatus-view' task.pk 'validated' my_tasks.number %}" class="btn btn-primary btn-sm" role="button">validated</a> - <a href="{% url 'task-setstatus-view' task.pk 'scrub' my_tasks.number %}" class="btn btn-warning btn-sm" role="button">scrub</a> <a href="{% url 'task-setstatus-view' task.pk 'scrubbed' my_tasks.number %}" class="btn btn-primary btn-sm" role="button">scrubbed</a> <a href="{% url 'task-setstatus-view' task.pk 'archived' my_tasks.number %}" class="btn btn-primary btn-sm" role="button">archived</a> <a href="{% url 'task-setstatus-view' task.pk 'finished' my_tasks.number %}" class="btn btn-primary btn-sm" role="button">finished</a> diff --git a/atdb/taskdatabase/urls.py b/atdb/taskdatabase/urls.py index 8cdce933fee8bab94b104bf0e01a4fbf51965764..47b18e2659a18ea3034fcb760ef825e0c3bef5b6 100644 --- a/atdb/taskdatabase/urls.py +++ b/atdb/taskdatabase/urls.py @@ -38,5 +38,5 @@ urlpatterns = [ path('tasks/<int:pk>/set_status/<new_status>/<page>', views.TaskSetStatusTables2, name = 'task-setstatus'), - path('tasks/<int:pk>/skip/<skip_it>/<page>', views.Skip, name='task-skip-view'), + path('tasks/<int:pk>/hold/<hold_it>/<page>', views.Hold, name='task-hold-resume'), ] \ No newline at end of file diff --git a/atdb/taskdatabase/views.py b/atdb/taskdatabase/views.py index 629c4cf6c5f0477862598f40133e479da4416614..189b978f8e6688e444cc132725cf98bf7ed5463e 100644 --- a/atdb/taskdatabase/views.py +++ b/atdb/taskdatabase/views.py @@ -285,10 +285,10 @@ class ConfigurationDetailsViewAPI(generics.RetrieveUpdateDestroyAPIView): # set task status to 'new_status' - called from the GUI -def Skip(request,pk,skip_it,page): +def Hold(request,pk,hold_it,page): model = Task task = Task.objects.get(pk=pk) - task.skip = (skip_it == 'true') + task.resume = (hold_it == 'resume') task.save() return redirect('/atdb/?page='+page)