From c2ec8e6b5b2cad25bff6c2da4045b11dced52c15 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Mon, 9 Sep 2019 11:33:59 +0200 Subject: [PATCH 01/15] WIP: Search resource by keyword in entrepreneur dashboard. --- src/includes/entrepreneur/dashboard.pug | 6 +++--- src/includes/entrepreneur/requests/create.pug | 3 ++- src/includes/entrepreneur/resources/list.pug | 11 ++++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/includes/entrepreneur/dashboard.pug b/src/includes/entrepreneur/dashboard.pug index 69b824c5..55d83d34 100644 --- a/src/includes/entrepreneur/dashboard.pug +++ b/src/includes/entrepreneur/dashboard.pug @@ -8,9 +8,9 @@ header#header(role='banner') section#home - h1 Mentorship program - - p International index of resources for cooperative mentors and entrepreneurs + div.container_min + h2.title_lead.fd_bleu International index of resources for cooperative mentors and entrepreneurs + button.button_dark.pull-right Watch the presentation //TODO: //-Distinguish the search form from the listing diff --git a/src/includes/entrepreneur/requests/create.pug b/src/includes/entrepreneur/requests/create.pug index 2692e978..b382d5fd 100644 --- a/src/includes/entrepreneur/requests/create.pug +++ b/src/includes/entrepreneur/requests/create.pug @@ -1,4 +1,5 @@ h2 Request a ressource +sib-link(class="backlink", next="entrepreneur-resource-list") p You can't find a resource you are looking for ? You need resources to acquire certain skills or progress in your cooperative developement ? It can be a book, a document model, a tutorial, anything you need, make a request to our mentors so they know how to help you. @@ -39,6 +40,6 @@ p You can't find a resource you are looking for ? You need resources to acquire next="entrepreneur-request-validation" ) - sib-link(class="backlink", next="entrepreneur-resource-list") Back to the dashboard + diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 3270dd35..5c3e44a5 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -1,21 +1,22 @@ include ../../components/widgets -p: a Watch a video presentation -h2 Search for a resource + +h2.title_form Search for a resource #circles sib-display#circles-list( data-src=`${endpoints.resources}`, - fields='name, description, format, info(author, publication_year, language.name), steps', - search-fields='name, description, format', + fields='search(name, description, author)', + search-fields='name, description, author', widget-format='cs-resource-format-name', multiple-format, + widget-header_search='cs-section_header', widget-steps='cs-resource-format-name', multiple-steps, - paginate-by="1" + paginate-by="10" next='detail' ) -- GitLab From bd5b594ca36afe2620445c04387000c2f6a6f889 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Mon, 9 Sep 2019 11:40:22 +0200 Subject: [PATCH 02/15] WIP: Search resource by keyword in entrepreneur dashboard. --- src/includes/entrepreneur/resources/list.pug | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 5c3e44a5..76a067ee 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -7,8 +7,13 @@ h2.title_form Search for a resource #circles sib-display#circles-list( data-src=`${endpoints.resources}`, - fields='search(name, description, author)', - search-fields='name, description, author', + fields='search-by-keyword(name, description, author)', + search-search-by-keyword="hidden-widget" + search-fields='search-by-keyword', + search-label-search-by-keyword="Search here by keyword, author..." + search-widget-search-by-keyword="sib-form-placeholder-text" + + widget-format='cs-resource-format-name', multiple-format, -- GitLab From c7bb6f598f7aae0b8348e669cecdd56eea02a309 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Mon, 9 Sep 2019 15:25:13 +0200 Subject: [PATCH 03/15] WIP: Search resource by keyword in entrepreneur dashboard. --- src/includes/entrepreneur/resources/list.pug | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 76a067ee..8b14e148 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -6,13 +6,11 @@ h2.title_form Search for a resource #circles sib-display#circles-list( - data-src=`${endpoints.resources}`, - fields='search-by-keyword(name, description, author)', - search-search-by-keyword="hidden-widget" - search-fields='search-by-keyword', - search-label-search-by-keyword="Search here by keyword, author..." - search-widget-search-by-keyword="sib-form-placeholder-text" + data-src=`${endpoints.steps}`, + nested-field=`resources`, + fields='name, description, author', + search-fields='name, description, author', widget-format='cs-resource-format-name', multiple-format, @@ -20,10 +18,12 @@ h2.title_form Search for a resource widget-header_search='cs-section_header', widget-steps='cs-resource-format-name', multiple-steps, - - paginate-by="10" + next='detail' + ) + + div.side-block p Can't find the ressource you need ? -- GitLab From 4b6fd6f5eeebcb4a0122ae18491557ed31ee4dfe Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Mon, 9 Sep 2019 15:51:22 +0200 Subject: [PATCH 04/15] Display name of each resource --- src/includes/components/widgets.pug | 4 ++++ src/includes/entrepreneur/resources/list.pug | 21 +++++--------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index d1fd0ba7..a716dcc4 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -10,6 +10,10 @@ sib-widget(name='cs-display-property') template p ${value} +sib-widget(name='cs-steps-resources-multiple') + template + p ${value.name} + sib-widget(name='cs-display-link') template p diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 8b14e148..6bd9e150 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -1,28 +1,17 @@ include ../../components/widgets - - h2.title_form Search for a resource #circles sib-display#circles-list( data-src=`${endpoints.steps}`, - nested-field=`resources`, - - fields='name, description, author', - search-fields='name, description, author', - - widget-format='cs-resource-format-name', - multiple-format, - - widget-header_search='cs-section_header', - widget-steps='cs-resource-format-name', - multiple-steps, + fields='resources, name, order' - next='detail' - + label-resources='Resources' + label-each-resources='Resource:' + multiple-resources + widget-resources='cs-steps-resources-multiple' ) - div.side-block -- GitLab From ce1f85ba0149d8371ce32dc4bc1d5fc80d0e78ed Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Mon, 9 Sep 2019 16:05:54 +0200 Subject: [PATCH 05/15] Adding name and order to step --- src/includes/components/widgets.pug | 1 + src/includes/entrepreneur/resources/list.pug | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index 6bf93e5e..53edd925 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -13,6 +13,7 @@ sib-widget(name='cs-display-property') sib-widget(name='cs-steps-resources-multiple') template p ${value.name} + p ${value.description} sib-widget(name='cs-display-link') template diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 6bd9e150..8b2fe4dd 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -5,9 +5,10 @@ h2.title_form Search for a resource #circles sib-display#circles-list( data-src=`${endpoints.steps}`, - fields='resources, name, order' + fields='name, order, resources' - label-resources='Resources' + widget-name='cs-display-property' + label-resources='' label-each-resources='Resource:' multiple-resources widget-resources='cs-steps-resources-multiple' -- GitLab From 45361cf7443acccf17eb349306bba8cbe9801884 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Tue, 10 Sep 2019 08:57:19 +0200 Subject: [PATCH 06/15] WIP: Entrepreneur dashboard- filter the resources. --- src/includes/components/widgets.pug | 4 ++- src/includes/entrepreneur/resources/list.pug | 27 ++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index 53edd925..859aa42d 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -12,7 +12,9 @@ sib-widget(name='cs-display-property') sib-widget(name='cs-steps-resources-multiple') template - p ${value.name} + div.resource_resume_header + p ${value.name} + p ${value.publication_year} p ${value.description} sib-widget(name='cs-display-link') diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 8b2fe4dd..eef2cacf 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -2,14 +2,37 @@ include ../../components/widgets h2.title_form Search for a resource +//-Question : +//the render by default of the steps'field should be render by the widget : "cs-display-step-property" +//=> With the architecture how we do that?? + +//Sould I use jquery to build the steps'accordion? + +//Is there in the project any example to help fred putting the right class on the tag? + +//What's the best way to retrieve the name of the format? By the resource we get a number. Sould we manage this with a 'switch/case' in js? + +//It seems that we don't have likes and dislikes data : sould i ignore them for the moment? + +// To filter by type, I imagine something like that : +//Sib-display (who get all ressources) +// sib-display (with type 1) +// nested-field (to filter by step) +// sib-display (with type 2) +// nested-field (to filter by step) +// => We active one of them on demand with js + + #circles sib-display#circles-list( data-src=`${endpoints.steps}`, - fields='name, order, resources' + fields='order, name, resources' + + widget-fields='cs-display-step-property' - widget-name='cs-display-property' label-resources='' label-each-resources='Resource:' + multiple-resources widget-resources='cs-steps-resources-multiple' ) -- GitLab From f3d170e7a3e4d43bb742cff5363a820d719b25c8 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Tue, 10 Sep 2019 12:24:20 +0200 Subject: [PATCH 07/15] First step on grouping resources by steps --- src/includes/entrepreneur/resources/list.pug | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index eef2cacf..a0c98016 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -24,17 +24,18 @@ h2.title_form Search for a resource #circles - sib-display#circles-list( - data-src=`${endpoints.steps}`, - fields='order, name, resources' - - widget-fields='cs-display-step-property' + sib-widget(name="group-by-steps") + template + strong(data-content) + p.p_entete(data-title) ${value.name} - label-resources='' - label-each-resources='Resource:' - - multiple-resources - widget-resources='cs-steps-resources-multiple' + sib-display#circles-list( + data-src=`${endpoints.resources}`, + fields='name, description' + group-by='steps' + group-by-widget="group-by-steps" + widget-description='cs-display-property' + widget-name='cs-display-property' ) -- GitLab From b7a333f018083040d9557542d9fc84ea3dda33d0 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Tue, 10 Sep 2019 14:59:09 +0200 Subject: [PATCH 08/15] WIP: Dashboard entrepreneur - more criterias form. --- src/includes/components/widgets.pug | 5 ++ src/includes/entrepreneur/requests/create.pug | 2 +- src/includes/entrepreneur/resources/list.pug | 49 +++++++++++++------ 3 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index 859aa42d..25f15b50 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -34,6 +34,11 @@ sib-widget(name='cs-display-title') template h3.title_lead_avenir ${label} +sib-widget(name='cs-display-checkbox') + template + label Search in Coopstarter database only + input(type='checkbox') + sib-widget(name='cs-display-related-property') template p #[a(href="${value.name}")] ${value.name} diff --git a/src/includes/entrepreneur/requests/create.pug b/src/includes/entrepreneur/requests/create.pug index b382d5fd..36925b48 100644 --- a/src/includes/entrepreneur/requests/create.pug +++ b/src/includes/entrepreneur/requests/create.pug @@ -1,5 +1,5 @@ h2 Request a ressource -sib-link(class="backlink", next="entrepreneur-resource-list") +sib-link(class="backlink", next="entrepreneur-resource-list") X p You can't find a resource you are looking for ? You need resources to acquire certain skills or progress in your cooperative developement ? It can be a book, a document model, a tutorial, anything you need, make a request to our mentors so they know how to help you. diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index a0c98016..b29146dc 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -3,24 +3,15 @@ include ../../components/widgets h2.title_form Search for a resource //-Question : -//the render by default of the steps'field should be render by the widget : "cs-display-step-property" -//=> With the architecture how we do that?? +//In my opinion, "multiple ressource" solution is closer to the wanted result than the "group-by" solution -//Sould I use jquery to build the steps'accordion? - -//Is there in the project any example to help fred putting the right class on the tag? +//Maybe we sould think from now how we gonna manage the type filter //What's the best way to retrieve the name of the format? By the resource we get a number. Sould we manage this with a 'switch/case' in js? //It seems that we don't have likes and dislikes data : sould i ignore them for the moment? -// To filter by type, I imagine something like that : -//Sib-display (who get all ressources) -// sib-display (with type 1) -// nested-field (to filter by step) -// sib-display (with type 2) -// nested-field (to filter by step) -// => We active one of them on demand with js +// #circles @@ -31,9 +22,37 @@ h2.title_form Search for a resource sib-display#circles-list( data-src=`${endpoints.resources}`, - fields='name, description' - group-by='steps' - group-by-widget="group-by-steps" + fields='keyword(name, description, author),\ + steps.name,\ + more_criterias( format, publication_year, country, language.name, fields, steps)' + + search-fields="keyword, instance_database_only,\ + more_criterias(header_criterias, format, publication_year, country, language, field, step)" + search-label-keyword="Search by author, name..." + search-label-header_criterias='More criterias' + search-label-format='Format' + search-label-publication_year='Year of publication' + search-label-country='Country of publication' + search-label-language='Language' + search-label-field='Field' + search-label-step='Step of : Staring up a cooperative business' + search-widget-keyword="sib-form-placeholder-text" + search-widget-instance_database_only='cs-display-checkbox' + search-widget-header_criterias='cs-section_header' + + search-range-language=`${endpoints.languages}` + search-range-field=`${endpoints.fields}` + search-range-step=`${endpoints.step}` + + search-multiple-language='sib-multiple-select' + search-widget-language='sib-form-auto-completion' + + search-multiple-field='sib-multiple-select' + search-widget-field='sib-form-auto-completion' + + search-multiple-step='sib-multiple-select' + search-widget-step='sib-form-auto-completion' + widget-description='cs-display-property' widget-name='cs-display-property' ) -- GitLab From ba64205dacf0fd69ef355b315642922590cc1dc4 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Tue, 10 Sep 2019 17:37:24 +0200 Subject: [PATCH 09/15] WIP: Mentor profil editable with new feature 'editable-xyz' --- src/includes/mentor/profile.pug | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/includes/mentor/profile.pug b/src/includes/mentor/profile.pug index 55c9374b..0b7746cc 100644 --- a/src/includes/mentor/profile.pug +++ b/src/includes/mentor/profile.pug @@ -24,15 +24,23 @@ div.block_list.flex ) 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='cs-display-property' - widget-mentor_profile.headline='cs-display-property' - widget-mentor_profile.city='cs-display-property' - widget-mentor_profile.country='cs-display-property' + 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( @@ -49,8 +57,11 @@ div.block_list.flex widget-skills_label='cs-display-label' label-skills_label='Skills:' label-biography_label='Activities:' - widget-mentor_profile.skills='cs-display-property' - widget-mentor_profile.biography='cs-display-property' + widget-mentor_profile.skills='sib-display-div' + widget-mentor_profile.biography='sib-display-div' + + editable-mentor_profile.skills + editable-mentor_profile.biography ) sib-display( @@ -60,10 +71,15 @@ div.block_list.flex class-email="contact_profil" label-mentor_profile.phone='Phone number:' class-mentor_profile.phone="contact_profil" - widget-email='cs-display-resource-property' - widget-mentor_profile.phone='cs-display-resource-property' + 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 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 10/15] 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 From a3fde5da23dc1b865f51ac3fb07a9da2d70750cf Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Wed, 11 Sep 2019 07:11:23 +0200 Subject: [PATCH 11/15] WIP: Mentor profil editable with sib-form' --- src/includes/mentor/profile/create.pug | 70 +++++++++++++++++++++++++ src/includes/mentor/profile/detail.pug | 72 ++++++++++++++++++++++++++ src/includes/mentor/profile/edit.pug | 62 ++++++++++++++++++++++ 3 files changed, 204 insertions(+) create mode 100644 src/includes/mentor/profile/create.pug create mode 100644 src/includes/mentor/profile/detail.pug create mode 100644 src/includes/mentor/profile/edit.pug diff --git a/src/includes/mentor/profile/create.pug b/src/includes/mentor/profile/create.pug new file mode 100644 index 00000000..96049e4f --- /dev/null +++ b/src/includes/mentor/profile/create.pug @@ -0,0 +1,70 @@ +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/profile/detail.pug b/src/includes/mentor/profile/detail.pug new file mode 100644 index 00000000..0b4b95f4 --- /dev/null +++ b/src/includes/mentor/profile/detail.pug @@ -0,0 +1,72 @@ +mentor-account-editinclude ../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-link(next='mentor-account-edit') + div.button_base.ico_gauche.ico_search Edit + + 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='cs-display-property' + widget-mentor_profile.headline='cs-display-property' + widget-mentor_profile.city='cs-display-property' + widget-mentor_profile.country='cs-display-property' + widget-mentor_profile.registered_on='cs-display-property' + ) + + 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='cs-display-property' + widget-mentor_profile.biography='cs-display-property' + ) + + 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='cs-display-resource-property' + widget-mentor_profile.phone='cs-display-resource-property' + 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>' + ) \ No newline at end of file diff --git a/src/includes/mentor/profile/edit.pug b/src/includes/mentor/profile/edit.pug new file mode 100644 index 00000000..09a9e2b7 --- /dev/null +++ b/src/includes/mentor/profile/edit.pug @@ -0,0 +1,62 @@ +include ../../components/widgets + +h2.title_create Edit you 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="Save modifications" + next='mentor-dashboard' +) \ No newline at end of file -- GitLab From 3cdd40fa3a72f7026f22789e9699433b436c90e1 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Wed, 11 Sep 2019 10:00:09 +0200 Subject: [PATCH 12/15] =?UTF-8?q?WIP:=20Entrepreneur=20dashboard=20:=20pro?= =?UTF-8?q?fil=20detail=20and=20=C3=A9dit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/includes/account-creation.pug | 2 +- src/includes/entrepreneur/components/menu.pug | 1 + src/includes/entrepreneur/dashboard.pug | 11 +++-- .../entrepreneur/{ => profile}/create.pug | 2 +- src/includes/entrepreneur/profile/detail.pug | 43 +++++++++++++++++++ src/includes/entrepreneur/profile/edit.pug | 34 +++++++++++++++ src/includes/entrepreneur/resources/list.pug | 4 ++ src/includes/mentor/profile/detail.pug | 2 +- 8 files changed, 90 insertions(+), 9 deletions(-) rename src/includes/entrepreneur/{ => profile}/create.pug (96%) create mode 100644 src/includes/entrepreneur/profile/detail.pug create mode 100644 src/includes/entrepreneur/profile/edit.pug diff --git a/src/includes/account-creation.pug b/src/includes/account-creation.pug index 38f6ff1b..a268f923 100644 --- a/src/includes/account-creation.pug +++ b/src/includes/account-creation.pug @@ -27,4 +27,4 @@ sib-router(default-route='account-creation-index') include mentor/profile/create.pug #entrepreneur-new-account(hidden).no-sidebar.container - include entrepreneur/create.pug + include entrepreneur/profile/create.pug diff --git a/src/includes/entrepreneur/components/menu.pug b/src/includes/entrepreneur/components/menu.pug index 79869cdc..b69341d1 100644 --- a/src/includes/entrepreneur/components/menu.pug +++ b/src/includes/entrepreneur/components/menu.pug @@ -1,4 +1,5 @@ sib-router(default-route='entrepreneur-resource-list') sib-route(name='entrepreneur-resource-list') sib-route(name='entrepreneur-account', id-prefix=`${endpoints.users}`, use-id) + sib-route(name='entrepreneur-account-edit', id-prefix=`${endpoints.users}`, use-id) \ No newline at end of file diff --git a/src/includes/entrepreneur/dashboard.pug b/src/includes/entrepreneur/dashboard.pug index 55d83d34..e2963f8f 100644 --- a/src/includes/entrepreneur/dashboard.pug +++ b/src/includes/entrepreneur/dashboard.pug @@ -8,10 +8,6 @@ header#header(role='banner') section#home - div.container_min - h2.title_lead.fd_bleu International index of resources for cooperative mentors and entrepreneurs - button.button_dark.pull-right Watch the presentation - //TODO: //-Distinguish the search form from the listing //-Create two Sib-displays getting the resources by "types" @@ -36,5 +32,8 @@ section#home p.flex sib-link(next='entrepreneur-resource-list', class='button_base') Ok - #entrepreneur-account(hidden) - h2 account + #entrepreneur-account(hidden).no-sidebar.container + include profile/detail.pug + + #entrepreneur-account-edit(hidden).no-sidebar.container + include profile/edit.pug diff --git a/src/includes/entrepreneur/create.pug b/src/includes/entrepreneur/profile/create.pug similarity index 96% rename from src/includes/entrepreneur/create.pug rename to src/includes/entrepreneur/profile/create.pug index 1a07b382..8eb14484 100644 --- a/src/includes/entrepreneur/create.pug +++ b/src/includes/entrepreneur/profile/create.pug @@ -1,4 +1,4 @@ -include ../components/widgets +include ../../components/widgets figure.logo img(src="../images/logo.png" diff --git a/src/includes/entrepreneur/profile/detail.pug b/src/includes/entrepreneur/profile/detail.pug new file mode 100644 index 00000000..cf1907f4 --- /dev/null +++ b/src/includes/entrepreneur/profile/detail.pug @@ -0,0 +1,43 @@ +include ../../components/widgets + +div.container_min + h2.title_lead.fd_bleu My Account + +div.block_list.flex + div.button__actions.w_25 + div.request__newrequest + sib-link(next='entrepreneur-request-create') + div + div.button_base.ico_gauche.ico_plus Post a new Request + + div.dashboard__database + sib-link(next='entrepreneur-database') + div.button_base.ico_gauche.ico_database Browse database + + div.dashboard__database + sib-link(next='entrepreneur-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-link(next='entrepreneur-account-edit') + div.button_base.ico_gauche.ico_search Edit + + sib-display( + bind-user + fields='name, entrepreneur_profile.organisation, registered_on' + widget-name='cs-display-property' + widget-entrepreneur_profile.registered_on='cs-display-property' + ) + + sib-display( + bind-user + fields='email' + label-email='Email:' + class-email="contact_profil" + widget-email='cs-display-resource-property' + ) \ No newline at end of file diff --git a/src/includes/entrepreneur/profile/edit.pug b/src/includes/entrepreneur/profile/edit.pug new file mode 100644 index 00000000..d713ae06 --- /dev/null +++ b/src/includes/entrepreneur/profile/edit.pug @@ -0,0 +1,34 @@ +include ../../components/widgets + +h2.title_create Edit you account + +sib-form.block_log.block_creat_count( + bind-user + fields="last_name, first_name, username, email, entrepreneur_profile.organisation, entrepreneur_profile.phone" + + range-entrepreneur_profile.organisation=`${endpoints.organisations}` + + + label-first_name="Surname" + label-last_name="Name" + label-username="Username" + label-entrepreneur_profile.organisation="Organisation" + label-entrepreneur_profile.phone="Phone number" + + widget-username="sib-form-hidden" + + class-last_name='form-label is-dark input_big' + class-first_name='form-label is-dark input_big' + class-email='form-label is-dark input_big' + class-entrepreneur_profile.phone='form-label is-dark input_big' + + class-entrepreneur_profile.organisation='form-label is-dark input_big' + multiple-entrepreneur_profile.organisation='sib-multiple-select' + widget-entrepreneur_profile.organisation='sib-form-auto-completion' + + range-mentor_profile.organisation=`${endpoints.organisations}` + + + submit-button="Save modifications" + next='entrepreneur-dashboard' +) \ No newline at end of file diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index b29146dc..ce0a0cee 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -1,5 +1,9 @@ include ../../components/widgets +div.container_min + h2.title_lead.fd_bleu International index of resources for cooperative mentors and entrepreneurs + button.button_dark.pull-right Watch the presentation + h2.title_form Search for a resource //-Question : diff --git a/src/includes/mentor/profile/detail.pug b/src/includes/mentor/profile/detail.pug index 0b4b95f4..b5e02a9a 100644 --- a/src/includes/mentor/profile/detail.pug +++ b/src/includes/mentor/profile/detail.pug @@ -1,4 +1,4 @@ -mentor-account-editinclude ../components/widgets +include ../../components/widgets div.container_min h2.title_lead.fd_bleu My Account -- GitLab From 80b040b1118f9af90c3f14b88b51c997a1c49c42 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Wed, 11 Sep 2019 15:15:35 +0200 Subject: [PATCH 13/15] Bug: Adapt js to a second logout button in entrepreneur account. --- src/includes/entrepreneur/profile/detail.pug | 2 +- src/includes/mentor/profile/detail.pug | 2 +- src/scripts/coopstarter.js | 107 ++++++++++--------- 3 files changed, 60 insertions(+), 51 deletions(-) diff --git a/src/includes/entrepreneur/profile/detail.pug b/src/includes/entrepreneur/profile/detail.pug index cf1907f4..3968fb97 100644 --- a/src/includes/entrepreneur/profile/detail.pug +++ b/src/includes/entrepreneur/profile/detail.pug @@ -19,7 +19,7 @@ div.block_list.flex div.button_base.ico_gauche.ico_search Back to dashboard div.dashboard__database - div#logout-button.button_base( + div.logout-button.button_base( role='log out' ) Logout diff --git a/src/includes/mentor/profile/detail.pug b/src/includes/mentor/profile/detail.pug index b5e02a9a..ea48963b 100644 --- a/src/includes/mentor/profile/detail.pug +++ b/src/includes/mentor/profile/detail.pug @@ -19,7 +19,7 @@ div.block_list.flex div.button_base.ico_gauche.ico_search Back to dashboard div.dashboard__database - div#logout-button.button_base( + div.logout-button.button_base( role='log out' ) Logout diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 73ff168c..3526ae67 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -1,58 +1,67 @@ function openTab(pageName, elmnt) { - // Hide all elements with class="tabcontent" by default */ - var i, tabcontent, tablinks; - tabcontent = document.getElementsByClassName("tabcontent"); - tablinks = document.getElementsByClassName("tablink"); - - for (i = 0; i < tabcontent.length; i++) { - tabcontent[i].style.display = "none"; - tablinks[i].classList.remove("active"); - } - - // Show the specific tab content - document.getElementById(pageName).style.display = "block"; - elmnt.classList.add("active"); + // Hide all elements with class="tabcontent" by default */ + var i, tabcontent, tablinks; + tabcontent = document.getElementsByClassName("tabcontent"); + tablinks = document.getElementsByClassName("tablink"); + + for (i = 0; i < tabcontent.length; i++) { + tabcontent[i].style.display = "none"; + tablinks[i].classList.remove("active"); + } + + // Show the specific tab content + document.getElementById(pageName).style.display = "block"; + elmnt.classList.add("active"); } function linkDatasetToField(detail, 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.setAttribute('value', JSON.stringify({ '@id': detail.dataset.src })); - } - }); + 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.setAttribute( + "value", + JSON.stringify({ "@id": detail.dataset.src }) + ); + } + }); } function refreshList(formId, listId) { - let form = document.getElementById(formId); - form.addEventListener("save", event => { - let list = document.getElementById(listId); - list.dataset.src = list.dataset.src; - }); + let form = document.getElementById(formId); + form.addEventListener("save", event => { + let list = document.getElementById(listId); + list.dataset.src = list.dataset.src; + }); } -jQuery(document).ready(function($) { - // Get the element with id="defaultOpen" and click on it - document.getElementById("defaultOpen").click(); - - let userAccountDataSrc = document.getElementById("user-account-picture"); - linkDatasetToField(userAccountDataSrc, 'validation-form', 'reviewer'); - linkDatasetToField(userAccountDataSrc, 'improvement-dialog-form', 'reviewer'); - linkDatasetToField(userAccountDataSrc, 'refusal-dialog-form', 'reviewer'); - - refreshList("resource-creation-form", "resources-history"); - refreshList("validation-form", "pending-resources"); - refreshList("refusal-dialog-form", "pending-resources"); - refreshList("improvement-dialog-form", "pending-resources"); - - const logoutButton = document.getElementById('logout-button'); - logoutButton.addEventListener('click', function() { - window.dispatchEvent( - new CustomEvent('requestNavigation', { detail: { route: 'splash-index' } }) - ); - document.querySelector('sib-auth').logout(); - setTimeout(function(){ location.reload(); }, 1000); - }) - }); \ No newline at end of file +jQuery(document).ready(function($) { + // Get the element with id="defaultOpen" and click on it + document.getElementById("defaultOpen").click(); + + let userAccountDataSrc = document.getElementById("user-account-picture"); + linkDatasetToField(userAccountDataSrc, "validation-form", "reviewer"); + linkDatasetToField(userAccountDataSrc, "improvement-dialog-form", "reviewer"); + linkDatasetToField(userAccountDataSrc, "refusal-dialog-form", "reviewer"); + + refreshList("resource-creation-form", "resources-history"); + refreshList("validation-form", "pending-resources"); + refreshList("refusal-dialog-form", "pending-resources"); + refreshList("improvement-dialog-form", "pending-resources"); + + const logoutButtons = document.getElementsByClassName("logout-button"); + for (var i = 0; i < logoutButtons.length; i++) { + logoutButtons[i].addEventListener("click", function() { + window.dispatchEvent( + new CustomEvent("requestNavigation", { + detail: { route: "splash-index" } + }) + ); + document.querySelector("sib-auth").logout(); + setTimeout(function() { + location.reload(); + }, 1000); + }); + } +}); -- GitLab From 05e00333663369687aee8e090b8a3a34d4e0de91 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Wed, 11 Sep 2019 15:48:45 +0200 Subject: [PATCH 14/15] Feature: Entrepreneur account detail/edit. --- src/includes/entrepreneur/profile/detail.pug | 11 ++++------- src/includes/entrepreneur/profile/edit.pug | 3 +-- src/includes/mentor/profile/detail.pug | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/includes/entrepreneur/profile/detail.pug b/src/includes/entrepreneur/profile/detail.pug index 3968fb97..a597bd0c 100644 --- a/src/includes/entrepreneur/profile/detail.pug +++ b/src/includes/entrepreneur/profile/detail.pug @@ -5,10 +5,6 @@ div.container_min div.block_list.flex div.button__actions.w_25 - div.request__newrequest - sib-link(next='entrepreneur-request-create') - div - div.button_base.ico_gauche.ico_plus Post a new Request div.dashboard__database sib-link(next='entrepreneur-database') @@ -21,16 +17,17 @@ div.block_list.flex div.dashboard__database div.logout-button.button_base( role='log out' - ) Logout + ) Logout div.profile_information.block_log.w_75 sib-link(next='entrepreneur-account-edit') - div.button_base.ico_gauche.ico_search Edit + button.button_edit Edit sib-display( bind-user - fields='name, entrepreneur_profile.organisation, registered_on' + fields='name, entrepreneur_profile.organisation.name, registered_on' widget-name='cs-display-property' + widget-entrepreneur_profile.organisation.name='cs-display-property' widget-entrepreneur_profile.registered_on='cs-display-property' ) diff --git a/src/includes/entrepreneur/profile/edit.pug b/src/includes/entrepreneur/profile/edit.pug index d713ae06..59460e46 100644 --- a/src/includes/entrepreneur/profile/edit.pug +++ b/src/includes/entrepreneur/profile/edit.pug @@ -4,7 +4,7 @@ h2.title_create Edit you account sib-form.block_log.block_creat_count( bind-user - fields="last_name, first_name, username, email, entrepreneur_profile.organisation, entrepreneur_profile.phone" + fields="last_name, first_name, username, email, entrepreneur_profile.organisation" range-entrepreneur_profile.organisation=`${endpoints.organisations}` @@ -13,7 +13,6 @@ sib-form.block_log.block_creat_count( label-last_name="Name" label-username="Username" label-entrepreneur_profile.organisation="Organisation" - label-entrepreneur_profile.phone="Phone number" widget-username="sib-form-hidden" diff --git a/src/includes/mentor/profile/detail.pug b/src/includes/mentor/profile/detail.pug index ea48963b..00a95bf8 100644 --- a/src/includes/mentor/profile/detail.pug +++ b/src/includes/mentor/profile/detail.pug @@ -25,7 +25,7 @@ div.block_list.flex div.profile_information.block_log.w_75 sib-link(next='mentor-account-edit') - div.button_base.ico_gauche.ico_search Edit + button.button_edit Edit sib-display( bind-user -- GitLab From 7d5f5ace49a9236dfbdf88bdab9f1a112f51dfa5 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Wed, 11 Sep 2019 16:45:05 +0200 Subject: [PATCH 15/15] Quick fixes --- src/includes/entrepreneur/dashboard.pug | 2 +- src/includes/entrepreneur/profile/edit.pug | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/includes/entrepreneur/dashboard.pug b/src/includes/entrepreneur/dashboard.pug index e2963f8f..422ad21f 100644 --- a/src/includes/entrepreneur/dashboard.pug +++ b/src/includes/entrepreneur/dashboard.pug @@ -17,7 +17,7 @@ section#home //TODO : investigate why we have to remove hidden attribute to see this even if we are on the right route. - #entrepreneur-resource-list() + #entrepreneur-resource-list(hidden).no-sidebar.container include ./resources/list.pug sib-router diff --git a/src/includes/entrepreneur/profile/edit.pug b/src/includes/entrepreneur/profile/edit.pug index 59460e46..3f0197f8 100644 --- a/src/includes/entrepreneur/profile/edit.pug +++ b/src/includes/entrepreneur/profile/edit.pug @@ -1,6 +1,6 @@ include ../../components/widgets -h2.title_create Edit you account +h2.title_create Edit your account sib-form.block_log.block_creat_count( bind-user @@ -8,7 +8,6 @@ sib-form.block_log.block_creat_count( range-entrepreneur_profile.organisation=`${endpoints.organisations}` - label-first_name="Surname" label-last_name="Name" label-username="Username" @@ -25,9 +24,6 @@ sib-form.block_log.block_creat_count( multiple-entrepreneur_profile.organisation='sib-multiple-select' widget-entrepreneur_profile.organisation='sib-form-auto-completion' - range-mentor_profile.organisation=`${endpoints.organisations}` - - submit-button="Save modifications" - next='entrepreneur-dashboard' + next='entrepreneur-resource-list' ) \ No newline at end of file -- GitLab