diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index 2cf625e45f81e6b36b1c74923e9c60ca46767bad..7a6dc60171780f166afb938d47a4b3bff75a8f33 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -41,7 +41,7 @@ sib-widget(name='cs-display-title') sib-widget(name='cs-display-checkbox') template - label Search in Coopstarter database only + label(for="instance_database_only") Search in Coopstarter database only input(type='checkbox') sib-widget(name='cs-display-related-property') @@ -143,4 +143,9 @@ sib-widget(name="fake-like") sib-widget(name="fake-dislike") template p 18 <i class="fas fa-thumbs-up"></i> - \ No newline at end of file + +sib-widget(name="accordion-request-resource" ) + template + div + h2 ${value} + diff --git a/src/includes/entrepreneur/dashboard.pug b/src/includes/entrepreneur/dashboard.pug index 106a3a9963c677f1abb6f98ab305e1894a2420ab..16075cd248e755a5eaed4dddba917d3c1c78640c 100644 --- a/src/includes/entrepreneur/dashboard.pug +++ b/src/includes/entrepreneur/dashboard.pug @@ -22,6 +22,7 @@ section#home sib-router sib-route(name='entrepreneur-request-create') sib-route(name='entrepreneur-request-validation') + sib-route(name='entrepreneur-resource-detail') dialog#entrepreneur-request-create.no-sidebar.container include ./requests/create.pug @@ -31,6 +32,9 @@ section#home p.flex sib-link(next='entrepreneur-resource-list', class='button_base') Ok + dialog#entrepreneur-resource-detail.no-sidebar + include resources/detail.pug + #entrepreneur-account(hidden).no-sidebar.container include profile/detail.pug diff --git a/src/includes/entrepreneur/requests/create.pug b/src/includes/entrepreneur/requests/create.pug index 36925b483395bb5ab8b99c4ec53f16ff6b6d9a34..fcbce15e621f73864fa57fa7cb97d141e292f870 100644 --- a/src/includes/entrepreneur/requests/create.pug +++ b/src/includes/entrepreneur/requests/create.pug @@ -6,13 +6,13 @@ p You can't find a resource you are looking for ? You need resources to acquire sib-form#resource-creation-form( data-src=`${endpoints.requests}` fields="mandatory_information(header_mandatory, name, description, country, language),\ - complementary_information(header_complementary, field, organisation, skills)" + complementary_information(header_complementary, fields, organisation, skills)" widget-header_mandatory='cs-section_header' widget-header_complementary='cs-section_header' range-language=`${endpoints.languages}` - range-field=`${endpoints.fields}` + range-fields=`${endpoints.fields}` range-organisation=`${endpoints.organisations}` label-header_mandatory='Mandatory information' @@ -26,8 +26,8 @@ p You can't find a resource you are looking for ? You need resources to acquire label-organisation='Organisation' label-skills='What do you need to learn with this resource ?' - multiple-field='sib-multiple-select' - widget-field='sib-form-auto-completion' + multiple-fields='sib-multiple-select' + widget-fields='sib-form-auto-completion' multiple-language='sib-multiple-select' widget-language='sib-form-auto-completion' diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f335a39274f25e8c5660f0096a50409b484f01cd 100644 --- a/src/includes/entrepreneur/resources/detail.pug +++ b/src/includes/entrepreneur/resources/detail.pug @@ -0,0 +1,125 @@ +include ../../components/widgets + +.block_log.block_creat_count.no_shadow + sib-link(class="backlink", next="entrepreneur-resource-list") + .like + p.backlink + i.fas.fa-times + + div#detail-entrepreneur-loader + hidden Loading resources, please wait... + + sib-display( + loader-id="detail-entrepreneur-loader" + bind-resources, + fields='name, steps, format, \ + submitter_info(submitter.account.picture, submitter.name, \ + submitter.mentor_profile.organisation.name, skills, uri, broken),\ + content(preview_image, tags),\ + description, review.reviewer.account.picture, review.reviewer.name,\ + copyright, specifications(\ + header_specifications, author, country, language.name,\ + publication_year, fields, sharing)', + + widget-submitter.name='cs-display-resource-property', + class-name="title_form" + class-steps="steps" + widget-author='cs-display-resource-property', + widget-country='cs-display-resource-property', + widget-submitter.mentor_profile.organisation.name='cs-display-resource-property' + class-submitter.name="autor_ressource" + class-broken="broken" + widget-format='cs-display-multiple-property' + widget-uri='cs-display-link' + class-uri="pull-left" + widget-skills='cs-display-resource-property' + widget-description='cs-display-property' + widget-name='cs-display-property' + widget-publication_year='cs-display-resource-property' + widget-sharing='cs-display-resource-property' + widget-language.name='cs-display-resource-property' + widget-submitter.account.picture='cs-account-picture' + widget-broken='cs-broken-action' + widget-preview_image='cs-preview-picture' + widget-review.reviewer.account.picture='cs-account-picture' + widget-review.reviewer.name='cs-resource-reviewer' + class-review.reviewer.name="validator_ressource" + widget-header_specifications='cs-section_header' + + label-broken='Report broken link' + label-sharing='Access:' + label-language.name='Language:' + label-publication_year='Year of publication:' + label-header_specifications='Resource specifications' + each-label-format='' + label-format='' + multiple-format + + widget-steps='cs-display-step-property' + label-steps='' + each-label-steps="Step" + multiple-steps + + widget-fields='cs-display-multiple-property' + label-fields='' + each-label-fields='Field:' + multiple-fields + + label-skills='With this resource, you will be able to:' + label-uri='Link to resource' + name-uri='original-link' + label-country='Country:' + label-submitter.mentor_profile.organisation.name='Organisation:' + label-author='Author :' + label-submitter.name='Resource posted by:' + action-broken='resource-report-broken-link' + ) + + //- Add likes here + <div class="like"> + <p class="backlink"><i class='far fa-thumbs-up'></i>18</p> + <p class="backlink"><i class='far fa-thumbs-down'></i>3</p> + </div> + + sib-display( + bind-resources + fields="" + nested-field="likes" + counter-template="<p><i class='fas fa-thumbs-up'></i>${counter}</p>" + ) + + sib-display( + bind-resources + fields="" + nested-field="dislikes" + counter-template="<p><i class='fas fa-thumbs-down'></i>${counter}</p>" + ) + + sib-display( + bind-resources + fields="" + nested-field="conversations" + counter-template="<p>Comments (${counter})</p>" + ) + + sib-conversation( + bind-resources + id-suffix="conversations" + ) + + h2.title_lead_avenir Related resources + + sib-display( + bind-resources, + nested-field="related" + fields="name, detail" + + widget-name='cs-display-property' + label-detail='' + widget-detail='sib-action' + action-detail='mentor-resource-detail' + ) + + + + \ No newline at end of file diff --git a/src/includes/entrepreneur/resources/list.pug b/src/includes/entrepreneur/resources/list.pug index 9dbf5f83375b1f5e91fbfe4c1ed0da63b4c94a01..edd6cffe69e21db3c6f0e5a2b929a9ad5043531e 100644 --- a/src/includes/entrepreneur/resources/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -149,9 +149,9 @@ container.block_list.flex.flex_espace multiple-language label-fields='' multiple-fields - class="panel" - + next='entrepreneur-resource-detail' + paginate-by="5" ) @@ -206,9 +206,9 @@ container.block_list.flex.flex_espace multiple-language label-fields='' multiple-fields - class="panel" - + next='entrepreneur-resource-detail' + paginate-by="5" ) @@ -263,9 +263,9 @@ container.block_list.flex.flex_espace multiple-language label-fields='' multiple-fields - class="panel" - + next='entrepreneur-resource-detail' + paginate-by="5" ) @@ -321,9 +321,9 @@ container.block_list.flex.flex_espace multiple-language label-fields='' multiple-fields - class="panel" - + next='entrepreneur-resource-detail' + paginate-by="5" ) @@ -378,9 +378,9 @@ container.block_list.flex.flex_espace multiple-language label-fields='' multiple-fields - class="panel" - + next='entrepreneur-resource-detail' + paginate-by="5" ) diff --git a/src/includes/mentor/dashboard.pug b/src/includes/mentor/dashboard.pug index d27b1086ffc92656efe1fc7fdea92a04c4dbe13d..eda3a64603191c48042037146fcb4c438811dbe8 100644 --- a/src/includes/mentor/dashboard.pug +++ b/src/includes/mentor/dashboard.pug @@ -27,9 +27,8 @@ section#home include resources/validate.pug sib-link(class="backlink", next="mentor-resource-list") Back to the dashboard - dialog#resource-validation-process - h1 What is a validation process ? - sib-link(class="backlink pull-right", next="mentor-resource-list") X + dialog#resource-validation-process.no-sidebar + include ./validation-process.pug #mentor-resource-create(hidden).no-sidebar.container sib-link(class="backlink", next="mentor-resource-list") Back to the dashboard diff --git a/src/includes/mentor/resources/confirmation.pug b/src/includes/mentor/resources/confirmation.pug index 964d2811175285abc28c892dfb73615d595c3d7b..766dc355773eea7e1c79efd64ccbb1da04cda23f 100644 --- a/src/includes/mentor/resources/confirmation.pug +++ b/src/includes/mentor/resources/confirmation.pug @@ -15,8 +15,7 @@ div.block_list sib-route(name='resource-validation-process_confirmation') dialog#resource-validation-process_confirmation - h1 What is a validation process ? - sib-link(class="backlink pull-right", next="resource-creation-confirmation") X + include ../validation-process.pug sib-link(class="backlink pull-right", next="resource-validation-process_confirmation") What is a validation process ? diff --git a/src/includes/mentor/resources/detail.pug b/src/includes/mentor/resources/detail.pug index 08f394178fa52c8f5b9638d97a69f78cd35052f9..8eb75dd70b7d4a9513ea580599fa86b21a633b93 100644 --- a/src/includes/mentor/resources/detail.pug +++ b/src/includes/mentor/resources/detail.pug @@ -8,9 +8,10 @@ include ../../components/widgets sib-display( bind-resources, - fields='name, steps, format, content(preview_image, tags),\ + fields='name, steps, format,\ submitter_info(submitter.account.picture, submitter.name, \ submitter.mentor_profile.organisation.name, skills, uri, broken),\ + content(preview_image, tags),\ description, review.reviewer.account.picture, review.reviewer.name,\ copyright, specifications(\ header_specifications, author, country, language.name,\ diff --git a/src/includes/mentor/resources/list.pug b/src/includes/mentor/resources/list.pug index f5bcf2f2e5c2a07703beb9171c92fbe7472db0d7..a1baf444b5e540b0fde2664fddb407793ab1125b 100644 --- a/src/includes/mentor/resources/list.pug +++ b/src/includes/mentor/resources/list.pug @@ -62,7 +62,7 @@ div.block_list sib-display.request_accordeon( loader-id="loader-requests-mentor" data-src=`${endpoints.requests}` - fields='content(name, description), info(fields, language.name, target), create', + fields='name, content(description, info(fields, language.name, target), create)', label-target='Target audience:' label-language.name='Language:' @@ -72,6 +72,7 @@ div.block_list widget-fields='cs-display-multiple-property' widget-language.name='cs-display-resource-property' widget-target='cs-display-resource-property' + widget-name='accordion-request-resource' label-create='Post a resource' action-create="mentor-resource-create" diff --git a/src/includes/mentor/validation-process.pug b/src/includes/mentor/validation-process.pug new file mode 100644 index 0000000000000000000000000000000000000000..174fc17a95254c76a7dc68d6c8b912b8c40da51c --- /dev/null +++ b/src/includes/mentor/validation-process.pug @@ -0,0 +1,33 @@ +div.block_log.block_creat_count.no_shadow + sib-link(class="backlink pull-right", next="mentor-resource-list") X + div#validation-process + h2 What is a validation process ? + div + figure + img( src="http://placekitten.com/g/150/150" + alt="") + figcaption Mentor upload a resource to the database + + figure( + img src="http://placekitten.com/1/300" + alt="" + ) + figcaption Resource is sent to qualified peers for validation + + + div + figure + img( src="http://placekitten.com/g/150/150" + alt="") + figcaption Resource is validated and becomes available in the database + + figure + img( src="http://placekitten.com/g/150/150" + alt="") + figcaption Resource is not validated and improvement is siggested. You get a list of improvement, can edit ans re-load the resource. It goes to validation process again.L0 + + figure + img( src="http://placekitten.com/g/150/150" + alt="") + figcaption Resource is reported inapropriate. You get a notification with a message from your peer explaning why. + \ No newline at end of file diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index f9988c8757d81851fd058bea75d274547184e82e..a81d3d98f07d8ba0a9aaae9c94d0c057193245fd 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -168,6 +168,33 @@ jQuery(document).ready(function($) { }); } + //MENTOR DASHBOARD************************************************************* + window.setTimeout(() => { + + //Manage the accordion in request mentor dashboard. + var accRequest = document.querySelectorAll( + "#requests accordion-request-resource" + ); + console.log(accRequest); + var i; + + for (i = 0; i < accRequest.length; i++) { + accRequest[i].addEventListener("click", function() { + /* Toggle between adding and removing the "active" class, + to highlight the button that controls the panel */ + this.classList.toggle("active"); + + /* Toggle between hiding and showing the active panel */ + var panelRequest = this.nextElementSibling; + if (panelRequest.style.maxHeight) { + panelRequest.style.maxHeight = null; + } else { + panelRequest.style.maxHeight = panelRequest.scrollHeight + "px"; + } + }); + } + }, 4000); + //ENTREPRENEUR DASHBOARD************************************************************* //Accordion by step diff --git a/src/styles/index.scss b/src/styles/index.scss index 058183d4ca2a15b814d0d526aa61e26755959c19..99c68bf4e432f67083a3c15744d3dafb9977ae3c 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1232,6 +1232,13 @@ cs-validate-action div{ text-align: right; } +#requests sib-set-default[name="content"] { + padding: 0 18px; + max-height: 0; + overflow: hidden; + transition: max-height 0.2s ease-out; + } + /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX PROFILE XXXXXXXXXXXXXXXXXXXXX