From 73ba13059ae251549e9afed2f39eea3093ac55b4 Mon Sep 17 00:00:00 2001
From: Benoit Alessandroni <benoit@happy-dev.fr>
Date: Sat, 31 Aug 2019 16:26:36 +0200
Subject: [PATCH] Proper save of languages and fields + adding some sets

---
 src/includes/mentor/create.pug         | 19 ++++++++++++-------
 src/includes/mentor/resources/list.pug |  9 ++++++++-
 src/scripts/coopstarter.js             |  2 +-
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/includes/mentor/create.pug b/src/includes/mentor/create.pug
index a9979471..b534c490 100644
--- a/src/includes/mentor/create.pug
+++ b/src/includes/mentor/create.pug
@@ -13,14 +13,14 @@ h2.title_create Complete your mentor account
 sib-form.block_log.block_creat_count(
     bind-user
     fields="account_information(last_name, first_name, mentor_profile.organisation,\
-            mentor_profile.phone, mentor_profile.language),\
+            mentor_profile.phone, mentor_profile.languages, mentor_profile.fields),\
             about_you(header_about_you, account.picture, mentor_profile.headline, mentor_profile.city, mentor_profile.country,\
             mentor_profile.biography, mentor_profile.skills),\
             social_media(header_social_media, mentor_profile.linkedin, mentor_profile.twitter), username"
     
-
+    range-mentor_profile.fields=`${endpoints.fields}`
     range-mentor_profile.organisation=`${endpoints.organisations}`
-    range-mentor_profile.language=`${endpoints.languages}`
+    range-mentor_profile.languages=`${endpoints.languages}`
 
     label-header_about_you="About you"
     label-header_social_media="Social medias"
@@ -32,7 +32,8 @@ sib-form.block_log.block_creat_count(
     label-last_name="Name"
     label-mentor_profile.organisation="Organisation"
     label-mentor_profile.phone="Phone number"
-    label-mentor_profile.language="Language"
+    label-mentor_profile.languages="Languages"
+    label-mentor_profile.fields="Fields"
     label-account.picture="Photo"
     label-mentor_profile.headline="Headline or current position"
     label-mentor_profile.city="City"
@@ -50,9 +51,13 @@ sib-form.block_log.block_creat_count(
     multiple-mentor_profile.organisation='sib-multiple-select'
     widget-mentor_profile.organisation='sib-form-auto-completion'
 
-    class-mentor_profile.language='form-label is-dark'
-    multiple-mentor_profile.language='sib-multiple-select'
-    widget-mentor_profile.language='sib-form-auto-completion'
+    class-mentor_profile.languages='form-label is-dark'
+    multiple-mentor_profile.languages='sib-multiple-select'
+    widget-mentor_profile.languages='sib-form-auto-completion'
+
+    class-mentor_profile.fields='form-label is-dark'
+    multiple-mentor_profile.fields='sib-multiple-select'
+    widget-mentor_profile.fields='sib-form-auto-completion'
 
     class-account.picture='input_photo w_25'
     class-headline='w_75'
diff --git a/src/includes/mentor/resources/list.pug b/src/includes/mentor/resources/list.pug
index 9aade6b8..dcf7c6c9 100644
--- a/src/includes/mentor/resources/list.pug
+++ b/src/includes/mentor/resources/list.pug
@@ -27,10 +27,17 @@ div.block_list
             div#reviews.tabcontent
                 sib-display(
                     data-src=`${endpoints.resources}pending/`
-                    fields='content(name), info(author, publication_year), validate',
+                    fields='content(name, info(author, publication_year)), validate',
                     widget-status='resource-format-name',
 
+                    widget-publication_year='cs-display-resource-property'
+                    label-publication_year='Posted on:'
+
+                    widget-author='cs-display-resource-property'
+                    label-author='Author:'                    
+
                     action-validate='mentor-resource-validate'
+                    label-validate='Check ->'
                     widget-validate='cs-action'
                 )
 
diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js
index 3f51436c..6efa8b14 100644
--- a/src/scripts/coopstarter.js
+++ b/src/scripts/coopstarter.js
@@ -3,7 +3,7 @@ function openTab(pageName, elmnt) {
     var i, tabcontent, tablinks;
     tabcontent = document.getElementsByClassName("tabcontent");
     tablinks = document.getElementsByClassName("tablink");
-    console.log('list of tabs',tablinks)
+    
     for (i = 0; i < tabcontent.length; i++) {
         tabcontent[i].style.display = "none";
         tablinks[i].classList.remove("active");
-- 
GitLab