From 441065ddcdc163fda89a5c8d78c91fddb6e29a8c Mon Sep 17 00:00:00 2001
From: Alice <alice.poggioli@hotmail.fr>
Date: Wed, 30 Oct 2019 08:45:35 +0100
Subject: [PATCH 1/3] Include the iframe

---
 src/includes/components/widgets.pug            | 3 +++
 src/includes/entrepreneur/resources/detail.pug | 4 +++-
 src/includes/mentor/resources/create.pug       | 4 +++-
 src/includes/mentor/resources/detail.pug       | 3 ++-
 src/includes/public/resources/detail.pug       | 3 ++-
 5 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug
index c14c33f2..13a2168e 100644
--- a/src/includes/components/widgets.pug
+++ b/src/includes/components/widgets.pug
@@ -164,3 +164,6 @@ sib-widget(name="cs-form-file-custom" )
         sib-form-file(upload-url=`${sdn}upload/` name="preview_image")
 
 
+sib-widget(name="iframe-video-resource" )
+    template
+      div ${value}
\ No newline at end of file
diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug
index dbb6ea52..f8d40971 100644
--- a/src/includes/entrepreneur/resources/detail.pug
+++ b/src/includes/entrepreneur/resources/detail.pug
@@ -15,7 +15,7 @@ include ../../components/widgets
     fields='name, steps, format.name, \
             submitter_info(submitter.account.picture, submitter.name, \
             submitter.mentor_profile.organisation.name, skills, uri, broken),\
-            content(preview_image, tags),\
+            content(preview_image, iframe_link, tags),\
             description, review.reviewer.account.picture, review.reviewer.name,\
             copyright, specifications(\
             header_specifications, author, country.name, language.name,\
@@ -45,6 +45,8 @@ include ../../components/widgets
     widget-review.reviewer.name='cs-resource-reviewer'
     class-review.reviewer.name="validator_ressource"
     widget-header_specifications='cs-section_header'
+    widget-iframe_link='iframe-video-resource'
+
     
     label-broken='Report broken link'
     label-sharing='Access:'
diff --git a/src/includes/mentor/resources/create.pug b/src/includes/mentor/resources/create.pug
index b45c0ea5..aa22462e 100644
--- a/src/includes/mentor/resources/create.pug
+++ b/src/includes/mentor/resources/create.pug
@@ -43,7 +43,7 @@ p.p_entete Thank you for enriching our database !
         label-publication_year='Year of publication*'
         label-skills='Learning outcomes, skills*'
         label-description='Description'
-        label-iframe_link='For videos, report iframe link'
+        label-iframe_link='For videos, click on "share" and "integrate"'
         label-preview_image='Upload preview image'
         label-tags='Add tags'
         
@@ -80,6 +80,8 @@ p.p_entete Thank you for enriching our database !
         upload-url-preview_image=`${sdn}upload/`
         widget-preview_image='cs-form-file-custom'
         class-preview_image='input_photo w_25'
+        widget-iframe_link='sib-form-textarea'
+
 
         submit-button='Send for validation ->'
         next="resource-creation-confirmation"
diff --git a/src/includes/mentor/resources/detail.pug b/src/includes/mentor/resources/detail.pug
index cf20f6a7..bb9faa4c 100644
--- a/src/includes/mentor/resources/detail.pug
+++ b/src/includes/mentor/resources/detail.pug
@@ -15,7 +15,7 @@ include ../../components/widgets
     fields='name, steps, format.name,\
             submitter_info(submitter.account.picture, submitter.name, \
             submitter.mentor_profile.organisation.name, skills, uri, broken),\
-            content(preview_image, tags),\
+            content(preview_image, iframe_link, tags),\
             description, review.reviewer.account.picture, review.reviewer.name,\
             copyright, specifications(\
             header_specifications, author, country, language.name,\
@@ -53,6 +53,7 @@ include ../../components/widgets
     label-publication_year='Year of publication:'
     label-header_specifications='Resource specifications'
     label-format.name=''
+    widget-iframe_link='iframe-video-resource'
     
     widget-steps='cs-display-step-property'
     label-steps=''
diff --git a/src/includes/public/resources/detail.pug b/src/includes/public/resources/detail.pug
index 84d387e0..07774f79 100644
--- a/src/includes/public/resources/detail.pug
+++ b/src/includes/public/resources/detail.pug
@@ -16,7 +16,7 @@ include ../../components/widgets
     fields='name, steps, format.name,\
             submitter_info(submitter.account.picture, submitter.name, \
             submitter.mentor_profile.organisation.name, skills, uri, broken),\
-            content(preview_image, tags),\
+            content(preview_image, iframe_link, tags),\
             description, review.reviewer.account.picture, review.reviewer.name,\
             copyright, specifications(\
             header_specifications, author, country.name, language.name,\
@@ -46,6 +46,7 @@ include ../../components/widgets
     widget-review.reviewer.name='cs-resource-reviewer'
     class-review.reviewer.name="validator_ressource"
     widget-header_specifications='cs-section_header'
