Commit 21095e6f authored by Thomas Fradet's avatar Thomas Fradet
Browse files

path diplay improvement

parent d5909453
...@@ -28,5 +28,23 @@ Deprecated: Non-static method block_career_ressource::get_ressources_by_id_secti ...@@ -28,5 +28,23 @@ Deprecated: Non-static method block_career_ressource::get_ressources_by_id_secti
[x] La méthode est déclarée static [x] La méthode est déclarée static
#### 5
Notice: Undefined variable: imagePath in /Applications/MAMP/htdocs/moodle37/blocks/career/view/view_career_setting.php on line 169
[x] Suppression d'un morceau de code restant faisant appel à l'image (fonctionnalité de représenter un parcours par une image, précédemment abandonnée).
## Améliorations diverses
### Vue du parcours
#### Decriptions parcours et sections
Suppression de la possibilité de plier / déplier les description de parcours et de section en raison du bug de taille d'affichage.
#### Affichage des titres et liste ressources
Amélioration de l'affichage des titres et de la liste des ressources du parcours.
.btn-career-block { .btn-career-block {
width: 100%; width: 100%;
}
.career-section-title {
background-color: #008196;
}
.career-section-title > h3 {
color: #fafafa;
padding: 0.6rem 1rem;
} }
/*.left { /*.left {
float: left; float: left;
}*/ }*/
/*.img_moodle_course { /*.img_moodle_course {
max-width: 100%; max-width: 100%;
-webkit-border-radius: 50%; -webkit-border-radius: 50%;
-moz-border-radius: 50%; -moz-border-radius: 50%;
border-radius: 50%; border-radius: 50%;
display: block; display: block;
margin: -1px; margin: -1px;
min-height: 64px; min-height: 64px;
min-width: 64px; min-width: 64px;
}*/ }*/
/*.padding_column { /*.padding_column {
padding: 2rem; padding: 2rem;
}*/ }*/
/*.align_center { /*.align_center {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
}*/ }*/
/*.button { /*.button {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
}*/ }*/
/*.img_center { /*.img_center {
top: 1rem; top: 1rem;
left: 1rem; left: 1rem;
}*/ }*/
/*.img_moodle_list { /*.img_moodle_list {
max-width: 100%; max-width: 100%;
-webkit-border-radius: 50%; -webkit-border-radius: 50%;
-moz-border-radius: 50%; -moz-border-radius: 50%;
border-radius: 50%; border-radius: 50%;
display: block; display: block;
margin: -1px; margin: -1px;
height: 32px; height: 32px;
width: 32px; width: 32px;
}*/ }*/
.left_course_elements, .right_course_elements { .left_course_elements, .right_course_elements {
width: 33%; width: 33%;
float: left; float: left;
padding: 1%; padding: 1%;
color: white; color: white;
text-align: center; text-align: center;
-webkit-box-shadow: 0 1px 3px 0 #d4d4d5, 0 0 0 1px #d4d4d5; -webkit-box-shadow: 0 1px 3px 0 #d4d4d5, 0 0 0 1px #d4d4d5;
box-shadow: 0 1px 3px 0 #d4d4d5, 0 0 0 1px #d4d4d5; box-shadow: 0 1px 3px 0 #d4d4d5, 0 0 0 1px #d4d4d5;
} }
.left_course_elements { .left_course_elements {
background: #2d2d2d; background: #2d2d2d;
} }
.right_course_elements { .right_course_elements {
background: #009186; background: #009186;
} }
/*.title { /*.title {
font-size: 1.5rem; font-size: 1.5rem;
color: white; color: white;
padding-bottom: 0.5rem padding-bottom: 0.5rem
}*/ }*/
.middle_elements { .middle_elements {
text-align: center; text-align: center;
width: 11%; width: 11%;
float: left; float: left;
padding: 1%; padding: 1%;
} }
/*#outer-dropzone { /*#outer-dropzone {
height: 140px; height: 140px;
}*/ }*/
/*#inner-dropzone { /*#inner-dropzone {
height: 80px; height: 80px;
}*/ }*/
/*.dropzone { /*.dropzone {
background-color: #ccc; background-color: #ccc;
border: dashed 4px transparent; border: dashed 4px transparent;
border-radius: 4px; border-radius: 4px;
margin: 10px auto 30px; margin: 10px auto 30px;
padding: 10px; padding: 10px;
width: 80%; width: 80%;
transition: background-color 0.3s; transition: background-color 0.3s;
}*/ }*/
/*.drop-active { /*.drop-active {
border-color: #aaa; border-color: #aaa;
}*/ }*/
/*.drop-target { /*.drop-target {
background-color: #29e; background-color: #29e;
border-color: #fff; border-color: #fff;
border-style: solid; border-style: solid;
}*/ }*/
/*.drag-drop { /*.drag-drop {
display: inline-block; display: inline-block;
min-width: 40px; min-width: 40px;
padding: 2em 0.5em; padding: 2em 0.5em;
color: #fff; color: #fff;
background-color: #29e; background-color: #29e;
border: solid 2px #fff; border: solid 2px #fff;
-webkit-transform: translate(0px, 0px); -webkit-transform: translate(0px, 0px);
transform: translate(0px, 0px); transform: translate(0px, 0px);
transition: background-color 0.3s; transition: background-color 0.3s;
}*/ }*/
/*.drag-drop.can-drop { /*.drag-drop.can-drop {
color: #000; color: #000;
background-color: #4e4; background-color: #4e4;
}*/ }*/
/*.textarea:not([rows]) { /*.textarea:not([rows]) {
max-height: 600px; max-height: 600px;
min-height: 120px; min-height: 120px;
}*/ }*/
/*.textarea { /*.textarea {
display: block; display: block;
max-width: 99%; max-width: 99%;
min-width: 99%; min-width: 99%;
padding: 0.625em; padding: 0.625em;
resize: vertical; resize: vertical;
}*/ }*/
/*.input, .textarea { /*.input, .textarea {
-moz-appearance: none; -moz-appearance: none;
-webkit-appearance: none; -webkit-appearance: none;
-webkit-box-align: center; -webkit-box-align: center;
-ms-flex-align: center; -ms-flex-align: center;
align-items: center; align-items: center;
border: 1px solid transparent; border: 1px solid transparent;
border-top-color: transparent; border-top-color: transparent;
border-right-color: transparent; border-right-color: transparent;
border-bottom-color: transparent; border-bottom-color: transparent;
border-left-color: transparent; border-left-color: transparent;
border-radius: 3px; border-radius: 3px;
-webkit-box-shadow: none; -webkit-box-shadow: none;
box-shadow: none; box-shadow: none;
display: -webkit-inline-box; display: -webkit-inline-box;
display: -ms-inline-flexbox; display: -ms-inline-flexbox;
display: inline-flex; display: inline-flex;
font-size: 1rem; font-size: 1rem;
height: 2.25em; height: 2.25em;
-webkit-box-pack: start; -webkit-box-pack: start;
-ms-flex-pack: start; -ms-flex-pack: start;
justify-content: flex-start; justify-content: flex-start;
line-height: 1.5; line-height: 1.5;
padding-bottom: calc(0.375em - 1px); padding-bottom: calc(0.375em - 1px);
padding-left: calc(0.625em - 1px); padding-left: calc(0.625em - 1px);
padding-right: calc(0.625em - 1px); padding-right: calc(0.625em - 1px);
padding-top: calc(0.375em - 1px); padding-top: calc(0.375em - 1px);
position: relative; position: relative;
vertical-align: top; vertical-align: top;
background-color: white; background-color: white;
border-color: #dbdbdb; border-color: #dbdbdb;
color: #363636; color: #363636;
-webkit-box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); -webkit-box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
margin: 0.5rem; margin: 0.5rem;
width: auto; width: auto;
max-width: 90%; max-width: 90%;
}*/ }*/
/*input[type='file'] { /*input[type='file'] {
margin-bottom: 1rem; margin-bottom: 1rem;
padding: 0rem; padding: 0rem;
background: none; background: none;
border: 0px; border: 0px;
box-shadow: none; box-shadow: none;
}*/ }*/
.subject-info-box-1, .subject-info-box-1,
.subject-info-box-2 { .subject-info-box-2 {
float: left; float: left;
width: 100%; width: 100%;
} }
.subject-info-box-1 select, .subject-info-box-1 select,
.subject-info-box-2 select { .subject-info-box-2 select {
height: 200px; height: 200px;
padding: 0; padding: 0;
} }
.subject-info-box-1 select option, .subject-info-box-1 select option,
.subject-info-box-2 select option { .subject-info-box-2 select option {
padding: 4px 10px 4px 10px; padding: 4px 10px 4px 10px;
} }
.subject-info-box-1 select option:hover, .subject-info-box-1 select option:hover,
.subject-info-box-2 select option:hover { .subject-info-box-2 select option:hover {
background: #EEEEEE; background: #EEEEEE;
} }
/*.subject-info-arrows { /*.subject-info-arrows {
float: left; float: left;
width: 50%; width: 50%;
margin-left: 25%; margin-left: 25%;
}*/ }*/
/*.subject-info-arrows input { /*.subject-info-arrows input {
width: 70%; width: 70%;
margin-bottom: 5px; margin-bottom: 5px;
}*/ }*/
.path-list-edit-link {
position: absolute;
top: 0;
right: 0;
}
.iena-btn-career-arrow { .path-list-edit-link {
padding: 0.5rem; position: absolute;
} top: 0;
right: 0;
}
.iena-btn-career-arrow {
padding: 0.5rem;
}
/*.iena-career-description { /*.iena-career-description {
background: #EEE; background: #EEE;
color: #323232; color: #323232;
padding: 1rem; padding: 1rem;
clear: both; clear: both;
margin-bottom: 0, 5rem; margin-bottom: 0, 5rem;
}*/ }*/
/*.iena-carrer-path-descr { /*.iena-carrer-path-descr {
border: 1px solid #1587bc; border: 1px solid #1587bc;
border-radius: 0.15rem; border-radius: 0.15rem;
background-color: white; background-color: white;
color: #333; color: #333;
padding: 1rem; padding: 1rem;
} */ } */
/*.iena-carrer-path-descr a { /*.iena-carrer-path-descr a {
color: #1587bc; color: #1587bc;
margin-top: 1rem; margin-top: 1rem;
display: block; display: block;
}*/ }*/
/*.iena-career-description p, /*.iena-career-description p,
.iena-carrer-path-descr p { .iena-carrer-path-descr p {
font-size: initial !important; font-size: initial !important;
}*/ }*/
...@@ -165,9 +165,9 @@ class view_career_setting extends moodleform ...@@ -165,9 +165,9 @@ class view_career_setting extends moodleform
// console.log() // console.log()
</script>'; </script>';
if ($careerId != 0) { // if ($careerId != 0) {
$content .= '<input type="hidden" name="imagePath" value="'.$imagePath.'">'; // $content .= '<input type="hidden" name="imagePath" value="'.$imagePath.'">';
} // }
$content .= ' $content .= '
<div class="row mt-3"> <div class="row mt-3">
......
...@@ -19,34 +19,34 @@ $sections = array(); ...@@ -19,34 +19,34 @@ $sections = array();
$ressources = array(); $ressources = array();
$i = 0; $i = 0;
foreach ($elements as $value) { foreach ($elements as $value) {
$ressource = new block_career_ressource(); $ressource = new block_career_ressource();
$ressource->get_ressource_by_id($value); $ressource->get_ressource_by_id($value);
$sections[$i] = $ressource->section; $sections[$i] = $ressource->section;
$ressources[$i] = $ressource; $ressources[$i] = $ressource;
$i++; $i++;
} }
//var_dump($sections); //var_dump($sections);
//Supprime les doublons //Supprime les doublons
for($i = 0; $i < count($sections);$i++) for($i = 0; $i < count($sections);$i++)
{ {
$temp = $i; $temp = $i;
$temp++; $temp++;
if ($temp != count($sections)) if ($temp != count($sections))
{ {
if ($sections[$i]->id == $sections[$temp]->id) if ($sections[$i]->id == $sections[$temp]->id)
{ {
unset($sections[$i]); unset($sections[$i]);
} }
} }
} }
//Met dans l'orde //Met dans l'orde
$keys = array(); $keys = array();
$i = 0; $i = 0;
foreach ($sections as $value){ foreach ($sections as $value){
$keys[$i] = $value->orde; $keys[$i] = $value->orde;
$i++; $i++;
} }
$sections = array_combine($keys,$sections); $sections = array_combine($keys,$sections);
ksort($sections); ksort($sections);
...@@ -56,51 +56,34 @@ ksort($sections); ...@@ -56,51 +56,34 @@ ksort($sections);
<section class="section"> <section class="section">
<h2 class="display-3"><?=$titre;?></h2> <h2 class="display-3"><?=$titre;?></h2>
<div class="iena-carrer-path-descr wrapper"> <div class="iena-carrer-path-descr wrapper">
<div class="small"> <?php echo $intro; ?>
<?= $intro ;?> </div>
</div> <?php foreach ($sections as $section) : ?>
<a href="#">Voir la description complète</a> <div style="margin-bottom: 0rem; margin-top: 1rem;">
</div> <div class="career-section-title">
<?php foreach ($sections as $section) : ?> <h3><?php echo $section->name; ?></h3>
<div style="margin-bottom: 0rem; margin-top: 1rem;"> </div>
<div class="card card_block"> <div class="iena-career-description wrapper">
<div class="heading-iena set_height" style="background-color: #009186 !important;"> <?php echo $section->intro; ?>
<div class="titre_section set_height"> </div>
<h3><?php echo $section->name; ?></h3> <div class="list-group">
</div> <?php foreach ($ressources as $value) : ?>
</div> <?php if($value->section->id == $section->id) : ?>
</div> <a href="<?php echo "$value->link&career=$careerId" ?>" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="iena-career-description wrapper"> <div class="d-flex w-100 justify-content-between">
<div class="small"> <h5 class="mb-1">
<p><?= $section->intro ;?></p> <?php echo $value->name;?>
</div> </h5>
<a href="#">Voir la description complète</a> <img class="" alt="" src="<?php echo $CFG->wwwroot ?>/theme/image.php/boost/<?php echo $value->type ?>/1/icon>">
</div>
<!-- <div><?php echo $value->descrition;?></div> -->
</a>
<?php endif;?>
<?php endforeach;?>
</div>
</div>
<?php endforeach;?>
</div> </section>