From 5da7622a7b665fea2d9c861dbe3027adbf274f5d Mon Sep 17 00:00:00 2001
From: Marcin Calka <6230943+marcinca@users.noreply.github.com>
Date: Tue, 1 Aug 2023 13:26:22 +0100
Subject: [PATCH 1/3] DI-5565 Fix login page content
- Static and hardcoded login page text has been fixed to use Plugins/Authrntication settings
---
composer.json | 2 +-
config.php | 2 +-
scss/nhse.scss | 1 +
templates/core/loginform.mustache | 16 ----------------
version.php | 2 +-
5 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/composer.json b/composer.json
index 1d6daaf..5445825 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "nhsla/moodle-nhse",
"type": "moodle-theme",
- "version": "2023072001",
+ "version": "2023073103",
"require": {
"composer/installers": "~1.0"
},
diff --git a/config.php b/config.php
index 6206f75..e1576bb 100755
--- a/config.php
+++ b/config.php
@@ -43,7 +43,7 @@
$THEME->doctype = 'html5';
$THEME->name = 'nhse';
-$THEME->version = '2023072001';
+$THEME->version = '2023073103';
$THEME->parents = ['boost'];
$THEME->regions = [];
$THEME->sheets = [];
diff --git a/scss/nhse.scss b/scss/nhse.scss
index 667b728..df02ecf 100644
--- a/scss/nhse.scss
+++ b/scss/nhse.scss
@@ -50,6 +50,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
#page {
padding-top: 3rem;
+ margin-top: 0;
}
svg {
diff --git a/templates/core/loginform.mustache b/templates/core/loginform.mustache
index da495d5..ee45160 100644
--- a/templates/core/loginform.mustache
+++ b/templates/core/loginform.mustache
@@ -97,24 +97,8 @@
{{#hasinstructions}}
{{{instructions}}}
{{/hasinstructions}}
-
Welcome to the Leadership Academy Virtual Campus
-
Information:
-
If you are using a 10-digit Academy ID, please use
- {{#login_header_text}}
- '{{ login_header_text }}'
- {{/login_header_text}}
- {{^login_header_text}}
- '{{#str}} login_header_text_default, theme_nhse {{/str}}'
- {{/login_header_text}}' section.
-
- {{#login_expand_text}}
-
If you have a different username, please use the '{{ login_expand_text }}' section.
- {{/login_expand_text}}
- {{^login_expand_text}}
-
If you have a different username, please use the '{{#str}} login_expand_text_default, theme_nhse {{/str}}' section.
- {{/login_expand_text}}
{{#str}} cookiesenabled, theme_nhse {{/str}}.
version = 2023072001;
+$plugin->version = 2023073103;
$plugin->release = '401.0.1';
$plugin->maturity = MATURITY_BETA;
From 6f402563783d7736e4b20198ce318107ef896085 Mon Sep 17 00:00:00 2001
From: Marcin Calka <6230943+marcinca@users.noreply.github.com>
Date: Mon, 31 Jul 2023 16:50:05 +0100
Subject: [PATCH 2/3] DI-5563 Completion marking and course navigation
1. Added MARK as DONE in course content context
2. Extended button styles and sizes (extended from nhsuk frontend)
3. Navigation plugin button style checked against it ^
4. Fixed dropdown navigation height in page context
---
composer.json | 2 +-
config.php | 2 +-
scss/components/button/_button.scss | 11 +++
scss/nhse.scss | 61 ++++++-------
scss/nhsuk.scss | 3 +
templates/core/activity_header.mustache | 85 +++++++++++++++++++
templates/core_course/activity_info.mustache | 82 ++++++++++++++++++
.../core_course/completion_automatic.mustache | 65 ++++++++++++++
.../core_course/completion_manual.mustache | 67 +++++++++++++++
templates/drawers.mustache | 9 +-
version.php | 2 +-
11 files changed, 352 insertions(+), 37 deletions(-)
create mode 100644 scss/components/button/_button.scss
create mode 100644 templates/core/activity_header.mustache
create mode 100644 templates/core_course/activity_info.mustache
create mode 100644 templates/core_course/completion_automatic.mustache
create mode 100644 templates/core_course/completion_manual.mustache
diff --git a/composer.json b/composer.json
index 5445825..2b17c6c 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "nhsla/moodle-nhse",
"type": "moodle-theme",
- "version": "2023073103",
+ "version": "2023073102",
"require": {
"composer/installers": "~1.0"
},
diff --git a/config.php b/config.php
index e1576bb..6d149fa 100755
--- a/config.php
+++ b/config.php
@@ -43,7 +43,7 @@
$THEME->doctype = 'html5';
$THEME->name = 'nhse';
-$THEME->version = '2023073103';
+$THEME->version = '2023073102';
$THEME->parents = ['boost'];
$THEME->regions = [];
$THEME->sheets = [];
diff --git a/scss/components/button/_button.scss b/scss/components/button/_button.scss
new file mode 100644
index 0000000..e8289a0
--- /dev/null
+++ b/scss/components/button/_button.scss
@@ -0,0 +1,11 @@
+/*
+ Half size button with half size margin
+ */
+.nhsuk-button--small {
+ @extend .nhsuk-button;
+ box-shadow: 0 2px 0 $nhsuk-box-shadow-color;
+ font-size: 0.95rem;
+ margin-bottom: 18px;
+ padding: 4px 6px;
+ transition: none;
+}
diff --git a/scss/nhse.scss b/scss/nhse.scss
index df02ecf..9482a96 100644
--- a/scss/nhse.scss
+++ b/scss/nhse.scss
@@ -20,14 +20,13 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
}
.coursebox {
-
ul,
ol,
p {
font-size: initial;
line-height: initial;
}
-}
+}
.course_category_tree {
.category {
@@ -39,6 +38,26 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
}
}
+/**
+ * Button styles
+ */
+.btn {
+ &:not(.btn-link):not(.btn-icon):not(.search-icon):not(.dropdown-toggle):not(.icon-no-margin) {
+ @extend .nhsuk-button--small;
+ }
+}
+
+/**
+ * Cards and drawers
+ */
+.card {
+ border: none;
+ border-radius: 0;
+ -moz-border-radius: 0;
+ background-color: $color_nhsuk-grey-5;
+ margin: 0;
+}
+
/**
* Page and headings
*/
@@ -111,7 +130,7 @@ body.limitedwidth {
.bg-light {
color: $color_nhsuk-grey-1;
background-color: $btn-default-background !important;
- * {
+ > * {
color: $color_nhsuk-grey-1 !important;
}
}
@@ -209,8 +228,12 @@ body.limitedwidth {
height: 2.0em;
}
-.navbar-expand .navbar-nav .nav-link {
- padding-top: 15px;
+.navbar-expand {
+ .navbar-nav {
+ .nav-link {
+ padding-top: 15px;
+ }
+ }
}
.icon {
@@ -242,6 +265,10 @@ body.limitedwidth {
margin-left: 0;
}
+.nav-link {
+ padding: 0.6rem 1rem;
+}
+
.navbar {
color: $btn-primary-text;
background-color: $btn-primary-background;
@@ -415,30 +442,6 @@ body.limitedwidth {
}
}
-/**
- * Button styles
- */
-
-.btn-primary:not(.search-icon),
-.btn-secondary:not(.search-icon) {
- @extend .nhsuk-button;
-}
-
-.btn-secondary:not(.search-icon) {
- @extend .nhsuk-button--secondary;
-}
-
-/**
- * Cards and drawers
- */
-.card {
- border: none;
- border-radius: 0;
- -moz-border-radius: 0;
- background-color: $color_nhsuk-grey-5;
- margin: 0;
-}
-
.drawers .block_myoverview>.card-body {
padding: 1.25rem!important;
}
diff --git a/scss/nhsuk.scss b/scss/nhsuk.scss
index 707c2ab..8629d21 100755
--- a/scss/nhsuk.scss
+++ b/scss/nhsuk.scss
@@ -75,3 +75,6 @@
@import "../node_modules/nhsuk-frontend/packages/components/warning-callout/warning-callout";
//@import "../node_modules/nhsuk-frontend/packages/components/character-count/character-count";
//@import "../node_modules/nhsuk-frontend/packages/components/tabs/tabs";
+
+// Custom extras (for Moodle)
+@import "components/button/button";
diff --git a/templates/core/activity_header.mustache b/templates/core/activity_header.mustache
new file mode 100644
index 0000000..0111ed5
--- /dev/null
+++ b/templates/core/activity_header.mustache
@@ -0,0 +1,85 @@
+{{!
+ 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/activity_header
+
+ Activity header template.
+
+ Context variables required for this template:
+ * title - The title of the activity module
+ * description - The intro for the module
+ * completion - The completion info if available for the the module as acquired via the activity_information method
+ * additional_items - Any additional URL select navigation that needs to show up in the header
+
+ Example context (json):
+ {
+ "title": "Assignment 1",
+ "description": "The assignment does something",
+ "completion": "Some activity completion criteria
",
+ "additional_items": {
+ "id": "url_select_test",
+ "action": "https://example.com/post",
+ "formid": "url_select_form",
+ "sesskey": "sesskey",
+ "label": "core/url_select",
+ "helpicon": {
+ "title": "Help with something",
+ "text": "Help with something",
+ "url": "http://example.org/help",
+ "linktext": "",
+ "icon":{
+ "extraclasses": "iconhelp",
+ "attributes": [
+ {"name": "src", "value": "../../../pix/help.svg"},
+ {"name": "alt", "value": "Help icon"}
+ ]
+ }
+ },
+ "showbutton": "Go",
+ "options": [{
+ "name": "Group 1", "isgroup": true, "options":
+ [
+ {"name": "Item 1", "isgroup": false, "value": "1"},
+ {"name": "Item 2", "isgroup": false, "value": "2"}
+ ]},
+ {"name": "Group 2", "isgroup": true, "options":
+ [
+ {"name": "Item 3", "isgroup": false, "value": "3"},
+ {"name": "Item 4", "isgroup": false, "value": "4"}
+ ]}],
+ "disabled": false,
+ "title": "Some cool title"
+ }
+ }
+}}
+
+
+{{#additional_items}}
+
+ {{> core/url_select}}
+
+{{/additional_items}}
diff --git a/templates/core_course/activity_info.mustache b/templates/core_course/activity_info.mustache
new file mode 100644
index 0000000..713d600
--- /dev/null
+++ b/templates/core_course/activity_info.mustache
@@ -0,0 +1,82 @@
+{{!
+ 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_course/activity_info
+
+ Container to display activity information such as:
+ - Activity dates
+ - Activity completion requirements (automatic completion)
+ - Manual completion button
+
+ Example context (json):
+ {
+ "activityname": "Course announcements",
+ "hascompletion": true,
+ "uservisible": true,
+ "hasdates": true,
+ "isautomatic": true,
+ "istrackeduser": true,
+ "showmanualcompletion": true,
+ "activitydates": [
+ {
+ "label": "Opens:",
+ "timestamp": 1293876000
+ }
+ ],
+ "completiondetails": [
+ {
+ "statuscomplete": 1,
+ "description": "Viewed"
+ },
+ {
+ "statusincomplete": 1,
+ "description": "Receive a grade"
+ }
+ ]
+ }
+}}
+
diff --git a/templates/core_course/completion_automatic.mustache b/templates/core_course/completion_automatic.mustache
new file mode 100644
index 0000000..3c977d2
--- /dev/null
+++ b/templates/core_course/completion_automatic.mustache
@@ -0,0 +1,65 @@
+{{!
+ 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_course/completion_automatic
+
+ Template for displaying an automatic completion rule and its status.
+
+ Example context (json):
+ {
+ "statuscomplete": 1,
+ "description": "View",
+ "istrackeduser": true,
+ "accessibledescription": "Done: View (Set by Admin User)"
+ }
+}}
+{{#istrackeduser}}
+ {{#statuscomplete}}
+
+ {{#pix}}i/checked{{/pix}}
+ {{#str}}completion_automatic:done, core_course{{/str}} {{description}}
+
+ {{/statuscomplete}}
+ {{#statuscompletefail}}
+
+ {{#pix}}e/cancel{{/pix}}
+ {{#str}}completion_automatic:failed, core_course{{/str}} {{description}}
+
+ {{/statuscompletefail}}
+ {{#statusincomplete}}
+
+ {{#str}}completion_automatic:todo, core_course{{/str}} {{description}}
+
+ {{/statusincomplete}}
+{{/istrackeduser}}
+{{^istrackeduser}}
+
+ {{description}}
+
+{{/istrackeduser}}
diff --git a/templates/core_course/completion_manual.mustache b/templates/core_course/completion_manual.mustache
new file mode 100644
index 0000000..18d6fe0
--- /dev/null
+++ b/templates/core_course/completion_manual.mustache
@@ -0,0 +1,67 @@
+{{!
+ 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_course/completion_manual
+
+ Template for displaying the manual completion button.
+
+ Example context (json):
+ {
+ "cmid": 0,
+ "overallcomplete": true,
+ "overallincomplete": false
+ }
+}}
+{{#istrackeduser}}
+ {{#overallcomplete}}
+
+ {{#str}} completion_manual:done, core_course {{/str}}
+
+ {{/overallcomplete}}
+ {{#overallincomplete}}
+
+ {{#str}} completion_manual:markdone, core_course {{/str}}
+
+ {{/overallincomplete}}
+{{/istrackeduser}}
+{{^istrackeduser}}
+
+ {{#str}} completion_manual:markdone, core_course {{/str}}
+
+{{/istrackeduser}}
+
+{{#js}}
+ require(['core_course/manual_completion_toggle'], toggle => {
+ toggle.init()
+ });
+{{/js}}
diff --git a/templates/drawers.mustache b/templates/drawers.mustache
index 4f3f11d..205f4b8 100644
--- a/templates/drawers.mustache
+++ b/templates/drawers.mustache
@@ -148,12 +148,11 @@
{{/hasregionmainsettingsmenu}}
{{{ output.course_content_header }}}
+ {{#headercontent}}
+ {{> core/activity_header }}
+ {{/headercontent}}
{{#overflow}}
-
-
- {{> core/url_select}}
-
-
+ {{> core/url_select}}
{{/overflow}}
{{{ output.main_content }}}
{{{ output.activity_navigation }}}
diff --git a/version.php b/version.php
index 28f3054..3b435f0 100755
--- a/version.php
+++ b/version.php
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
// This is the version of the plugin.
-$plugin->version = 2023073103;
+$plugin->version = 2023073102;
$plugin->release = '401.0.1';
$plugin->maturity = MATURITY_BETA;
From 38cfd81eac68ffa302dbe2ee5b175c4cd4fb4fba Mon Sep 17 00:00:00 2001
From: Marcin Calka <6230943+marcinca@users.noreply.github.com>
Date: Tue, 1 Aug 2023 10:35:26 +0100
Subject: [PATCH 3/3] DI-5563 Lists styles reset globally
---
composer.json | 2 +-
config.php | 4 ++--
scss/nhse.scss | 20 ++++++++++++--------
templates/drawers.mustache | 8 ++++----
templates/footer.mustache | 18 ++++++++----------
version.php | 2 +-
6 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/composer.json b/composer.json
index 2b17c6c..5445825 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "nhsla/moodle-nhse",
"type": "moodle-theme",
- "version": "2023073102",
+ "version": "2023073103",
"require": {
"composer/installers": "~1.0"
},
diff --git a/config.php b/config.php
index 6d149fa..5aeb620 100755
--- a/config.php
+++ b/config.php
@@ -43,7 +43,7 @@
$THEME->doctype = 'html5';
$THEME->name = 'nhse';
-$THEME->version = '2023073102';
+$THEME->version = '2023073103';
$THEME->parents = ['boost'];
$THEME->regions = [];
$THEME->sheets = [];
@@ -201,7 +201,7 @@
$THEME->haseditswitch = true;
$THEME->usescourseindex = true;
-// Control displaying nhse titles.
+// Control displaying nhse titles (Boost is set to true).
$THEME->activityheaderconfig = [
'notitle' => false
];
diff --git a/scss/nhse.scss b/scss/nhse.scss
index 9482a96..f39441d 100644
--- a/scss/nhse.scss
+++ b/scss/nhse.scss
@@ -19,13 +19,11 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-weight: 600;
}
-.coursebox {
- ul,
- ol,
- p {
- font-size: initial;
- line-height: initial;
- }
+ul,
+ol,
+p {
+ font-size: initial;
+ line-height: initial;
}
.course_category_tree {
@@ -68,7 +66,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
flex-direction: column;
#page {
- padding-top: 3rem;
+ padding-top: 0;
margin-top: 0;
}
@@ -267,6 +265,8 @@ body.limitedwidth {
.nav-link {
padding: 0.6rem 1rem;
+ font-size: 1rem;
+ line-height: 1.5;
}
.navbar {
@@ -489,6 +489,10 @@ body.limitedwidth {
display: none;
}
+.nhsuk-header__navigation-item {
+ border-top: none;
+}
+
.popover-region-toggle::before, .popover-region-toggle::after {
display: none;
}
diff --git a/templates/drawers.mustache b/templates/drawers.mustache
index 205f4b8..12d947b 100644
--- a/templates/drawers.mustache
+++ b/templates/drawers.mustache
@@ -170,10 +170,10 @@