+    widget-iframe_link='iframe-video-resource'
     
     label-broken='Report broken link'
     label-sharing='Access:'
-- 
GitLab


From cdff68c167426ff2091e08b884b67a8193263ca2 Mon Sep 17 00:00:00 2001
From: Benoit Alessandroni <benoit@happy-dev.fr>
Date: Sat, 23 Nov 2019 17:29:58 +0100
Subject: [PATCH 2/3] Adding proper widget to resource edition

---
 src/includes/mentor/resources/edit.pug | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/includes/mentor/resources/edit.pug b/src/includes/mentor/resources/edit.pug
index 739e6cd3..544cebfa 100644
--- a/src/includes/mentor/resources/edit.pug
+++ b/src/includes/mentor/resources/edit.pug
@@ -18,6 +18,7 @@ p.p_entete=`${data.ThankYouEnrichingDatabase}`
         widget-header_classification='cs-section_header'
         widget-header_access='cs-section_header'
         widget-header_related='cs-section_header'
+        widget-iframe_link='sib-form-textarea'
 
         range-type=`${endpoints.types}`
         range-format=`${endpoints.formats}`
-- 
GitLab


From 22c22e6a4f85bb1dc851ed5c36a56b867e2aec34 Mon Sep 17 00:00:00 2001
From: Benoit Alessandroni <benoit@happy-dev.fr>
Date: Sat, 23 Nov 2019 17:36:11 +0100
Subject: [PATCH 3/3] Removing multiple useless includes of my widgets list

---
 src/includes/entrepreneur/profile/create.pug                 | 2 --
 src/includes/entrepreneur/profile/detail.pug                 | 2 --
 src/includes/entrepreneur/profile/edit.pug                   | 2 --
 src/includes/entrepreneur/resources/detail.pug               | 2 --
 src/includes/entrepreneur/resources/list.pug                 | 2 --
 src/includes/mentor/browseDatabase.pug                       | 3 ---
 src/includes/mentor/profile/create.pug                       | 2 --
 src/includes/mentor/profile/detail.pug                       | 2 --
 src/includes/mentor/profile/edit.pug                         | 2 --
 src/includes/mentor/resources/confirmation-status-change.pug | 2 --
 src/includes/mentor/resources/create.pug                     | 2 --
 src/includes/mentor/resources/detail.pug                     | 2 --
 src/includes/mentor/resources/edit.pug                       | 2 --
 src/includes/mentor/resources/list.pug                       | 2 --
 src/includes/mentor/resources/validate.pug                   | 2 --
 src/includes/public/resources/detail.pug                     | 2 --
 src/includes/public/resources/list.pug                       | 2 --
 src/index.pug                                                | 2 ++
 18 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/src/includes/entrepreneur/profile/create.pug b/src/includes/entrepreneur/profile/create.pug
index 98ad2e04..cdff639b 100644
--- a/src/includes/entrepreneur/profile/create.pug
+++ b/src/includes/entrepreneur/profile/create.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 figure.logo
     img(src="../images/logo.png" 
         alt="Coopstarter")
diff --git a/src/includes/entrepreneur/profile/detail.pug b/src/includes/entrepreneur/profile/detail.pug
index dd7f8e29..3d5d8315 100644
--- a/src/includes/entrepreneur/profile/detail.pug
+++ b/src/includes/entrepreneur/profile/detail.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 div.container_min
     h2.title_lead.fd_bleu=`${data.MyAccount}`
 
diff --git a/src/includes/entrepreneur/profile/edit.pug b/src/includes/entrepreneur/profile/edit.pug
index 0c43b55a..922f7f09 100644
--- a/src/includes/entrepreneur/profile/edit.pug
+++ b/src/includes/entrepreneur/profile/edit.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 h2.title_create= data.EditYourAccount
 
 sib-form#entrepreneur_profile_edition.block_log.block_creat_count(
diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug
index 7fe40da8..0a95c029 100644
--- a/src/includes/entrepreneur/resources/detail.pug
+++ b/src/includes/entrepreneur/resources/detail.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 .block_log.block_creat_count.no_shadow
   sib-link(class="backlink", next="entrepreneur-resource-list")
     .like
diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug
index f24fb4d1..8e036f6e 100644
--- a/src/includes/entrepreneur/resources/list.pug
+++ b/src/includes/entrepreneur/resources/list.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 sib-router
     sib-route( name='resource-report-broken-link-entrepreneur', use-id)
 
diff --git a/src/includes/mentor/browseDatabase.pug b/src/includes/mentor/browseDatabase.pug
index 231cf226..aa33150f 100644
--- a/src/includes/mentor/browseDatabase.pug
+++ b/src/includes/mentor/browseDatabase.pug
@@ -1,6 +1,3 @@
-include ../components/widgets
-
-
 div.container_min
         h2.title_lead.fd_bleu=`${data.generalLabel}`
         button.button_dark.pull-right= `${data.WatchThePresentation}`
