Skip to content
Snippets Groups Projects
Commit 9ffe7276 authored by DELARUELLE Myriam's avatar DELARUELLE Myriam
Browse files

fix css description sections et header

parent d9c71425
No related branches found
No related tags found
Loading
...@@ -73,10 +73,35 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro ...@@ -73,10 +73,35 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
}; };
(function () { (function () {
$(".description-inner").each(function(index){
if(parseInt($( this ).css('height'))<=144){
$(this).parent().next().hide();
}
})
//Gère les animations sur les descriptions des sections pour agrandir/rétrecir les infos
$('.section').find('a[href="#"].voir-plus').on('click', function (e) { $('.section').find('a[href="#"].voir-plus').on('click', function (e) {
e.preventDefault(); e.preventDefault();
this.expand = !this.expand; this.expand = !this.expand;
$(this).text(this.expand?"Réduire la description":"Voir la description complète"); $(this).text(this.expand?"Réduire la description":"Voir la description complète");
$(this).closest('.section').find('.small, .big').toggleClass('small big'); //$(this).closest('.section').find('.small, .big').toggleClass('small big');
//
if($(this).prev().hasClass('small')){
$(this).prev().toggleClass('small big');
var height= $(this).prev().find(".description-inner").css("height");
$(this).prev().animate({ "max-height": height }, "slow" );
}
else if($(this).prev().hasClass('big')){
$(this).prev().toggleClass('small big');
$(this).prev().animate({ "max-height": '144px' }, "slow" );
}
else{
$(this).prev().addClass("big");
var height= $(this).prev().find(".description-inner").css("height");
$(this).prev().animate({ "max-height": height }, "slow" );
}
}); });
}(jQuery)); }(jQuery));
\ No newline at end of file
...@@ -55,6 +55,12 @@ ul.iena-editing .voir-plus { ...@@ -55,6 +55,12 @@ ul.iena-editing .voir-plus {
border-bottom-right-radius: 7px; border-bottom-right-radius: 7px;
} }
.voir-plus{
margin-left: 3%;
margin-top: 14px;
}
.iena-section .instancename { .iena-section .instancename {
font-size: 1rem; font-size: 1rem;
} }
...@@ -272,13 +278,28 @@ ul.nav.navbar-nav.ml-auto { ...@@ -272,13 +278,28 @@ ul.nav.navbar-nav.ml-auto {
} }
.iena-description { .iena-description {
background: #EEE;
color: #323232; color: #323232;
padding: 1rem; padding: 1rem;
clear: both; clear: both;
margin-bottom: 0.5rem; display: flex;
align-items: baseline;
flex-wrap: wrap;
border-top: 1px solid #dee2e6;
} }
.iena-description i{
color:#2a657d;
flex-basis: 3%;
}
.course-description-item.summarytext{
flex-basis: 97%;
overflow:hidden;
max-height: 144px;
}
/* iENA course format header with progression */ /* iENA course format header with progression */
...@@ -354,7 +375,7 @@ ul.nav.navbar-nav.ml-auto { ...@@ -354,7 +375,7 @@ ul.nav.navbar-nav.ml-auto {
.iena-course-header > .iena-course-header-bottom { .iena-course-header > .iena-course-header-bottom {
margin-bottom: 40px; margin-bottom: 40px;
background: #eaeaea; background: #eaeaea;
padding: 15px; padding: 1.5rem;
border-radius:10px; border-radius:10px;
} }
......
...@@ -130,9 +130,18 @@ ...@@ -130,9 +130,18 @@
{{/iscoursedisplaymultipage}}"> {{/iscoursedisplaymultipage}}">
<div class="{{#hasavailability}}description{{/hasavailability}} my-3" data-for="sectioninfo"> <div class="{{#hasavailability}}description{{/hasavailability}} my-3" data-for="sectioninfo">
{{#summary}} {{#summary}}
{{$ core_courseformat/local/content/section/summary }} {{#summarytext}}
{{> core_courseformat/local/content/section/summary }} <div class="iena-summary">
{{/ core_courseformat/local/content/section/summary }} <div class="iena-description">
<i class="fa fa-info-circle" aria-hidden="true"></i>
{{$ core_courseformat/local/content/section/summary }}
{{> core_courseformat/local/content/section/summary }}
{{/ core_courseformat/local/content/section/summary }}
<a href="#" class="voir-plus">Voir la description complète</a>
</div>
</div>
{{/summarytext}}
{{/summary}} {{/summary}}
{{#availability}} {{#availability}}
{{$ core_courseformat/local/content/section/availability }} {{$ core_courseformat/local/content/section/availability }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment