Skip to content

Commit

Permalink
Make codechecker happier
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Feb 19, 2024
1 parent 1645f91 commit 293cae5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2024-02-18 - Make codechecker happier
* 2024-02-17 - Test: Use custom step to check the menus and menu items existence, resolves #365.
* 2024-02-12 - Feature: Allow the admin to display activity icons in course content navigation, resolves #16.
* 2024-02-11 - Child theme support: Improve namespace of class smartmenu_helper, resolves #494.
Expand Down
4 changes: 2 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ function theme_boost_union_get_emailbrandinghtmlpreview() {
$mail = $OUTPUT->render_from_template('core/email_html', $mailtemplatecontext);

// And compose mail preview.
$previewtemplatecontext = ['mail' => $mail, 'type' => 'html', 'monospace' => false];
$previewtemplatecontext = ['mail' => $mail, 'type' => 'Html', 'monospace' => false];
$preview = $OUTPUT->render_from_template('theme_boost_union/emailpreview', $previewtemplatecontext);

return $preview;
Expand Down Expand Up @@ -946,7 +946,7 @@ function theme_boost_union_get_emailbrandingtextpreview() {
$mail = nl2br($OUTPUT->render_from_template('core/email_text', $mailtemplatecontext));

// And compose mail preview.
$previewtemplatecontext = ['mail' => $mail, 'type' => 'text', 'monospace' => true];
$previewtemplatecontext = ['mail' => $mail, 'type' => 'Text', 'monospace' => true];
$preview = $OUTPUT->render_from_template('theme_boost_union/emailpreview', $previewtemplatecontext);

return $preview;
Expand Down
12 changes: 6 additions & 6 deletions templates/core_courseformat/local/courseindex/cm.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,20 @@ if (document.body.classList.contains('hascourseindexcmicons')) {
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
let node = mutation.target.childNodes[3];
if (node.id.startsWith('courseindex-cmicon-cplid-')){
let completionel = document.getElementById(node.id);
if (node.id.startsWith('courseindex-cmicon-cplid-')) {
let cplel = document.getElementById(node.id);
// Set the completion color for the icon based on the completion status.
switch (node.dataset.value){
switch (node.dataset.value) {
case 'NaN':
break;
case '0':
completionel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-incomplete');
cplel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-incomplete');
break;
case '1':
completionel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-complete');
cplel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-complete');
break;
case '3':
completionel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-fail');
cplel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-fail');
break;
}
}
Expand Down
16 changes: 8 additions & 8 deletions templates/emailpreview.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Example context (json):
{
"mail": "Lorem ipsum",
"type": "html",
"type": "Html",
"monospace": false
}
}}
Expand All @@ -38,20 +38,20 @@
<div class="shadow p-3 my-5 bg-white rounded {{#monospace}}text-monospace{{/monospace}}" id="theme_boost_union-email{{type}}preview-host"></div>
{{#js}}
// Get the host element.
const theme_boost_union_email{{type}}preview_host = document.querySelector('#theme_boost_union-email{{type}}preview-host');
const themeBoostUnionEmail{{type}}PreviewHost = document.querySelector('#theme_boost_union-email{{type}}preview-host');

// Only if the host element exists on this page.
if (typeof(theme_boost_union_email{{type}}preview_host) != 'undefined' && theme_boost_union_email{{type}}preview_host != null) {
if (typeof (themeBoostUnionEmail{{type}}PreviewHost) != 'undefined' && themeBoostUnionEmail{{type}}PreviewHost !== null) {
// If the browser supports Shadow DOM.
if (document.body.attachShadow) {
// Add the email content within a Shadow DOM.
const theme_boost_union_email{{type}}preview_shadow = theme_boost_union_email{{type}}preview_host.attachShadow({ mode: "open" });
const theme_boost_union_email{{type}}preview_template = document.getElementById('theme_boost_union-email{{type}}preview-shadow');
theme_boost_union_email{{type}}preview_shadow.appendChild(theme_boost_union_email{{type}}preview_template.content);
const themeBoostUnionEmail{{type}}PreviewShadow = themeBoostUnionEmail{{type}}PreviewHost.attachShadow({mode: "open"});
const themeBoostUnionEmail{{type}}PreviewTemplate = document.getElementById('theme_boost_union-email{{type}}preview-shadow');
themeBoostUnionEmail{{type}}PreviewShadow.appendChild(themeBoostUnionEmail{{type}}PreviewTemplate.content);
} else {
// Add the email content without Shadow DOM (which will result in style bleeding anyway).
const theme_boost_union_email{{type}}preview_template = document.getElementById('theme_boost_union-email{{type}}preview-shadow');
theme_boost_union_email{{type}}preview_host.appendChild(theme_boost_union_email{{type}}preview_template.content);
const themeBoostUnionEmail{{type}}PreviewTemplate = document.getElementById('theme_boost_union-email{{type}}preview-shadow');
themeBoostUnionEmail{{type}}PreviewHost.appendChild(themeBoostUnionEmail{{type}}PreviewTemplate.content);
}
}
{{/js}}
2 changes: 1 addition & 1 deletion templates/localloginform.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Example context (json):
{
"loginurl": "http://localhost/stable_master/login/index.php",
"logintoken": "randomstring",
"logintoken": "randomstring"
}
}}

Expand Down
2 changes: 1 addition & 1 deletion templates/theme_boost/columns2.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ M.util.js_pending('theme_boost/loader');
require(['theme_boost/loader', 'theme_boost/drawer'{{#includesmartmenu}}, 'theme_boost_union/smartmenu'{{/includesmartmenu}}], function(Loader, Drawer{{#includesmartmenu}}, SmartMenu{{/includesmartmenu}}) {
Drawer.init();
M.util.js_complete('theme_boost/loader');
{{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}}
{{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}}
});
{{/js}}
4 changes: 2 additions & 2 deletions templates/theme_boost/drawers.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ M.util.js_pending('theme_boost/loader');
require(['theme_boost/loader', 'theme_boost/drawer'{{#regions.offcanvas.hasblocks}},'theme_boost_union/offcanvas'{{/regions.offcanvas.hasblocks}}{{#includesmartmenu}}, 'theme_boost_union/smartmenu'{{/includesmartmenu}}], function(Loader, Drawer{{#regions.offcanvas.hasblocks}},OffCanvas{{/regions.offcanvas.hasblocks}}{{#includesmartmenu}}, SmartMenu{{/includesmartmenu}}) {
Drawer.init();
M.util.js_complete('theme_boost/loader');
{{#regions.offcanvas.hasblocks}}OffCanvas.init();{{/regions.offcanvas.hasblocks}}
{{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}}
{{#regions.offcanvas.hasblocks}}OffCanvas.init();{{/regions.offcanvas.hasblocks}}
{{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}}
});
{{/js}}

0 comments on commit 293cae5

Please sign in to comment.