diff --git a/src/includes/mentor/profile/create.pug b/src/includes/mentor/profile/create.pug
index 92c27f8f..10b390d8 100644
--- a/src/includes/mentor/profile/create.pug
+++ b/src/includes/mentor/profile/create.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 figure.logo
     img(src="../images/logo.png" 
         alt="Coopstarter")
diff --git a/src/includes/mentor/profile/detail.pug b/src/includes/mentor/profile/detail.pug
index 9ed918d6..f7b1c300 100644
--- a/src/includes/mentor/profile/detail.pug
+++ b/src/includes/mentor/profile/detail.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 div.container_min
     h2.title_lead.fd_bleu=`${data.MyAccount}`
 
diff --git a/src/includes/mentor/profile/edit.pug b/src/includes/mentor/profile/edit.pug
index 41e72b20..80fee452 100644
--- a/src/includes/mentor/profile/edit.pug
+++ b/src/includes/mentor/profile/edit.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 h2.title_create= data.EditYourAccount
 
 sib-form#mentor_profile_edition.block_log.block_creat_count(
diff --git a/src/includes/mentor/resources/confirmation-status-change.pug b/src/includes/mentor/resources/confirmation-status-change.pug
index 27d35a14..eccc4c4a 100644
--- a/src/includes/mentor/resources/confirmation-status-change.pug
+++ b/src/includes/mentor/resources/confirmation-status-change.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 .block_log.block_creat_count.no_shadow
     sib-link(class="backlink", next="mentor-resource-list")
         .like
diff --git a/src/includes/mentor/resources/create.pug b/src/includes/mentor/resources/create.pug
index 50982cdb..be06ba6e 100644
--- a/src/includes/mentor/resources/create.pug
+++ b/src/includes/mentor/resources/create.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 h2.title_lead_avenir=`${data.PostResource}`
 
 p.p_entete=`${data.ThankYouEnrichingDatabase}`
diff --git a/src/includes/mentor/resources/detail.pug b/src/includes/mentor/resources/detail.pug
index 5c638308..92e150a7 100644
--- a/src/includes/mentor/resources/detail.pug
+++ b/src/includes/mentor/resources/detail.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 .block_log.block_creat_count.no_shadow
   sib-link(class="backlink", next="mentor-resource-list")
     .like
diff --git a/src/includes/mentor/resources/edit.pug b/src/includes/mentor/resources/edit.pug
index 544cebfa..7937469a 100644
--- a/src/includes/mentor/resources/edit.pug
+++ b/src/includes/mentor/resources/edit.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 h2.title_lead_avenir=`${data.EditResource}`
 
 p.p_entete=`${data.ThankYouEnrichingDatabase}`
diff --git a/src/includes/mentor/resources/list.pug b/src/includes/mentor/resources/list.pug
index 1129599b..f3727fe1 100644
--- a/src/includes/mentor/resources/list.pug
+++ b/src/includes/mentor/resources/list.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 sib-router
     sib-route( name='confirm_suppress', use-id)
     sib-route( name='resource-report-broken-link-mentor', use-id)
diff --git a/src/includes/mentor/resources/validate.pug b/src/includes/mentor/resources/validate.pug
index 92c8d511..294fedb7 100644
--- a/src/includes/mentor/resources/validate.pug
+++ b/src/includes/mentor/resources/validate.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 sib-router
   sib-route(name='improvement-dialog')
   sib-route(name='refusal-dialog')
diff --git a/src/includes/public/resources/detail.pug b/src/includes/public/resources/detail.pug
index 596fcb99..648f0ee1 100644
--- a/src/includes/public/resources/detail.pug
+++ b/src/includes/public/resources/detail.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 .block_log.block_creat_count.no_shadow
   sib-link(class="backlink", next="public-resource-list")
     .like
diff --git a/src/includes/public/resources/list.pug b/src/includes/public/resources/list.pug
index d0d8e49c..f69ae98d 100644
--- a/src/includes/public/resources/list.pug
+++ b/src/includes/public/resources/list.pug
@@ -1,5 +1,3 @@
-include ../../components/widgets
-
 sib-router
     sib-route( name='resource-report-broken-link-public', use-id)
 
diff --git a/src/index.pug b/src/index.pug
index fa56f892..bf405d0d 100644
--- a/src/index.pug
+++ b/src/index.pug
@@ -9,6 +9,8 @@ html
         sib-route(name='entrepreneur-dashboard')
         sib-route(name='public-dashboard')
 
+    include includes/components/widgets.pug
+
     body
         #mentor-dashboard(hidden).no-sidebar
             include includes/mentor/dashboard.pug
-- 
GitLab