mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-73952-master' of https://github.com/bmbrands/moodle
This commit is contained in:
commit
a313795354
2
course/amd/build/actions.min.js
vendored
2
course/amd/build/actions.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -616,13 +616,13 @@ define(
|
||||
replaceActionItem(actionItem, 'i/marked',
|
||||
'highlightoff', 'core', 'removemarker');
|
||||
courseeditor.dispatch('legacySectionAction', action, sectionid);
|
||||
setSectionBadge(sectionElement[0], 'highlighted', true);
|
||||
setSectionBadge(sectionElement[0], 'iscurrent', true);
|
||||
} else if (action === 'removemarker') {
|
||||
sectionElement.removeClass('current');
|
||||
replaceActionItem(actionItem, 'i/marker',
|
||||
'highlight', 'core', 'setmarker');
|
||||
courseeditor.dispatch('legacySectionAction', action, sectionid);
|
||||
setSectionBadge(sectionElement[0], 'highlighted', false);
|
||||
setSectionBadge(sectionElement[0], 'iscurrent', false);
|
||||
}
|
||||
};
|
||||
|
||||
@ -739,15 +739,17 @@ define(
|
||||
if (!sectionbadges) {
|
||||
return;
|
||||
}
|
||||
if (add) {
|
||||
templates.render('core_courseformat/local/content/section/badges', {[badgetype]: 1})
|
||||
.then(function(html, js) {
|
||||
templates.prependNodeContents(sectionbadges, html, js);
|
||||
return true;
|
||||
}).catch(notification.exception);
|
||||
} else {
|
||||
const badge = sectionbadges.querySelector('[data-type="' + badgetype + '"]');
|
||||
badge.remove();
|
||||
if (!badge) {
|
||||
return;
|
||||
}
|
||||
if (add) {
|
||||
document.querySelectorAll('[data-type="' + badgetype + '"]').forEach((b) => {
|
||||
b.classList.add('d-none');
|
||||
});
|
||||
badge.classList.remove('d-none');
|
||||
} else {
|
||||
badge.classList.add('d-none');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -129,7 +129,7 @@ class section implements named_templatable, renderable {
|
||||
* @return stdClass data context for a mustache template
|
||||
*/
|
||||
public function export_for_template(renderer_base $output): stdClass {
|
||||
global $USER;
|
||||
global $USER, $PAGE;
|
||||
|
||||
$format = $this->format;
|
||||
$course = $format->get_course();
|
||||
@ -145,6 +145,7 @@ class section implements named_templatable, renderable {
|
||||
'summary' => $summary->export_for_template($output),
|
||||
'highlightedlabel' => $format->get_section_highlighted_name(),
|
||||
'sitehome' => $course->id == SITEID,
|
||||
'editing' => $PAGE->user_is_editing()
|
||||
];
|
||||
|
||||
$haspartials = [];
|
||||
|
@ -29,12 +29,25 @@
|
||||
"highlightedlabel" : "Highlighted"
|
||||
}
|
||||
}}
|
||||
{{#iscurrent}}
|
||||
<span class="badge badge-pill badge-primary order-1" data-type="highlighted">{{ highlightedlabel }}</span>
|
||||
{{/iscurrent}}
|
||||
{{#hiddenfromstudents}}
|
||||
<span class="badge badge-pill badge-warning order-2" data-type="hiddenfromstudents">{{#str}}hiddenfromstudents{{/str}}</span>
|
||||
{{/hiddenfromstudents}}
|
||||
{{#notavailable}}
|
||||
{{#editing}}
|
||||
<span class="badge badge-pill badge-primary order-1 {{^iscurrent}}d-none{{/iscurrent}}" data-type="iscurrent">
|
||||
{{ highlightedlabel }}
|
||||
</span>
|
||||
<span class="badge badge-pill badge-warning order-2 {{^hiddenfromstudents}}d-none{{/hiddenfromstudents}}" data-type="hiddenfromstudents">
|
||||
{{#str}}hiddenfromstudents{{/str}}
|
||||
</span>
|
||||
<span class="badge badge-pill badge-secondary order-3 {{^notavailable}}d-none{{/notavailable}}">
|
||||
{{#str}}notavailable{{/str}}
|
||||
</span>
|
||||
{{/editing}}
|
||||
{{^editing}}
|
||||
{{#iscurrent}}
|
||||
<span class="badge badge-pill badge-primary order-1">{{ highlightedlabel }}</span>
|
||||
{{/iscurrent}}
|
||||
{{#hiddenfromstudents}}
|
||||
<span class="badge badge-pill badge-warning order-2">{{#str}}hiddenfromstudents{{/str}}</span>
|
||||
{{/hiddenfromstudents}}
|
||||
{{#notavailable}}
|
||||
<span class="badge badge-pill badge-secondary order-3">{{#str}}notavailable{{/str}}</span>
|
||||
{{/notavailable}}
|
||||
{{/notavailable}}
|
||||
{{/editing}}
|
||||
|
@ -444,6 +444,7 @@ class behat_course extends behat_base {
|
||||
// Ensures the section exists.
|
||||
$xpath = $this->section_exists($sectionnumber);
|
||||
|
||||
$this->execute('behat_general::should_exist_in_the', ['Highlighted', 'text', $xpath, 'xpath_element']);
|
||||
// The important checking, we can not check the img.
|
||||
$this->execute('behat_general::should_exist_in_the', ['Remove highlight', 'link', $xpath, 'xpath_element']);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user