From 2e8c285e87af04cc3c52621d6c6f1296d6b97b30 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 18 Oct 2024 12:22:23 +0200 Subject: [PATCH] Handle inspecting custom risks properly as well. --- src/euphorie/client/browser/risk.py | 2 +- .../templates/module_identification_custom.pt | 6 +- .../browser/templates/risk_actionplan.pt | 12 +++- .../templates/risk_identification_custom.pt | 64 ++++++++++++------- 4 files changed, 58 insertions(+), 26 deletions(-) diff --git a/src/euphorie/client/browser/risk.py b/src/euphorie/client/browser/risk.py index 76d79cd6b9..242c31b29f 100644 --- a/src/euphorie/client/browser/risk.py +++ b/src/euphorie/client/browser/risk.py @@ -1016,7 +1016,7 @@ def proceed_to_next(self, reply): url = f"{base_url}/{next_view_name}" return self.request.response.redirect(url) - elif _next == "add_custom_risk": + elif _next == "add_custom_risk" and self.webhelpers.can_edit_session: sql_module = ( Session.query(model.Module) .filter( diff --git a/src/euphorie/client/browser/templates/module_identification_custom.pt b/src/euphorie/client/browser/templates/module_identification_custom.pt index 1e0b0b6818..555506c391 100644 --- a/src/euphorie/client/browser/templates/module_identification_custom.pt +++ b/src/euphorie/client/browser/templates/module_identification_custom.pt @@ -27,7 +27,9 @@

Custom risks

-

+

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt @@ -37,9 +39,11 @@ action="${context/absolute_url}/@@identification" method="post" data-pat-inject="history: record; source: #content; target: #content; && source: #other-risks; target: #other-risks" + tal:condition="webhelpers/can_edit_session" >

+ > + Save and continue + + Next + +

diff --git a/src/euphorie/client/browser/templates/risk_identification_custom.pt b/src/euphorie/client/browser/templates/risk_identification_custom.pt index b747e174d3..b05a5ae731 100644 --- a/src/euphorie/client/browser/templates/risk_identification_custom.pt +++ b/src/euphorie/client/browser/templates/risk_identification_custom.pt @@ -34,6 +34,7 @@