From bd6347cc41ddacaba26c80de4693c985256e7f16 Mon Sep 17 00:00:00 2001 From: Natalie Carey Date: Fri, 15 Sep 2023 19:13:52 +0100 Subject: [PATCH] Correcting cancel link. --- lib/manage-prototype-handlers.js | 3 +++ .../views/manage-prototype/plugin-install-or-uninstall.njk | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/manage-prototype-handlers.js b/lib/manage-prototype-handlers.js index 02a9f16ca0..267c5749d3 100644 --- a/lib/manage-prototype-handlers.js +++ b/lib/manage-prototype-handlers.js @@ -714,12 +714,14 @@ async function getPluginsModeHandler (req, res, next) { const pageName = `${verb.title} ${plugin.name}` let returnLink + let cancelLink = plugin?.links.pluginDetails if (req.query.returnTo === 'templates') { returnLink = { href: `${contextPath}/templates`, text: 'Back to templates' } + cancelLink = returnLink.href } else if (mode === 'uninstall') { returnLink = { href: `${contextPath}/plugins`, @@ -752,6 +754,7 @@ async function getPluginsModeHandler (req, res, next) { verb, isSameOrigin, returnLink, + cancelLink, relatedPlugins }) } diff --git a/lib/nunjucks/views/manage-prototype/plugin-install-or-uninstall.njk b/lib/nunjucks/views/manage-prototype/plugin-install-or-uninstall.njk index 715239243b..b3e61f9d65 100644 --- a/lib/nunjucks/views/manage-prototype/plugin-install-or-uninstall.njk +++ b/lib/nunjucks/views/manage-prototype/plugin-install-or-uninstall.njk @@ -59,7 +59,7 @@ attributes: { id: "plugin-action-button" } }) }} - Cancel {{ verb.para }} + Cancel {{ verb.para }} {% elseif not isSameOrigin %}