From 1805a99a634e461aab290a267c270cddfec99e89 Mon Sep 17 00:00:00 2001 From: Frank C <115793157+frank-hee@users.noreply.github.com> Date: Tue, 23 Sep 2025 14:49:31 +0100 Subject: [PATCH 1/4] Update course section expander to nhsuk version --- scss/nhse.scss | 23 ++ .../local/content/section/content.mustache | 249 ++++++++++++++++++ .../local/content/section/header.mustache | 62 +++++ 3 files changed, 334 insertions(+) create mode 100644 templates/core_courseformat/local/content/section/content.mustache create mode 100644 templates/core_courseformat/local/content/section/header.mustache diff --git a/scss/nhse.scss b/scss/nhse.scss index dbcef85..13100f7 100644 --- a/scss/nhse.scss +++ b/scss/nhse.scss @@ -1367,4 +1367,27 @@ body.simulated-fullscreen .d-flex.flex-row-reverse.mb-2 a.btn.btn-secondary[titl .nhsuk-pagination__link .nhsuk-icon { fill: #005eb8; +} + +.course-section .section-item { + padding: 0px; + border: none; + border-radius: 0px; +} + +.nhsuk-expander .h4.sectionname { + font-size: 1.1875rem; + font-weight: 400; +} + +.nhsuk-details.nhsuk-expander .section_link, +.course-content ul.topics li.section .nhsuk-expander .nhsuk-details__text.content { + padding-left: 0.75rem; +} + +@media (max-width: 37.49em) { + .nhsuk-details.nhsuk-expander .section_link, + .course-content ul.topics li.section .nhsuk-expander .nhsuk-details__text.content { + padding-left: 0.5rem; + } } \ No newline at end of file diff --git a/templates/core_courseformat/local/content/section/content.mustache b/templates/core_courseformat/local/content/section/content.mustache new file mode 100644 index 0000000..a7b38f6 --- /dev/null +++ b/templates/core_courseformat/local/content/section/content.mustache @@ -0,0 +1,249 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template core_courseformat/local/content/section/content + + The internal content of a section. + + Example context (json): + { + "num": 3, + "id": 35, + "controlmenu": "[tools menu]", + "header": { + "name": "Section title", + "title": "Section title", + "url": "#", + "ishidden": true, + "headinglevel": 3 + }, + "cmlist": { + "cms": [ + { + "cmitem": { + "cmformat": { + "cmname": "Forum example", + "hasname": "true" + }, + "id": 3, + "cmid": 3, + "module": "forum", + "anchor": "activity-3", + "extraclasses": "newmessages" + } + }, + { + "cmitem": { + "cmformat": { + "cmname": "Assign example", + "hasname": "true" + }, + "id": 4, + "cmid": 4, + "anchor": "activity-4", + "module": "assign", + "extraclasses": "" + } + } + ], + "hascms": true + }, + "ishidden": false, + "iscurrent": true, + "currentlink": "This topic", + "availability": { + "info": "Hidden from students", + "hasavailability": true + }, + "summary": { + "summarytext": "Summary text!" + }, + "controlmenu": { + "menu": "Edit", + "hasmenu": true + }, + "cmcontrols": "[Add an activity or resource]", + "iscoursedisplaymultipage": true, + "sectionreturnnum": 0, + "contentcollapsed": false, + "insertafter": true, + "numsections": 42, + "sitehome": false, + "isstealth": false, + "highlightedlabel" : "Highlighted" + } +}} +{{^displayonesection}} +
+ + + {{#singleheader}} + {{$ core_courseformat/local/content/section/header }} + {{> core_courseformat/local/content/section/header }} + {{/ core_courseformat/local/content/section/header }} + {{/singleheader}} + {{#header}} + {{$ core_courseformat/local/content/section/header }} + {{> core_courseformat/local/content/section/header }} + {{/ core_courseformat/local/content/section/header }} + {{/header}} + {{^singleheader}} + {{#restrictionlock}} +
+ {{#pix}}t/unlock, core{{/pix}} +
+ {{/restrictionlock}} + {{/singleheader}} +
+ {{$ core_courseformat/local/content/section/badges }} + {{> core_courseformat/local/content/section/badges }} + {{/ core_courseformat/local/content/section/badges }} +
+ {{#controlmenu}} + {{^displayonesection}} + {{$ core_courseformat/local/content/section/controlmenu }} + {{> core_courseformat/local/content/section/controlmenu }} + {{/ core_courseformat/local/content/section/controlmenu }} + {{/displayonesection}} + {{/controlmenu}} + {{#header}} + {{#headerdisplaymultipage}} + {{^displayonesection}} + {{^controlmenu}} + + {{/controlmenu}} + {{/displayonesection}} + {{/headerdisplaymultipage}} + {{/header}} +
+
+ +
+ +
+ {{#isstealth}} +
+ {{#str}} orphansectionwarning, core_courseformat {{/str}} +
+ {{/isstealth}} + {{#summary}} + {{$ core_courseformat/local/content/section/summary }} + {{> core_courseformat/local/content/section/summary }} + {{/ core_courseformat/local/content/section/summary }} + {{/summary}} + {{#availability}} + {{$ core_courseformat/local/content/section/availability }} + {{> core_courseformat/local/content/section/availability }} + {{/ core_courseformat/local/content/section/availability }} + {{/availability}} +
+ {{#cmsummary}} + + {{$ core_courseformat/local/content/section/cmsummary }} + {{> core_courseformat/local/content/section/cmsummary }} + {{/ core_courseformat/local/content/section/cmsummary }} + {{/cmsummary}} + {{#cmlist}} + + {{$ core_courseformat/local/content/section/cmlist }} + {{> core_courseformat/local/content/section/cmlist }} + {{/ core_courseformat/local/content/section/cmlist }} + {{/cmlist}} + {{{cmcontrols}}} +
+
+{{/displayonesection}} + +{{#displayonesection}} +
+ {{#singleheader}} + {{$ core_courseformat/local/content/section/header }} + {{> core_courseformat/local/content/section/header }} + {{/ core_courseformat/local/content/section/header }} + {{/singleheader}} + {{#header}} + {{$ core_courseformat/local/content/section/header }} + {{> core_courseformat/local/content/section/header }} + {{/ core_courseformat/local/content/section/header }} + {{/header}} + {{^singleheader}} + {{#restrictionlock}} +
+ {{#pix}}t/unlock, core{{/pix}} +
+ {{/restrictionlock}} + {{/singleheader}} +
+ {{$ core_courseformat/local/content/section/badges }} + {{> core_courseformat/local/content/section/badges }} + {{/ core_courseformat/local/content/section/badges }} +
+ +
+ {{#isstealth}} +
+ {{#str}} orphansectionwarning, core_courseformat {{/str}} +
+ {{/isstealth}} + {{#summary}} + {{$ core_courseformat/local/content/section/summary }} + {{> core_courseformat/local/content/section/summary }} + {{/ core_courseformat/local/content/section/summary }} + {{/summary}} + {{#availability}} + {{$ core_courseformat/local/content/section/availability }} + {{> core_courseformat/local/content/section/availability }} + {{/ core_courseformat/local/content/section/availability }} + {{/availability}} +
+ {{#cmsummary}} + {{$ core_courseformat/local/content/section/cmsummary }} + {{> core_courseformat/local/content/section/cmsummary }} + {{/ core_courseformat/local/content/section/cmsummary }} + {{/cmsummary}} + {{#cmlist}} + {{$ core_courseformat/local/content/section/cmlist }} + {{> core_courseformat/local/content/section/cmlist }} + {{/ core_courseformat/local/content/section/cmlist }} + {{/cmlist}} + {{{cmcontrols}}} +
+{{/displayonesection}} diff --git a/templates/core_courseformat/local/content/section/header.mustache b/templates/core_courseformat/local/content/section/header.mustache new file mode 100644 index 0000000..d7d21ba --- /dev/null +++ b/templates/core_courseformat/local/content/section/header.mustache @@ -0,0 +1,62 @@ + {{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . + }} + {{! + @template core_courseformat/local/content/section/header + + Displays a course section header. + + Example context (json): + { + "id": 123, + "name": "Section title", + "title": "Section title", + "url": "#", + "headerdisplaymultipage": true, + "sectionbulk": true, + "editing": 0, + "headinglevel": 3 + } + }} + {{#sectionbulk}} + {{$ core_courseformat/local/content/section/bulkselect }} + {{> core_courseformat/local/content/section/bulkselect }} + {{/ core_courseformat/local/content/section/bulkselect }} + {{/sectionbulk}} + {{#headerdisplaymultipage}} + {{^displayonesection}} +

+ {{{title}}} +

+ {{/displayonesection}} + {{/headerdisplaymultipage}} + {{^headerdisplaymultipage}} + {{#sitehome}} +

+ {{{title}}} +

+ {{/sitehome}} + {{^sitehome}} + {{^displayonesection}} +
+ + {{{header.name}}} + +
+ {{/displayonesection}} + {{/sitehome}} + {{/headerdisplaymultipage}} From ff1785bb75358ca400656c9b92be6191e4070881 Mon Sep 17 00:00:00 2001 From: Frank C <115793157+frank-hee@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:30:01 +0100 Subject: [PATCH 2/4] indentation fix on summarytext --- scss/nhse.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scss/nhse.scss b/scss/nhse.scss index 13100f7..459d3a1 100644 --- a/scss/nhse.scss +++ b/scss/nhse.scss @@ -1381,12 +1381,14 @@ body.simulated-fullscreen .d-flex.flex-row-reverse.mb-2 a.btn.btn-secondary[titl } .nhsuk-details.nhsuk-expander .section_link, +.nhsuk-details.nhsuk-expander .summarytext, .course-content ul.topics li.section .nhsuk-expander .nhsuk-details__text.content { padding-left: 0.75rem; } @media (max-width: 37.49em) { .nhsuk-details.nhsuk-expander .section_link, + .nhsuk-details.nhsuk-expander .summarytext, .course-content ul.topics li.section .nhsuk-expander .nhsuk-details__text.content { padding-left: 0.5rem; } From b22c633baa3037c737eb4660ab00f9b074c6f87a Mon Sep 17 00:00:00 2001 From: Frank C <115793157+frank-hee@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:57:29 +0100 Subject: [PATCH 3/4] fix foxus state on expander headings --- scss/nhse.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scss/nhse.scss b/scss/nhse.scss index 459d3a1..b833319 100644 --- a/scss/nhse.scss +++ b/scss/nhse.scss @@ -1392,4 +1392,8 @@ body.simulated-fullscreen .d-flex.flex-row-reverse.mb-2 a.btn.btn-secondary[titl .course-content ul.topics li.section .nhsuk-expander .nhsuk-details__text.content { padding-left: 0.5rem; } +} + +.nhsuk-expander .nhsuk-details__summary:focus .nhsuk-details__summary-text:before { + background-color: transparent; } \ No newline at end of file From 414f4d9a3dc99b522c73e57815434db3f151141b Mon Sep 17 00:00:00 2001 From: Frank C <115793157+frank-hee@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:09:16 +0100 Subject: [PATCH 4/4] fix on open expander focus colour --- scss/nhse.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scss/nhse.scss b/scss/nhse.scss index b833319..7761455 100644 --- a/scss/nhse.scss +++ b/scss/nhse.scss @@ -1394,6 +1394,7 @@ body.simulated-fullscreen .d-flex.flex-row-reverse.mb-2 a.btn.btn-secondary[titl } } -.nhsuk-expander .nhsuk-details__summary:focus .nhsuk-details__summary-text:before { +.section-item .nhsuk-expander .nhsuk-details__summary:focus .nhsuk-details__summary-text:before, +.section-item .nhsuk-expander[open] .nhsuk-details__summary:focus .nhsuk-details__summary-text::before { background-color: transparent; } \ No newline at end of file