Skip to content

Commit 109868e

Browse files
authored
Merge branch 'main' into css_snippets
2 parents 061ca1d + e1ffadc commit 109868e

18 files changed

+2938
-2
lines changed

CHANGES.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ moodle-theme_boost_union
44
Changes
55
-------
66

7+
### Unreleased
8+
9+
* 2025-02-22 - Feature: Add some styling to the category listings on site home and on the category index pages, resolves #840.
10+
* 2025-02-16 - Feature: Show the course listing on site home and on the category index pages as (proper) list, resolves #573.
11+
* 2025-02-07 - Feature: Show the course listing on site home and on the category index pages as cards, resolves #558.
12+
713
### v4.5-r8
814

915
* 2025-02-17 - Bugfix: Remove the possibility to set the activity purpose for subsections to avoid that activities within subsections get tinted with the wrong color, resolves #823.

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,16 @@ With this setting, you can control whether the course image is visible inside th
225225

226226
With this setting, you can control whether the course completion progress is visible inside the course overview block or not.
227227

228+
#### Tab "Category index / Site home"
229+
230+
##### Course listing
231+
232+
In this section, you can modify the look & feel of the course listing on the category index pages and on site home. As an alternative to the way how Moodle core presents them, you can present the course listing as course cards (similar to the course cards on the 'My courses' page) or course list (similar to the course list on the 'My courses' page). And, of course, you can configure the look of the course cards or rows with multiple dependent settings.
233+
234+
##### Category listing
235+
236+
With this setting, you can modify the look & feel of the category listing on the category index pages and on site home. As an alternative to the way how Moodle core presents them, you can present the category listing as a refreshed list of boxes.
237+
228238
#### Tab "Blocks"
229239

230240
##### Timeline block
@@ -905,6 +915,7 @@ This theme is a collaboration result of multiple organisations.
905915
Moodle an Hochschulen e.V. would like to thank these main contributors (in alphabetical order of the institutions) for their work:
906916

907917
* Academic Moodle Cooperation (AMC): Ideating, Code
918+
* Adapta, Daniel Neis Araujo: Code
908919
* Baden-Württemberg Cooperative State University (DHBW), Katja Neubehler: Code
909920
* bdecent GmbH, Stefan Scholz: Code, Ideating, Funding
910921
* Bern University of Applied Sciences (BFH), Luca Bösch: Code, Peer Review, Ideating

amd/build/courselistingdetailsmodal.min.js

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/courselistingdetailsmodal.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/src/courselistingdetailsmodal.js

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// This file is part of Moodle - http://moodle.org/
2+
//
3+
// Moodle is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// Moodle is distributed in the hope that it will be useful,
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU General Public License
14+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
15+
16+
/**
17+
* Theme Boost Union - JS code for course listing details modal.
18+
*
19+
* @module theme_boost_union/courselistingdetailsmodal
20+
* @copyright 2025 Alexander Bias, ssystems GmbH <[email protected]>
21+
* based on core_admin/themeselector/preview_modal by David Woloszyn <[email protected]>
22+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23+
*/
24+
25+
import ModalCancel from 'core/modal_cancel';
26+
import Notification from 'core/notification';
27+
import Templates from 'core/templates';
28+
import {getString} from 'core/str';
29+
30+
const SELECTORS = {
31+
DETAILS: '[data-action="courselisting-details"]',
32+
};
33+
34+
/**
35+
* Entrypoint of the js.
36+
*
37+
* @method init
38+
*/
39+
export const init = () => {
40+
registerListenerEvents();
41+
};
42+
43+
/**
44+
* Register snippet related event listeners.
45+
*
46+
* @method registerListenerEvents
47+
*/
48+
const registerListenerEvents = () => {
49+
document.addEventListener('click', (e) => {
50+
const details = e.target.closest(SELECTORS.DETAILS);
51+
if (details) {
52+
buildModal(details).catch(Notification.exception);
53+
}
54+
});
55+
};
56+
57+
/**
58+
* Build the modal with the provided data.
59+
*
60+
* @method buildModal
61+
* @param {object} element
62+
*/
63+
const buildModal = async(element) => {
64+
65+
// Prepare data for modal.
66+
const data = {
67+
title: element.getAttribute('data-title'),
68+
summary: element.getAttribute('data-summary'),
69+
coursecontacts: element.getAttribute('data-coursecontacts'),
70+
customfields: element.getAttribute('data-customfields'),
71+
};
72+
73+
await ModalCancel.create({
74+
title: data.title,
75+
body: Templates.render('theme_boost_union/courselistingdetailsmodal', data),
76+
large: true,
77+
buttons: {
78+
'cancel': getString('closebuttontitle', 'moodle'),
79+
},
80+
show: true,
81+
});
82+
};

0 commit comments

Comments
 (0)