Skip to content
Snippets Groups Projects
Commit 26759436 authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

display/hide course infos but with jquery

parent 6675e556
No related branches found
No related tags found
No related merge requests found
...@@ -16,53 +16,51 @@ ...@@ -16,53 +16,51 @@
/** /**
* Handle add/remove competency links. * Handle add/remove competency links.
* *
* @module tool_lp/competencies * @module format_iena/suivi
* @package tool_lp * @package format_iena
* @copyright 2015 Damyon Wiese <damyon@moodle.com> * @copyright 2021 Myriam Delaruelle
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
define(['jquery'], define(['jquery', 'core/ajax', 'core/str'],
function($, notification, ajax, templates, str, Picker, dragdrop, Pending) { function($, ajax, str) {
return{
registerHeader:function(){
$("#button-collapse").click(function(){
if($("#summary-wrapper").hasClass('collapsed')){
$("#summary-wrapper").animate({ "max-height": '7rem' }, "slow" );
var message=str.get_string('displayInfos', 'format_iena');
$.when(message).done(function(localizedEditString) {
$("#button-collapse").text(localizedEditString);
});
/** }
* Pick a competency else{
* var height= $("#summary-collapse").css("height");
* @method pickCompetency $("#summary-wrapper").animate({ "max-height": height }, "slow" );
* @return {Promise} var message=str.get_string('hideInfos', 'format_iena');
*/ $.when(message).done(function(localizedEditString) {
$("#button-collapse").text(localizedEditString);
function registerSelectAll(){ });
$('#iena-select-all').on('click', function(e){
console.log("on sélectionne tout");
select_all_studs(e); }
$("#summary-wrapper").toggleClass("collapsed");
})
}
})
}
function select_all_studs(e) {
//e.preventDefault();
console.log("this one src"); }
var counter = 0;
var checks = document.querySelectorAll("#table-body tr");
for (var i = 0; i < checks.length; i++) {
if ( checks[i].style.display != "none" || data.all_selected ) {
var box = checks[i].querySelector("input[type='checkbox']");
box.checked = !data.all_selected;
counter++;
}
}
if ( counter > 0 ) {
data.all_selected = !data.all_selected;
}
}
console.log("on passe par ici");
//registerSelectAll();
}); });
(function() {
// inclus nul part.
})()
\ No newline at end of file
...@@ -93,5 +93,7 @@ By definition an unnamed section is displayed as <strong>section [N]</strong>.'; ...@@ -93,5 +93,7 @@ By definition an unnamed section is displayed as <strong>section [N]</strong>.';
$string['display_course_infos']="Show/hide course information"; $string['display_course_infos']="Show/hide course information";
$string['my_progress']="My progress in the course: "; $string['my_progress']="My progress in the course: ";
$string['table_progress']="Tracking"; $string['table_progress']="Tracking";
$string['displayInfos']="Display course informations";
$string['hideInfos']="Hide course informations";
...@@ -93,5 +93,7 @@ By definition an unnamed section is displayed as <strong>section [N]</strong>.'; ...@@ -93,5 +93,7 @@ By definition an unnamed section is displayed as <strong>section [N]</strong>.';
$string['display_course_infos']="Afficher/Masquer les informations du cours"; $string['display_course_infos']="Afficher/Masquer les informations du cours";
$string['my_progress']="Ma progression dans le cours : "; $string['my_progress']="Ma progression dans le cours : ";
$string['table_progress']="Suivi des étudiants"; $string['table_progress']="Suivi des étudiants";
$string['displayInfos']="Afficher les infos du cours";
$string['hideInfos']="Masquer les infos du cours";
...@@ -576,19 +576,31 @@ ul.nav.navbar-nav.ml-auto { ...@@ -576,19 +576,31 @@ ul.nav.navbar-nav.ml-auto {
} }
#title-summary-iena{ #summary-wrapper{
padding-left: 0; padding-left: 1px;
display: block;
max-height: 7rem;
height: auto;
overflow: hidden;
margin-bottom: 5px;
} }
#title-summary-iena #summary-collapse.collapse:not(.show) { /*#title-summary-iena #summary-collapse.collapse:not(.show) {
display: block; display: block;
height: 7rem; max-height: 7rem;
height: auto;
overflow: hidden; overflow: hidden;
} }
#title-summary-iena #summary-collapse.collapsing { #title-summary-iena #summary-collapse.collapsing {
height: 4rem; height: auto;
} max-height: 100rem;
-webkit-transition: max-height .35s ease;
-o-transition: max-height .35s ease;
transition: max-height .35s ease;
transition: max-height 1s ease;
}*/;
......
...@@ -68,8 +68,17 @@ ...@@ -68,8 +68,17 @@
<h3> <h3>
{{# str }} aboutcourse, format_iena {{/ str}} {{# str }} aboutcourse, format_iena {{/ str}}
</h3> </h3>
<div class="collapse" id="summary-collapse" aria-expanded="false">{{{ summary }}}</div> <div id="summary-wrapper">
<a role="button" class="collapsed" data-toggle="collapse" href="#summary-collapse" aria-expanded="false" aria-controls="summary-collapse">Afficher / Masquer les infos du cours</a> <div id="summary-collapse" aria-expanded="false">{{{ summary }}}</div>
</div>
<a role="button" href="#" onclick="return false" id="button-collapse" aria-expanded="false" aria-controls="summary-collapse">{{# str }} displayInfos, format_iena {{/ str}}</a>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
{{#js}}
require(['format_iena/header'], function(module) {
module.registerHeader();
});
{{/js}}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment