From 5a1d9029722ab313b1f8fc0e9a320f4cf13e69cd Mon Sep 17 00:00:00 2001 From: haribo Date: Tue, 21 Jun 2016 11:08:35 +0200 Subject: [PATCH] Date: 20/06/2016 By: Paul Carensac Version: 0.7.6 Colors + buttons submit on request list, and fixed a redirection bug in request building Issues (closed): https://projects.irap.omp.eu/issues/3838 Major current version (0.7): https://projects.irap.omp.eu/versions/117 --- README.md | 6 +++--- src/routine_manager/templates/routine_manager/edit_base.html | 2 +- src/routine_manager/templates/routine_manager/requests_list.html | 8 ++++++-- src/routine_manager/urls.py | 2 +- src/routine_manager/views.py | 12 ++++++++---- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index da94093..341c749 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,9 @@ CURRENT VERSION Date: 20/06/2016 By: Paul Carensac -Version: 0.7.5 -Durations are now printed in seconds, and saved in JD -Issues (closed): https://projects.irap.omp.eu/issues/3835 +Version: 0.7.6 +Colors + buttons submit on request list, and fixed a redirection bug in request building +Issues (closed): https://projects.irap.omp.eu/issues/3838 Major current version (0.7): https://projects.irap.omp.eu/versions/117 ROADMAP: https://projects.irap.omp.eu/projects/pyros/roadmap diff --git a/src/routine_manager/templates/routine_manager/edit_base.html b/src/routine_manager/templates/routine_manager/edit_base.html index 8a549ba..8eb2caf 100644 --- a/src/routine_manager/templates/routine_manager/edit_base.html +++ b/src/routine_manager/templates/routine_manager/edit_base.html @@ -34,7 +34,7 @@
{% if req.submitted == False %} {% if req.complete == True %} - Submit request for scheduling {% else %} Total sequences Executed sequences Cancelled sequences - Actions + Actions {% for row in requests %} - + {{ row.req.name }} {{ row.req.created }} {{ row.req.updated }} @@ -75,6 +75,10 @@ Edit {% endif %} View + {% if row.req.submitted == False and row.req.complete == True %} + Submit + {% endif %} Delete diff --git a/src/routine_manager/urls.py b/src/routine_manager/urls.py index b9a4cf2..a60dc0d 100644 --- a/src/routine_manager/urls.py +++ b/src/routine_manager/urls.py @@ -27,7 +27,7 @@ urlpatterns = [ url(r'^create_album/(?P\d+)$', views.create_album, name="create_album"), url(r'^create_plan/(?P\d+)$', views.create_plan, name="create_plan"), - url(r'^submit_request/(?P\d+)$', views.submit_request, name="submit_request"), + url(r'^submit_request/(?P\d+)/(?P[a-z_]{1,20})$', views.submit_request, name="submit_request"), url(r'^unsubmit_request/(?P\d+)$', views.unsubmit_request, name="unsubmit_request"), url(r'^export_request/(?P\d+)$', views.export_request, name="export_request"), diff --git a/src/routine_manager/views.py b/src/routine_manager/views.py index cd94546..28f3cf6 100644 --- a/src/routine_manager/views.py +++ b/src/routine_manager/views.py @@ -25,7 +25,7 @@ def requests_list(request, status=0, message=""): elif status == "1": success = True - # uncomment for alert filter + # TODO: uncomment for alert filter # requests_objs = Request.objects.filter(pyros_user=request.user.pyros_user).filter(is_alert=False).order_by("-updated") requests_objs = Request.objects.filter(pyros_user=request.user.pyros_user).order_by("-updated") @@ -250,6 +250,7 @@ def album_validate(request, alb_id): req = alb.sequence.request req_id = req.id seq_id = alb.sequence.id + action = "edit" return render(request, "routine_manager/view_album.html", locals()) @login_required @@ -365,7 +366,7 @@ def create_plan(request, alb_id): return redirect(action_plan, plan.id, "edit") @login_required -def submit_request(request, req_id): +def submit_request(request, req_id, redir): """ Submits a request and its sequences for scheduling """ @@ -387,10 +388,13 @@ def submit_request(request, req_id): seq.save() req.submitted = True req.save() - # only commented for tests + # TODO: only commented for tests # scheduler.tasks.scheduling.delay(first_schedule=True, alert=False) # TODO : changer le first_schedule ... message = "The request was submitted" - return redirect(action_request, req_id=req_id, action="view", status=1, message=message) + if redir == "action_request": + return redirect(action_request, req_id=req_id, action="view", status=1, message=message) + else: + return redirect(requests_list, status=1, message=message) @login_required def unsubmit_request(request, req_id): -- libgit2 0.21.2