From c08a490467781e6b8d1bfb11b004e9e5728096fb Mon Sep 17 00:00:00 2001
From: Alice <alice.poggioli@hotmail.fr>
Date: Tue, 10 Sep 2019 18:41:45 +0200
Subject: [PATCH] WIP: Mentor profil editable with sib-form'

---
 src/includes/account-creation.pug       |  2 +-
 src/includes/mentor/components/menu.pug |  1 +
 src/includes/mentor/create.pug          | 70 --------------------
 src/includes/mentor/dashboard.pug       |  7 +-
 src/includes/mentor/profile.pug         | 85 -------------------------
 5 files changed, 8 insertions(+), 157 deletions(-)
 delete mode 100644 src/includes/mentor/create.pug
 delete mode 100644 src/includes/mentor/profile.pug

diff --git a/src/includes/account-creation.pug b/src/includes/account-creation.pug
index 4c83f46b..38f6ff1b 100644
--- a/src/includes/account-creation.pug
+++ b/src/includes/account-creation.pug
@@ -24,7 +24,7 @@ sib-router(default-route='account-creation-index')
             h2.button_base I am an entrepreneur
 
 #mentor-new-account(hidden).no-sidebar.container
-    include mentor/create.pug
+    include mentor/profile/create.pug
 
 #entrepreneur-new-account(hidden).no-sidebar.container
     include entrepreneur/create.pug
diff --git a/src/includes/mentor/components/menu.pug b/src/includes/mentor/components/menu.pug
index 8dc3954f..f52aa70c 100644
--- a/src/includes/mentor/components/menu.pug
+++ b/src/includes/mentor/components/menu.pug
@@ -1,6 +1,7 @@
 sib-router(default-route='mentor-resource-list')
     sib-route(name='mentor-resource-list')
     sib-route(name='mentor-account', id-prefix=`${endpoints.users}`, use-id)
+    sib-route(name='mentor-account-edit', id-prefix=`${endpoints.users}`, use-id)
     sib-ac-checker(permission="acl:Write")
         sib-route(name='mentor-resource-create')
     sib-ac-checker(permission="acl:Write" bind-resources)
diff --git a/src/includes/mentor/create.pug b/src/includes/mentor/create.pug
deleted file mode 100644
index 3b6d162d..00000000
--- a/src/includes/mentor/create.pug
+++ /dev/null
@@ -1,70 +0,0 @@
-include ../components/widgets
-
-figure.logo
-    img(src="../images/logo.png" 
-        alt="Coopstarter")
-
-figure.logo.img_log
-    img(src="../images/mentor.png" 
-        alt="Create a mentor account")
-
-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.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.languages=`${endpoints.languages}`
-
-    label-header_about_you="About you"
-    label-header_social_media="Social medias"
-    
-    widget-header_social_media="cs-section_header"
-    widget-header_about_you="cs-section_introduction"
-    
-    label-first_name="Surname"
-    label-last_name="Name"
-    label-mentor_profile.organisation="Organisation"
-    label-mentor_profile.phone="Phone number"
-    label-mentor_profile.languages="Languages"
-    label-mentor_profile.fields="Fields"
-    label-account.picture="Photo"
-    label-mentor_profile.headline="Headline or current position"
-    class-mentor_profile.headline="w_75"
-    label-mentor_profile.city="City"
-    label-mentor_profile.country="Country"
-    label-mentor_profile.biography="Tell us more about your activities"
-    label-mentor_profile.skills="What skills can you share with our entrepreneurs ?"
-    label-mentor_profile.linkedin="Linkedin"
-    label-mentor_profile.twitter="Twitter"
-
-    widget-mentor_profile.skills="sib-form-textarea"
-    widget-mentor_profile.biography="sib-form-textarea"
-    widget-username="sib-form-hidden"
-
-    class-mentor_profile.organisation='form-label is-dark'
-    multiple-mentor_profile.organisation='sib-multiple-select'
-    widget-mentor_profile.organisation='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'
-
-    upload-url-account.picture=`${sdn}/upload/`
-    widget-account.picture='sib-form-file'
-    class-account.picture='input_photo w_25'
-    class-headline='w_75'
-
-    submit-button="COMPLETE YOUR ACCOUNT"
-    next='mentor-dashboard'
-)
diff --git a/src/includes/mentor/dashboard.pug b/src/includes/mentor/dashboard.pug
index 77b3b603..245cf662 100644
--- a/src/includes/mentor/dashboard.pug
+++ b/src/includes/mentor/dashboard.pug
@@ -43,4 +43,9 @@ section#home
         include resources/list.pug
 
     #mentor-account(hidden).no-sidebar.container
