Merge pull request #5020 from christianbeeznest/ofaj-21267

Learnpath: Improve selection item - refs BT#21267
pull/5022/head
christianbeeznest 2 years ago committed by GitHub
commit f68ebe6006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      assets/css/scorm.scss
  2. 2
      public/main/lp/lp_view.php
  3. 32
      src/CoreBundle/Resources/views/LearnPath/scorm_list.html.twig

@ -600,11 +600,11 @@ body {
border-bottom: none;
}
.scorm_item_normal.scorm_completed {
.scorm_item_normal.scorm_completed:not(.scorm_item_section) {
background: url(../../public/img/icons/svg/check-completed.svg) #F5F5F5 right center no-repeat;
}
.scorm_item_normal.scorm_not_attempted {
.scorm_item_normal.scorm_not_attempted:not(.scorm_item_section) {
background: url(../../public/img/icons/svg/check-not-attempted.svg) #FFFFFF right center no-repeat;
}
@ -703,12 +703,13 @@ body {
.scorm_item_normal.scorm_highlight {
}
.scorm_item_normal.scorm_highlight.scorm_not_attempted {
background: url(../../public/img/icons/svg/check-not-attempted.svg) right center no-repeat;
background: url(../../public/img/icons/svg/check-not-attempted.svg) #00829C right center no-repeat;
}
.scorm_item_normal.scorm_highlight.scorm_completed {
background: url(../../public/img/icons/svg/check-highlight.svg) right center no-repeat;
background: url(../../public/img/icons/svg/check-highlight.svg) #00829C right center no-repeat;
}
.scorm_item_normal.scorm_highlight a {
color: #FFF;
}
#learning_path_toc .root_item.lp_item_type_document.scorm_highlight{
}

@ -556,7 +556,7 @@ $template->assign('data_list', $oLP->getListArrayToc());
//var_dump($oLP->getListArrayToc($get_toc_list));
$template->assign('lp_id', $lp->getIid());
$template->assign('lp_current_item_id', $oLP->get_current_item_id());
$template->assign('lp_current_item_id', isset($_GET['lp_item_id']) ? (int) $_GET['lp_item_id'] : $oLP->get_current_item_id());
$menuLocation = 'left';
if ('false' !== api_get_setting('lp.lp_menu_location')) {

@ -79,6 +79,7 @@
{% macro tree(item) %}
{% import _self as self %}
{% set isCurrentItem = item.id == lp_current_item_id %}
<div id="toc_{{ item.id }}"
class="panel panel-default
{{ item.parent_id ? 'child_item':'root_item' }}
@ -96,7 +97,8 @@
<a class="item-header" role="button"
data-toggle="collapse" data-parent="#tocchildren_{{ item.parent_id }}"
href="#tocchildren_{{ item.id }}"
aria-expanded="true" aria-controls="tocchildren_{{ item.id }}">
aria-expanded="{{ isCurrentItem ? 'true' : 'false' }}"
aria-controls="tocchildren_{{ item.id }}">
{{ item.title | raw }}
</a>
{% else %}
@ -110,7 +112,7 @@
</div>
{% if item.children|length %}
<div id="tocchildren_{{ item.id }}"
class="panel-collapse collapse {{ item.is_parent_of_current ? 'in' : '' }}"
class="panel-collapse collapse {{ isCurrentItem ? 'in' : '' }}"
role="tabpanel"
aria-labelledby="heading_item_{{item.id}}">
<div class="panel-body">
@ -132,3 +134,29 @@
</div>
{% endif %}
{% endautoescape %}
<script>
document.addEventListener('DOMContentLoaded', function() {
setTimeout(function() {
var lpCurrentItemId = '{{ lp_current_item_id }}';
var currentElement = document.getElementById('toc_' + lpCurrentItemId);
if (currentElement) {
var parentContainer = currentElement.closest('.item-children');
var previousSibling;
if (parentContainer) {
previousSibling = parentContainer.previousElementSibling;
}
if (previousSibling) {
previousSibling.click();
var parentContainer2 = previousSibling.closest('.item-children');
var previousSibling2;
if (parentContainer2) {
previousSibling2 = parentContainer2.previousElementSibling;
}
if (previousSibling2) {
previousSibling2.click()
}
}
}
}, 1000);
});
</script>

Loading…
Cancel
Save