From 45b477281b95d678451bce0c43d7d6a6ecd62466 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Sat, 29 Aug 2020 16:57:26 +0200 Subject: [PATCH 1/6] A few fixes --- src/includes/public/components/header.pug | 2 +- src/scripts/coopstarter.js | 4 ++-- translation/fr.yml | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/includes/public/components/header.pug b/src/includes/public/components/header.pug index 6900f217..3b9114ac 100644 --- a/src/includes/public/components/header.pug +++ b/src/includes/public/components/header.pug @@ -1,6 +1,6 @@ .container .flex.flex_espace.flex_item_center - solid-link(next='public-resource-list') + solid-link(next='splash') figure.logo_head.margin_bord_ecran img(src=`${client_domain}/images/logo_head.png` alt="Coopstarter") diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index dc98e03c..18bf1e79 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -671,9 +671,9 @@ document.addEventListener("DOMContentLoaded", event => { // refreshUser("mentor_profile_picture", "mentor_account_picture"); // refreshUser("mentor_profile_picture", "mentor_info"); - addProperFilterToSearchComponents("entrepreneur-resource-list", "entrepreneur-filter-form"); + // addProperFilterToSearchComponents("entrepreneur-resource-list", "entrepreneur-filter-form"); addProperFilterToSearchComponents("mentor-database", "database-filter-form"); - addProperFilterToSearchComponents("public-resource-list", "public-filter-form"); + // addProperFilterToSearchComponents("public-resource-list", "public-filter-form"); var header_dropdown = $(".dropdownWrapper"), drop_choices = header_dropdown.find(".dropdownLabel"); diff --git a/translation/fr.yml b/translation/fr.yml index 8ec68181..cc1dbc9f 100644 --- a/translation/fr.yml +++ b/translation/fr.yml @@ -24,6 +24,7 @@ Refused : Refusé DatePublication : Date de publication Format: Format Step: Étape +Steps: Étapes associées ResourcePostedBy : Ressource posté par WithResourceAbleTo : Avec cette ressource vous serez capable de LinkToResource : Lien vers la ressource @@ -31,7 +32,7 @@ ReportBrokenLink : Signaler un lien brisé ResourceValidatedBy : Ressource validée par ResourceSpecifications : Spécification de la ressource Author : Auteur -Access : Accés +Access : Accès Comments : Commentaires RelatedResources : Ressources connexes ResourcesUploadedHere : ressource(s) téléchargé ici @@ -68,7 +69,7 @@ MandatoryInformation : Informations obligatoires ComplementaryInformation : Informations complémentaires WithThisResourceBeAbleTo : Grâce à cette ressource, vous serez en mesure de WatchThePresentation : Regarder la présentation -SearchForResource : Chercher une resource +SearchForResource : Rechercher une ressource CantFindResourceYouNeed : Vous ne trouvez pas la resource dont vous avez besoin ? MakeRequest: Faire une requête Thanks : Merci! @@ -97,7 +98,7 @@ UploadPreviewImage: "Image de prévisualisation" AddTags: Ajouter des tags ResourceTargetReq : Cible en matière de ressources TypeContentReq: Type de contenu -CategorisationReq: Categorisation +CategorisationReq: Catégorisation ShareWithReq: Partager avec AddResource: Ajouter une ressource SendForValidation : Envoyer pour validation -> -- GitLab From e1cfacb9c03be0232e84d1b590b66ae8f2979b92 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Sat, 29 Aug 2020 22:06:36 +0200 Subject: [PATCH 2/6] First advancement of the search fixes --- src/includes/entrepreneur/profile/detail.pug | 12 +++++-- src/includes/entrepreneur/profile/view.pug | 22 +++++++++---- src/includes/entrepreneur/resources/list.pug | 10 +++--- src/includes/mentor/profile/detail.pug | 21 ++++++++---- src/includes/mentor/validation-process.pug | 2 +- src/scripts/coopstarter.js | 34 +++++++------------- src/styles/index.scss | 10 +++++- 7 files changed, 67 insertions(+), 44 deletions(-) diff --git a/src/includes/entrepreneur/profile/detail.pug b/src/includes/entrepreneur/profile/detail.pug index fd2166ca..7d9a22b0 100644 --- a/src/includes/entrepreneur/profile/detail.pug +++ b/src/includes/entrepreneur/profile/detail.pug @@ -21,10 +21,16 @@ div.block_list.flex bind-user fields='account.picture, name, username, entrepreneurProfile.organisation.name, registeredOn' widget-name='cs-display-property' - widget-username='cs-display-property' + widget-username='cs-display-resource-property' widget-account.picture='cs-profile-picture' - widget-entrepreneurProfile.organisation.name='cs-display-property' - widget-entrepreneurProfile.registeredOn='cs-display-property' + widget-entrepreneurProfile.organisation.name='cs-display-resource-property' + widget-entrepreneurProfile.registeredOn='cs-display-resource-property' + + label-username='Username:' + label-entrepreneurProfile.organisation.name='Organisation:' + label-entrepreneurProfile.registeredOn='Registered on:' + + class-entrepreneurProfile.organisation.name="organisation" ) solid-display#entrepreneur_contact( diff --git a/src/includes/entrepreneur/profile/view.pug b/src/includes/entrepreneur/profile/view.pug index 7ee92054..38c4f511 100644 --- a/src/includes/entrepreneur/profile/view.pug +++ b/src/includes/entrepreneur/profile/view.pug @@ -14,14 +14,24 @@ div.block_list.flex div.profile_information.block_log.w_75 solid-display.user_info( bind-resources - fields='account.picture, name, username, mentorProfile.headline, mentorProfile.city, mentorProfile.country.name, registered_on' + fields='account.picture, name, username, mentorProfile.organisation.name, mentorProfile.headline, mentorProfile.city, mentorProfile.country.name, registered_on' widget-account.picture='cs-profile-picture' widget-name='cs-display-property' - widget-username='cs-display-property' - widget-mentorProfile.headline='cs-display-property' - widget-mentorProfile.city='cs-display-property' - widget-mentorProfile.country.name='cs-display-property' - widget-mentorProfile.registered_on='cs-display-property' + widget-username='cs-display-resource-property' + widget-mentorProfile.organisation.name='cs-display-resource-property' + widget-mentorProfile.headline='cs-display-resource-property' + widget-mentorProfile.city='cs-display-resource-property' + widget-mentorProfile.country.name='cs-display-resource-property' + widget-mentorProfile.registered_on='cs-display-resource-property' + + label-username='Username:' + label-mentorProfile.headline='Headline:' + label-mentorProfile.city='City:' + label-mentorProfile.country.name='Country:' + label-mentorProfile.organisation.name='Organisation:' + label-mentorProfile.registeredOn='Registered on:' + + class-mentorProfile.organisation.name="organisation" ) solid-display.bold( diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 50a8d3b2..20510eea 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -14,12 +14,12 @@ container.block_list div.w_75.block-g-entre div h2.title_form=`${data.SearchForResource}` - div#resources-loader - hidden - i.fas.fa-spinner.fa-spin + //- div#resources-loader + //- hidden + //- i.fas.fa-spinner.fa-spin + solid-form.search-by-keyword( - data-src=`${endpoints.resources}`, - loader-id="resources-loader" + data-src=`${endpoints.resources}` fields='keyword(name_keyword)' label-name_keyword=`${data.SearchByName}` widget-name_keyword="solid-form-placeholder-text" diff --git a/src/includes/mentor/profile/detail.pug b/src/includes/mentor/profile/detail.pug index 96950e59..7e48fba8 100644 --- a/src/includes/mentor/profile/detail.pug +++ b/src/includes/mentor/profile/detail.pug @@ -30,12 +30,21 @@ div.block_list.flex fields='account.picture, name, username, mentorProfile.organisation.name, mentorProfile.headline, mentorProfile.city, mentorProfile.country.name, registered_on' widget-account.picture='cs-profile-picture' widget-name='cs-display-property' - widget-username='cs-display-property' - widget-mentorProfile.organisation.name='cs-display-property' - widget-mentorProfile.headline='cs-display-property' - widget-mentorProfile.city='cs-display-property' - widget-mentorProfile.country.name='cs-display-property' - widget-mentorProfile.registered_on='cs-display-property' + widget-username='cs-display-resource-property' + widget-mentorProfile.organisation.name='cs-display-resource-property' + widget-mentorProfile.headline='cs-display-resource-property' + widget-mentorProfile.city='cs-display-resource-property' + widget-mentorProfile.country.name='cs-display-resource-property' + widget-mentorProfile.registered_on='cs-display-resource-property' + + label-username='Username:' + label-mentorProfile.headline='Headline:' + label-mentorProfile.city='City:' + label-mentorProfile.country.name='Country:' + label-mentorProfile.organisation.name='Organisation:' + label-mentorProfile.registeredOn='Registered on:' + + class-mentorProfile.organisation.name="organisation" ) solid-display.bold( diff --git a/src/includes/mentor/validation-process.pug b/src/includes/mentor/validation-process.pug index 3f68cf1c..72f4ffb8 100644 --- a/src/includes/mentor/validation-process.pug +++ b/src/includes/mentor/validation-process.pug @@ -1,5 +1,5 @@ div.block_log.block_creat_count.no_shadow - solid-link(class="backlink", next="mentor-resource-list") + solid-link(class="backlink", next="mentor-dashboard") i.fas.fa-times div#validation-process h2=`${data.WhatValidationProcess}` diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 18bf1e79..70e9b3d5 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -255,23 +255,13 @@ function selectHiddenManagementForType(tab, form) { /** * Init type to type 1 */ -function InitManagementForType(targetSpaceId, formId, timeout) { +function InitManagementForType(targetSpaceId, timeout) { setTimeout(function() { var targetSpace = document.getElementById(targetSpaceId); - var form = document.getElementById(formId); - let type_hidden_select = form.querySelector('select[name="type"]'); - - var tabs = targetSpace.querySelectorAll(".tablink.filter_by_type"); - tabs[0].click(); - // openFakeTab(tabs[0]); - tabs[0].classList.add("active"); - tabs = targetSpace.querySelectorAll(".tablink.filter_by_type"); - //Trigerring a reload of the associated form - let parent_form = type_hidden_select.closest("solid-form-search"); - if (parent_form) { - parent_form.component.inputChange(); - parent_form.dispatchEvent(new CustomEvent('formChange')); - refreshPagination(); + if (targetSpace) { + var tabs = targetSpace.querySelectorAll(".tablink.filter_by_type"); + tabs[0].click(); + tabs[0].classList.add("active"); } }, timeout); } @@ -614,11 +604,6 @@ document.addEventListener("DOMContentLoaded", event => { //Refresh pagination refreshPagination(); - //init the fitering by step - InitManagementForType("mentor-database", "database-filter-form", 5000); - InitManagementForType("public-resource-list", "public-filter-form", 3000); - InitManagementForType("entrepreneur-resource-list", "entrepreneur-filter-form", 10000); - //Manage the accordion in request mentor dashboard. manageAccordionForRequest(); @@ -671,9 +656,14 @@ document.addEventListener("DOMContentLoaded", event => { // refreshUser("mentor_profile_picture", "mentor_account_picture"); // refreshUser("mentor_profile_picture", "mentor_info"); - // addProperFilterToSearchComponents("entrepreneur-resource-list", "entrepreneur-filter-form"); + addProperFilterToSearchComponents("entrepreneur-resource-list", "entrepreneur-filter-form"); addProperFilterToSearchComponents("mentor-database", "database-filter-form"); - // addProperFilterToSearchComponents("public-resource-list", "public-filter-form"); + addProperFilterToSearchComponents("public-resource-list", "public-filter-form"); + + //init the fitering by step + InitManagementForType("mentor-database", 3000); + InitManagementForType("public-resource-list", 3000); + InitManagementForType("entrepreneur-resource-list", 3000); var header_dropdown = $(".dropdownWrapper"), drop_choices = header_dropdown.find(".dropdownLabel"); diff --git a/src/styles/index.scss b/src/styles/index.scss index 769aecd8..1f401c9e 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1226,6 +1226,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/ } } + #entrepreneur-resource-list .step div div, #public-resource-list .step div div, #mentor-database .step div div{ @@ -2235,8 +2236,15 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/ } } + .user_info { + cs-display-resource-property p{ + margin-bottom: 1rem; + } + .organisation p{ + margin-bottom: 3rem; + } + } } - #entrepreneur-account-view .profile_information, #user-account-view .profile_information, #mentor-account-view .profile_information { -- GitLab From b763c70f73b3256c4b56013537541a4505d3401b Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Sun, 30 Aug 2020 22:24:43 +0200 Subject: [PATCH 3/6] Fixing the search to allow searching by description or name or author --- src/includes/entrepreneur/resources/list.pug | 46 ++++++-------- src/includes/mentor/resources/database.pug | 42 +++++-------- src/includes/public/resources/list.pug | 37 +++++------ src/scripts/coopstarter.js | 66 +++++--------------- src/styles/index.scss | 4 +- translation/en.yml | 2 +- 6 files changed, 70 insertions(+), 127 deletions(-) diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 20510eea..7128d408 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -14,20 +14,6 @@ container.block_list div.w_75.block-g-entre div h2.title_form=`${data.SearchForResource}` - //- div#resources-loader - //- hidden - //- i.fas.fa-spinner.fa-spin - - solid-form.search-by-keyword( - data-src=`${endpoints.resources}` - fields='keyword(name_keyword)' - label-name_keyword=`${data.SearchByName}` - widget-name_keyword="solid-form-placeholder-text" - naked - ) - - div.keyword_submit.button__actions - div.button_base.ico_gauche=`${data.Search}` //- solid-form.instance_database_only( //- data-src=`${endpoints.resources}`, @@ -40,14 +26,15 @@ container.block_list solid-form-search.more_criterias.flex.flex_espace( id="entrepreneur-filter-form" - data-src=`${endpoints.resources}`, - fields='format, publication_year, country, languages, fields, type' + data-src=`${endpoints.resources}` + fields='resources_search, format, publication_year, country, languages, fields, type' label-header_criterias=`${data.MoreCriterias}` label-format=`${data.Format}` label-publication_year=`${data.DatePublication}` label-country=`${data.CountryPublication}` label-languages=`${data.Language}` label-fields=`${data.Field}` + label-resources_search=`${data.SearchByName}` range-languages=`${endpoints.languages}` range-fields=`${endpoints.fields}` @@ -60,6 +47,7 @@ container.block_list widget-languages='solid-form-dropdown-label' widget-format='solid-form-dropdown-label' widget-fields='solid-form-dropdown-label' + class-resources_search='w_100' naked ) @@ -117,12 +105,13 @@ container.block_list solid-display.resource_by_step( data-src=`${endpoints.step1}` filtered-by="entrepreneur-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' - widget-resource_author="hidden-widget" + widget-resource_author='hidden-widget' widget-format.name='cs-display-resource-property' label-format.name='' class="panel" @@ -150,12 +139,13 @@ container.block_list solid-display.resource_by_step( data-src=`${endpoints.step2}` filtered-by="entrepreneur-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' - widget-resource_author="hidden-widget" + widget-resource_author='hidden-widget' widget-format.name='cs-display-resource-property' label-format.name='' class="panel" @@ -182,8 +172,9 @@ container.block_list solid-display.resource_by_step( data-src=`${endpoints.step3}` filtered-by="entrepreneur-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -216,12 +207,13 @@ container.block_list solid-display.resource_by_step( data-src=`${endpoints.step4}` filtered-by="entrepreneur-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' - widget-resource_author="hidden-widget" + widget-resource_author='hidden-widget' widget-format.name='cs-display-resource-property' label-format.name='' class="panel" @@ -249,8 +241,9 @@ container.block_list solid-display.resource_by_step( data-src=`${endpoints.step5}` filtered-by="entrepreneur-filter-form" - fields="name, resource_author, format.name, publication_year, description" - + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -282,8 +275,9 @@ container.block_list solid-display.resource_by_step( data-src=`${endpoints.step6}` filtered-by="entrepreneur-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' diff --git a/src/includes/mentor/resources/database.pug b/src/includes/mentor/resources/database.pug index 6f405cac..f4924e07 100644 --- a/src/includes/mentor/resources/database.pug +++ b/src/includes/mentor/resources/database.pug @@ -19,23 +19,7 @@ container.block_list.flex.flex_espace div.block-g-entre div h2.title_form= `${data.SearchForResource}` - div#resources-mentor-database-loader - hidden - i.fas.fa-spinner.fa-spin - - solid-form.search-by-keyword( - data-src=`${endpoints.resources}`, - loader-id="resources-mentor-database-loader" - fields='keyword(name_keyword)' - label-name_keyword=`${data.SearchByNam}` - widget-name_keyword="solid-form-placeholder-text" - - naked - ) - div.keyword_submit.button__actions - div.button_base.ico_gauche=`${data.Search}` - //- solid-form.instance_database_only( //- data-src=`${endpoints.resources}`, //- fields='instance_database_only' @@ -47,15 +31,14 @@ container.block_list.flex.flex_espace solid-form-search.more_criterias.flex.flex_espace( id="database-filter-form" data-src=`${endpoints.resources}` - fields='keyword(name), format, publication_year, country, languages, fields, type' - + fields='resources_search, format, publication_year, country, languages, fields, type' label-header_criterias=`${data.MoreCriterias}` label-format=`${data.Format}` label-publication_year=`${data.DatePublication}` label-country=`${data.CountryPublication}` label-languages=`${data.Language}` label-fields=`${data.Field}` - label-name=`${data.SearchByName}` + label-resources_search=`${data.SearchByName}` range-languages=`${endpoints.languages}` range-fields=`${endpoints.fields}` @@ -63,13 +46,12 @@ container.block_list.flex.flex_espace range-country=`${endpoints.countries}` range-type=`${endpoints.types}` - class-keyword='w_100' widget-type='solid-form-dropdown-label' widget-country='solid-form-dropdown-label' widget-languages='solid-form-dropdown-label' widget-format='solid-form-dropdown-label' widget-fields='solid-form-dropdown-label' - widget-name="solid-form-placeholder-label-text" + class-resources_search='w_100' naked ) @@ -113,8 +95,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step1}` filtered-by="database-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -143,8 +126,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step2}` filtered-by="database-filter-form" - fields='name, resource_author, format.name, publication_year, description' + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -173,8 +157,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step3}` filtered-by="database-filter-form" - fields='name, resource_author, format.name, publication_year, description' + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -203,8 +188,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step4}` filtered-by="database-filter-form" - fields='name, resource_author, format.name, publication_year, description' + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -233,8 +219,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step5}` filtered-by="database-filter-form" - fields='name, resource_author, format.name, publication_year, description' + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -263,8 +250,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step6}` filtered-by="database-filter-form" - fields='name, resource_author, format.name, publication_year, description' + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' diff --git a/src/includes/public/resources/list.pug b/src/includes/public/resources/list.pug index 08745464..e9f43a04 100644 --- a/src/includes/public/resources/list.pug +++ b/src/includes/public/resources/list.pug @@ -13,21 +13,6 @@ container.block_list.flex.flex_espace div.w_75.block-g-entre div h2.title_form=`${data.SearchForResource}` - div#public-resources-loader - hidden - i.fas.fa-spinner.fa-spin - solid-form.search-by-keyword( - data-src=`${endpoints.resources}`, - loader-id="public-resources-loader" - fields='keyword(name_keyword)' - label-name_keyword=`${data.SearchByName}` - widget-name_keyword="solid-form-placeholder-text" - - naked - ) - - div.keyword_submit.button__actions - div.button_base.ico_gauche=`${data.Search}` //- solid-form.instance_database_only( //- data-src=`${endpoints.resources}`, @@ -40,13 +25,14 @@ container.block_list.flex.flex_espace solid-form-search.more_criterias.flex.flex_espace( id="public-filter-form" data-src=`${endpoints.resources}`, - fields='format, publication_year, country, languages, fields, type' + fields='resources_search, format, publication_year, country, languages, fields, type' label-header_criterias=`${data.MoreCriterias}` label-format=`${data.Format}` label-publication_year=`${data.DatePublication}` label-country=`${data.CountryPublication}` label-languages=`${data.Language}` label-fields=`${data.Field}` + label-resources_search=`${data.SearchByName}` range-languages=`${endpoints.languages}` range-fields=`${endpoints.fields}` @@ -59,6 +45,7 @@ container.block_list.flex.flex_espace widget-languages='solid-form-dropdown-label' widget-format='solid-form-dropdown-label' widget-fields='solid-form-dropdown-label' + class-resources_search='w_100' naked ) @@ -102,8 +89,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step1}` filtered-by="public-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -132,8 +120,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step2}` filtered-by="public-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -163,8 +152,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step3}` filtered-by="public-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -194,8 +184,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step4}` filtered-by="public-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -224,8 +215,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step5}` filtered-by="public-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' @@ -253,8 +245,9 @@ container.block_list.flex.flex_espace solid-display.resource_by_step( data-src=`${endpoints.step6}` filtered-by="public-filter-form" - fields="name, resource_author, format.name, publication_year, description" + fields="name, resource_author, format.name, publication_year, description, resources_search(name, description, resource_author)" + widget-resources_search='hidden-widget' widget-name='cs-display-property' widget-publication_year='cs-display-property' widget-description='cs-display-property' diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 70e9b3d5..99fad85f 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -227,7 +227,6 @@ function selectHiddenManagementForType(tab, form) { let type_field_search = tab .querySelector(`solid-display`) .getAttribute("data-src"); - //Fullfill hidden field let hidden_type_select = form.querySelector('select[name="type"]'); @@ -290,23 +289,24 @@ function manageAccordionByStep(){ acc[i].addEventListener("click", function() { var panel = this.nextElementSibling.querySelector("sib-form + div"); + if (panel) { + if (this.classList.contains("active") == true) { + this.classList.remove("active"); + panel.style.maxHeight = "0px"; + } else { + this.classList.add("active"); + } - if (this.classList.contains("active") == true) { - this.classList.remove("active"); - panel.style.maxHeight = "0px"; - } else { - this.classList.add("active"); - } - - this.closest(".step") - .querySelector("nav") - .removeAttribute("hidden"); - refreshPagination(); + this.closest(".step") + .querySelector("nav") + .removeAttribute("hidden"); + refreshPagination(); - if (panel.style.maxHeight) { - panel.style.maxHeight = null; - } else { - panel.style.maxHeight = panel.scrollHeight + "px"; + if (panel.style.maxHeight) { + panel.style.maxHeight = null; + } else { + panel.style.maxHeight = panel.scrollHeight + "px"; + } } }); } @@ -488,40 +488,6 @@ function addProperFilterToSearchComponents(targetId, filterFormId) { selectHiddenManagementForType(tab, form); }); } - - //MORE CRITERIAS - const more_criterias_form = baseElement.querySelectorAll( - ".more_criterias" - )[0]; - more_criterias_form.addEventListener("populate", e => { - //SEARCH BY KEYWORD - //To retrieve keyword - //https://git.happy-dev.fr/startinblox/framework/sib-core/issues/379 - //TODO: Wait for a solution to filter with multiple value with "OR" instead of "AND". - let keyword_form = baseElement.querySelectorAll(".search-by-keyword")[0]; - let keyword_field = keyword_form.querySelector( - `input[name="name_keyword"]` - ); - - if (keyword_field) { - let keyword_submit = baseElement.querySelectorAll(" .keyword_submit")[0]; - let keyword_hidden_fields = baseElement.querySelectorAll( - 'hidden-widget[name="search_for_a_resource"] input' - ); - - keyword_submit.addEventListener("click", function() { - keyword_hidden_fields.forEach(hidden_field => { - hidden_field.setAttribute("value", keyword_field.value); - hidden_field.value = keyword_field.value; - - let parent_form = hidden_field.closest("solid-form"); - parent_form.component.inputChange(); - parent_form.dispatchEvent(new CustomEvent('formChange')); - refreshPagination(); - }); - }); - } - }); } async function refreshDatabase(targetElement) { diff --git a/src/styles/index.scss b/src/styles/index.scss index 1f401c9e..94877fc8 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -603,7 +603,9 @@ solid-form-search > form { flex-direction: row; flex-wrap: wrap; justify-content: space-between; - & > solid-form-dropdown-label[name="type"] { + & > solid-form-dropdown-label[name="type"], + .form-input-hidden { + // solid-form-label-text[name="description"] { display: none; } } diff --git a/translation/en.yml b/translation/en.yml index d90db6f7..6b24fcc8 100644 --- a/translation/en.yml +++ b/translation/en.yml @@ -14,7 +14,7 @@ RequestedResources: Requested resources HistoryResources : History of your resources ConnectKnowledgeBase : Connect to the knowledge base AccessWithoutRegistration : Access without registration -SearchByName : Search by name +SearchByName : Search by name or description MoreCriterias : More criterias Language : Language CountryPublication : Country of publication -- GitLab From d152c792b2a20118665cf94a26da73010d86fb1c Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Sun, 30 Aug 2020 23:44:48 +0200 Subject: [PATCH 4/6] Fixing the display of the related everywhere --- src/includes/components/widgets.pug | 36 ----------------------------- src/includes/mentor/dashboard.pug | 7 +++--- src/styles/index.scss | 15 ++++-------- 3 files changed, 9 insertions(+), 49 deletions(-) diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index b9268166..1afd455a 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -83,42 +83,6 @@ solid-widget(name='cs-display-checkbox') input(type='checkbox' name="instance_database_only") label(for="instance_database_only") Search in Coopstarter database only -solid-widget(name='cs-display-mentor-database-related') - template - p - solid-link( - bind-resources - data-src="${await value}" - next="mentor-database-resource-detail" - ) ${await value.name} - -solid-widget(name='cs-display-mentor-related') - template - p - solid-link( - bind-resources - data-src="${await value}" - next="mentor-resource-detail" - ) ${await value.name} - -solid-widget(name='cs-display-public-related') - template - p - solid-link( - bind-resources - data-src="${await value}" - next="public-resource-detail" - ) ${await value.name} - -solid-widget(name='cs-display-entrepreneur-related') - template - p - solid-link( - bind-resources - data-src="${await value}" - next="entrepreneur-resource-detail" - ) ${await value.name} - solid-widget(name='cs-resource-status') template div ${await value == 'pending' ? `<div class="button_base button_pending">#{data.PendingValidation}</div>` : (await value == 'to_improve' ? `<div class="button_base button_improvement">#{data.ImprovementRequired}</div>` : (await value == 'validated' ? `<div class="button_base button_validated">#{data.Published}</div>` : `<div class="button_base button_disputed">#{data.Refused}</div>` ) ) } diff --git a/src/includes/mentor/dashboard.pug b/src/includes/mentor/dashboard.pug index 3c4a4faa..1231ec34 100644 --- a/src/includes/mentor/dashboard.pug +++ b/src/includes/mentor/dashboard.pug @@ -78,9 +78,10 @@ section#home solid-display( bind-resources fields="related" - empty-widget="cs-empty-widget" - multiple-related='cs-display-mentor-database-related' - multiple-related-fields='name, value' + + multiple-related + multiple-related-fields='name' + multiple-related-next="mentor-database-resource-detail" label-related='' ) diff --git a/src/styles/index.scss b/src/styles/index.scss index 94877fc8..d0a9bba9 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -2040,7 +2040,8 @@ cs-display-public-related { } cs-display-mentor-database-related, cs-display-public-related, -cs-display-mentor-related, cs-display-entrepreneur-related { +cs-display-mentor-related, cs-display-entrepreneur-related, +solid-multiple[name="related"] solid-display-value { display: block; float: left; width: 33%; @@ -2049,15 +2050,9 @@ cs-display-mentor-related, cs-display-entrepreneur-related { background: var(--bg-btn-base); margin: 5px; cursor: pointer; - p{ - text-align: center; - margin:0; - font-size: 1.4rem; - color: var(--clr-roll-black); - solid-link { - color: #FFFFFF; - } - } + text-align: center; + font-size: 1.4rem; + color: #FFFFFF; } #mentor-resource-detail h2.title_form.related, -- GitLab From 78850a71a869cbbd7d15a9a03763810bdd9baf97 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Mon, 31 Aug 2020 00:06:01 +0200 Subject: [PATCH 5/6] Some css fixes --- src/styles/index.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/styles/index.scss b/src/styles/index.scss index d0a9bba9..a21d4dd2 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -2044,7 +2044,7 @@ cs-display-mentor-related, cs-display-entrepreneur-related, solid-multiple[name="related"] solid-display-value { display: block; float: left; - width: 33%; + width: 31%; border-radius: 3px; padding: 2rem 0; background: var(--bg-btn-base); @@ -2053,6 +2053,10 @@ solid-multiple[name="related"] solid-display-value { text-align: center; font-size: 1.4rem; color: #FFFFFF; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + display: -webkit-box; + overflow-y: hidden; } #mentor-resource-detail h2.title_form.related, -- GitLab From 096004c257cdb18ed9b88daeca393edbaf8039aa Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Mon, 31 Aug 2020 00:21:00 +0200 Subject: [PATCH 6/6] Few css fixes --- src/styles/index.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/styles/index.scss b/src/styles/index.scss index a21d4dd2..9f2f9d82 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1992,7 +1992,7 @@ solid-multiple-label[name="skills"] { display: inline; } div, solid-display-value { - font-family: 'var(--typo-btn)'; + font-family: $font-stack; display: inline; text-align: center; margin:0; @@ -2023,6 +2023,7 @@ solid-set-default[name="specifications"] > solid-multiple { } &>div, & solid-display-value { display: inline; + font-weight: lighter; } p{ display: inline; -- GitLab