-        include profile.pug
+        include profile/detail.pug
+
+    #mentor-account-edit(hidden).no-sidebar.container
+        include profile/edit.pug
+    
+  
diff --git a/src/includes/mentor/profile.pug b/src/includes/mentor/profile.pug
deleted file mode 100644
index 0b7746cc..00000000
--- a/src/includes/mentor/profile.pug
+++ /dev/null
@@ -1,85 +0,0 @@
-include ../components/widgets
-
-div.container_min
-    h2.title_lead.fd_bleu My Account
-
-div.block_list.flex
-    div.button__actions.w_25
-        div.resources__newresource
-            sib-link(next='mentor-resource-create')
-                div
-                div.button_base.ico_gauche.ico_plus Post a new Resource
-
-        div.dashboard__database
-            sib-link(next='mentor-database')
-                div.button_base.ico_gauche.ico_database Browse database
-
-        div.dashboard__database
-            sib-link(next='mentor-resource-list')
-                div.button_base.ico_gauche.ico_search Back to dashboard
-
-        div.dashboard__database
-                div#logout-button.button_base(
-                    role='log out'
-                ) Logout
-    
-    div.profile_information.block_log.w_75
-
-        sib-display(
-            bind-user
-            fields='account.picture, name, mentor_profile.headline, mentor_profile.city, mentor_profile.country, registered_on'
-            widget-account.picture='cs-profile-picture'
-            widget-name='sib-display-div'
-            widget-mentor_profile.headline='sib-display-div'
-            widget-mentor_profile.city='sib-display-div'
-            widget-mentor_profile.country='sib-display-div'
-            widget-mentor_profile.registered_on='cs-display-property'
-
-            editable-account.picture
-            editable-name
-            editable-mentor_profile.headline
-            editable-mentor_profile.country
-            editable-mentor_profile.city
-
-        )
-
-        sib-display.bold(
-            fields=""
-            nested-field="resources"
-            counter-template="<p>${counter} resource(s) uploaded here</p>"
-            bind-user
-        )
-
-        sib-display(
-            bind-user
-            fields='biography_label, mentor_profile.biography, skills_label, mentor_profile.skills'
-            widget-biography_label='cs-display-label'
-            widget-skills_label='cs-display-label'
-            label-skills_label='Skills:'
-            label-biography_label='Activities:'
-            widget-mentor_profile.skills='sib-display-div'
-            widget-mentor_profile.biography='sib-display-div'
-
-            editable-mentor_profile.skills
-            editable-mentor_profile.biography
-        )
-
-        sib-display(
-            bind-user
-            fields='email, mentor_profile.phone, mentor_profile.linkedin, mentor_profile.twitter'
-            label-email='Email:'
-            class-email="contact_profil"
-            label-mentor_profile.phone='Phone number:'
-            class-mentor_profile.phone="contact_profil"
-            widget-email='sib-display-mailto'
-            widget-mentor_profile.phone='sib-display-tel'
-            widget-mentor_profile.linkedin='cs-display-link'
-            widget-mentor_profile.twitter='cs-display-link'
-            label-mentor_profile.twitter='<i class="fab fa-twitter"></i>'
-            label-mentor_profile.linkedin='<i class="fab fa-linkedin-in"></i>'
-
-            editable-email
-            editable-mentor_profile.phone
-            editable-mentor_profile.linkedin
-            editable-mentor_profile.twitter
-        )
\ No newline at end of file
-- 
GitLab