diff --git a/src/includes/mentor/resources/list.pug b/src/includes/mentor/resources/list.pug index 343602564520963a6f032cec3a881c6ddf55a590..ff2f6cf65f3d89b368d4d06c8e34f0432d6437d5 100644 --- a/src/includes/mentor/resources/list.pug +++ b/src/includes/mentor/resources/list.pug @@ -128,6 +128,7 @@ div.block_list widget-review.status='cs-resource-status', search-widget-header_criterias="cs-section_header" search-label-header_criterias="More criterias" + search-class-header_criterias="accordion-form active" search-label-format=`${data.Format}` search-label-publication_year=`${data.DatePublication}` diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 63419cdf47818405f2532061f7a96647a8293b8d..b062022b64f787a1dd1a99b25dab1651450d806c 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -293,6 +293,27 @@ function manageAccordionByStep(){ } } +/** + * Manage the accordion "more criteria" + */ +function manageAccordionMoreCriteria(){ + var acc = document.getElementsByClassName("accordion-form"); + + for (let item of acc) { + item.addEventListener("click", function() { + this.classList.toggle("active"); + + var panelForm = this.nextElementSibling; + if (!this.classList.contains("active")) { + panelForm.style.maxHeight = "0px"; + refreshPagination(); + } else { + panelForm.style.maxHeight = panelForm.scrollHeight + "px"; + } + }); + } +} + /** * Manage the accordion for requested resources in the mentor dashboard */ @@ -894,6 +915,8 @@ jQuery(document).ready(function($) { window.setTimeout(() => { //Manage accordion by step manageAccordionByStep(); + //manage accordion for "More criteria" + manageAccordionMoreCriteria(); //Init the form file behaviour // initFileUpload(); diff --git a/src/styles/index.scss b/src/styles/index.scss index bba7c75542d7e2c20a2b6b4d090f0dfe58601d2b..4e5e9260782518b5ce254f09754d4becfe200c9b 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1482,6 +1482,31 @@ sib-multiple label, cs-resource-status[name="review.status"]+*{ max-height: 1500px; } } + +/* Enable the accordion of "more criteria form"*/ +sib-set-default[name="more_criterias_hidden"]{ + max-height: 235px; + overflow: hidden; + transition: max-height 0.2s ease-out; +} + +.accordion-form h2{ + position : relative +} +.accordion-form h2:after { + font-family: "Font Awesome 5 pro"; + content: "\f078"; + font-weight: 900; + right: 0; + position: absolute; + transform-origin: .7rem .7rem; + transform: rotate(0); +} + +.accordion-form.active h2:after { + transform: rotate(-90deg); +} + /*XXXXXXXXXXXXXXXXXXXXX DETAIL RESSOURCES XXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/ .format_type p{ border-radius: 5px;