From 23ffe7043f90f56d3dfc872056c523fcf034140a Mon Sep 17 00:00:00 2001
From: Alice <alice.poggioli@hotmail.fr>
Date: Sat, 12 Oct 2019 09:37:03 +0200
Subject: [PATCH] Little fix on redirection.

---
 src/includes/entrepreneur/resources/detail.pug |  2 +-
 src/includes/public/resources/list.pug         |  2 +-
 src/scripts/coopstarter.js                     | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug
index 9f54911f..3355c561 100644
--- a/src/includes/entrepreneur/resources/detail.pug
+++ b/src/includes/entrepreneur/resources/detail.pug
@@ -116,7 +116,7 @@ include ../../components/widgets
     widget-name='cs-display-property'
     label-detail=''
     widget-detail='sib-action'
-    action-detail='mentor-resource-detail'
+    action-detail='entrepreneur-resource-detail'
   )
 
 
diff --git a/src/includes/public/resources/list.pug b/src/includes/public/resources/list.pug
index c9863934..f25db5e5 100644
--- a/src/includes/public/resources/list.pug
+++ b/src/includes/public/resources/list.pug
@@ -414,7 +414,7 @@ container.block_list.flex.flex_espace
                     label-fields=''
                     multiple-fields
                     class="panel"
-                    next='entrepreneur-resource-detail'
+                    next='public-resource-detail'
 
                     paginate-by="5"
                 )
diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js
index 50d88c65..3774bc0f 100644
--- a/src/scripts/coopstarter.js
+++ b/src/scripts/coopstarter.js
@@ -66,19 +66,19 @@ function loadFile(event) {
 
 /**
  * Fill datas to a form.
- * @param {HTMLElment} detail - Element with the datas to retrieve.
+ * @param {HTMLElment} element - Element with the datas to retrieve.
  * @param {string} targetFormName - Id of the form to fill.
- * @param {string} inputName - Name of the input to fill.
+ * @param {string} inputName - Name of the input to fill in the form.
  */
-function linkDatasetToField(detail, targetFormName, inputName) {
+function linkDatasetToField(element, targetFormName, inputName) {
   let targetForm = document.getElementById(targetFormName);
   targetForm.addEventListener("populate", event => {
     let resourceField = targetForm.querySelector(`input[name="${inputName}"]`);
     if (resourceField) {
-      resourceField.value = JSON.stringify({ "@id": detail.dataset.src });
+      resourceField.value = JSON.stringify({ "@id": element.dataset.src });
       resourceField.setAttribute(
         "value",
-        JSON.stringify({ "@id": detail.dataset.src })
+        JSON.stringify({ "@id": element.dataset.src })
       );
     }
   });
-- 
GitLab