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] 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