From 9826984755182aaf66028ffa317c096ea1e27023 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Wed, 11 Sep 2019 20:41:37 +0200 Subject: [PATCH] WIP: Dashbord entrepreneur before filtering systeme. --- src/includes/components/widgets.pug | 6 +- src/includes/entrepreneur/resources/list.pug | 61 ++++++++++++++++++-- src/scripts/coopstarter.js | 8 +++ 3 files changed, 67 insertions(+), 8 deletions(-) diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index 906b5124..e605891a 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -125,7 +125,7 @@ sib-widget(name='cs-profile-picture') img(name="${name}", src="\${value || '/images/alien.jpg'}", alt="Coopstarter") -sib-widget(name="hidden-widget") - template - div(data-content style="display:none;") + sib-widget(name="hidden-widget") + template + div(data-content style="display:none;") \ No newline at end of file diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 123d93ec..3d98039f 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -1,6 +1,6 @@ include ../../components/widgets -h2.title_form Search for a resource + //-Question : //In my opinion, "multiple ressource" solution is closer to the wanted result than the "group-by" solution @@ -13,13 +13,64 @@ h2.title_form Search for a resource // +div.block_log.block_list + h2.title_form Search for a resource + sib-form#search-by-keyword( + data-src=`${endpoints.resources}`, + fields='keyword(name_keyword, description, author)' + label-keyword="Search by author, name..." + widget-keyword="sib-form-placeholder-text" -#circles + widget-description='cs-display-property' + widget-name_keyword='cs-display-property' + widget-author='cs-display-property' + ) - sib-widget(name="hidden-widget") - template - div(data-content style="display:none;") + sib-form#circles-list( + data-src=`${endpoints.resources}`, + fields='more_criterias( format, publication_year, country, language.name, fields, steps)' + + label-header_criterias='More criterias' + label-format='Format' + label-publication_year='Year of publication' + label-country='Country of publication' + label-language.name='Language' + label-fields='Field' + label-steps='Step of : Staring up a cooperative business' + widget-instance_database_only='cs-display-checkbox' + widget-header_criterias='cs-section_header' + + range-language.name=`${endpoints.languages}` + range-fields=`${endpoints.fields}` + range-steps=`${endpoints.steps}` + range-format=`${endpoints.formats}` + + multiple-language='sib-multiple-select' + widget-language='sib-form-auto-completion' + + multiple-field='sib-multiple-select' + widget-field='sib-form-auto-completion' + + multiple-step='sib-multiple-select' + widget-step='sib-form-auto-completion' + + + naked + ) + +//- form +//- div +//- label(for="name") Enter your name +//- input(type="text" name="name" id="name" ) + +//- div +//- button(value="Search") + + + + +#circles sib-display#circles-list( data-src=`${endpoints.steps}1/`, fields='name' diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 73ff168c..4216e0d5 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -33,6 +33,8 @@ function refreshList(formId, listId) { }); } + + jQuery(document).ready(function($) { // Get the element with id="defaultOpen" and click on it document.getElementById("defaultOpen").click(); @@ -55,4 +57,10 @@ jQuery(document).ready(function($) { document.querySelector('sib-auth').logout(); setTimeout(function(){ location.reload(); }, 1000); }) + + const myForm = document.getElementById('search-by-keyword') + const keyword_field = myForm.querySelector('input[name=keyword') + + console.log(keyword_field) + }); \ No newline at end of file -- GitLab