- {{$ core_courseformat/local/content/cm/bulkselect }}
- {{> core_courseformat/local/content/cm/bulkselect }}
- {{/ core_courseformat/local/content/cm/bulkselect }}
+ {{#cmbulk}}
+ {{$ core_courseformat/local/content/cm/bulkselect }}
+ {{> core_courseformat/local/content/cm/bulkselect }}
+ {{/ core_courseformat/local/content/cm/bulkselect }}
+ {{/cmbulk}}
{{!
Place the actual content of the activity-item in a separate template to make it easier for other formats to add
additional content to the activity wrapper.
diff --git a/course/format/templates/local/content/cm/activity.mustache b/course/format/templates/local/content/cm/activity.mustache
index 8bd20c4b92d..8ca5b939706 100644
--- a/course/format/templates/local/content/cm/activity.mustache
+++ b/course/format/templates/local/content/cm/activity.mustache
@@ -139,7 +139,7 @@
{{! Description }}
{{#altcontent}}
-
+
{{{altcontent}}}
{{/altcontent}}
diff --git a/course/format/templates/local/content/delegatedsection.mustache b/course/format/templates/local/content/delegatedsection.mustache
new file mode 100644
index 00000000000..3cf4b264a4a
--- /dev/null
+++ b/course/format/templates/local/content/delegatedsection.mustache
@@ -0,0 +1,93 @@
+{{!
+ 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/delegatedsection
+
+ Displays a course section.
+
+ Note: This template is a wrapper around the section/content template to allow course formats and theme designers to
+ modify parts of the wrapper without having to copy/paste the entire template.
+
+ 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": "
Assign example",
+ "hasname": "true"
+ },
+ "id": 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,
+ "sitehome": false,
+ "highlightedlabel" : "Highlighted"
+ }
+}}
+
diff --git a/course/format/templates/local/content/section/content.mustache b/course/format/templates/local/content/section/content.mustache
index d4db117e78e..7a61ca87e36 100644
--- a/course/format/templates/local/content/section/content.mustache
+++ b/course/format/templates/local/content/section/content.mustache
@@ -28,7 +28,8 @@
"name": "Section title",
"title": "
Section title",
"url": "#",
- "ishidden": true
+ "ishidden": true,
+ "headinglevel": 3
},
"cmlist": {
"cms": [
diff --git a/course/format/templates/local/content/section/header.mustache b/course/format/templates/local/content/section/header.mustache
index 8cac7191cf4..e4046428cba 100644
--- a/course/format/templates/local/content/section/header.mustache
+++ b/course/format/templates/local/content/section/header.mustache
@@ -27,7 +27,8 @@
"url": "#",
"headerdisplaymultipage": true,
"sectionbulk": true,
- "editing": 0
+ "editing": 0,
+ "headinglevel": 3
}
}}
{{#sectionbulk}}
@@ -50,7 +51,7 @@
{{/sitehome}}
{{^sitehome}}
{{^displayonesection}}
-
+
{{/displayonesection}}
{{/sitehome}}
diff --git a/course/format/topics/classes/output/courseformat/content/section.php b/course/format/topics/classes/output/courseformat/content/section.php
index ca41d215527..a7c50d734d7 100644
--- a/course/format/topics/classes/output/courseformat/content/section.php
+++ b/course/format/topics/classes/output/courseformat/content/section.php
@@ -45,7 +45,7 @@ class section extends section_base {
$data = parent::export_for_template($output);
- if (!$this->format->get_sectionnum()) {
+ if (!$this->format->get_sectionnum() && !$this->section->is_delegated()) {
$addsectionclass = $format->get_output_classname('content\\addsection');
$addsection = new $addsectionclass($format);
$data->numsections = $addsection->export_for_template($output);
diff --git a/course/renderer.php b/course/renderer.php
index f667bfd11bf..8de46e710e2 100644
--- a/course/renderer.php
+++ b/course/renderer.php
@@ -141,10 +141,9 @@ class core_course_renderer extends plugin_renderer_base {
* Build the HTML for the module chooser javascript popup.
*
* @param int $courseid The course id to fetch modules for.
- * @param int|null $sectionnum The section number to fetch modules for.
* @return string
*/
- public function course_activitychooser($courseid, ?int $sectionnum = null) {
+ public function course_activitychooser($courseid) {
if (!$this->page->requires->should_create_one_time_item_now('core_course_modchooser')) {
return '';
@@ -154,7 +153,7 @@ class core_course_renderer extends plugin_renderer_base {
$chooserconfig = (object) [
'tabmode' => get_config('core', 'activitychoosertabmode'),
];
- $this->page->requires->js_call_amd('core_course/activitychooser', 'init', [$courseid, $chooserconfig, $sectionnum]);
+ $this->page->requires->js_call_amd('core_course/activitychooser', 'init', [$courseid, $chooserconfig]);
return '';
}
@@ -232,7 +231,7 @@ class core_course_renderer extends plugin_renderer_base {
$ajaxcontrol = $this->render_from_template('course/activitychooserbutton', $data);
// Load the JS for the modal.
- $this->course_activitychooser($course->id, $section);
+ $this->course_activitychooser($course->id);
return $ajaxcontrol;
}
diff --git a/mod/subsection/classes/manager.php b/mod/subsection/classes/manager.php
index 3e6271e00ec..612d6e53e7a 100644
--- a/mod/subsection/classes/manager.php
+++ b/mod/subsection/classes/manager.php
@@ -19,8 +19,10 @@ namespace mod_subsection;
use cm_info;
use context_module;
use completion_info;
+use core_courseformat\formatactions;
use mod_subsection\event\course_module_viewed;
use moodle_page;
+use section_info;
use stdClass;
/**
@@ -180,4 +182,23 @@ class manager {
$completion = new completion_info($course);
$completion->set_module_viewed($this->cm);
}
+
+ /**
+ * Get the delegated section info.
+ *
+ * @return section_info the delegated section info
+ */
+ public function get_delegated_section_info(): section_info {
+ $delegatedsection = $this->cm->get_delegated_section_info();
+ if (!$delegatedsection) {
+ // Some restorations can produce a situation where the section is not found.
+ // In that case, we create a new one.
+ $delegatedsection = formatactions::section($this->cm->course)->create_delegated(
+ self::PLUGINNAME,
+ $this->cm->id,
+ (object) ['name' => $this->instance->name],
+ );
+ }
+ return $delegatedsection;
+ }
}
diff --git a/mod/subsection/lib.php b/mod/subsection/lib.php
index 9a8ed89e8df..b45271cea3b 100644
--- a/mod/subsection/lib.php
+++ b/mod/subsection/lib.php
@@ -207,3 +207,39 @@ function subsection_extend_navigation($subsectionnode, $course, $module, $cm) {
*/
function subsection_extend_settings_navigation($settingsnav, $subsectionnode = null) {
}
+
+/**
+ * Sets dynamic information about a course module
+ *
+ * This function is called from cm_info when displaying the module
+ * mod_subsection can be displayed inline on course page and therefore have no course link
+ *
+ * @param cm_info $cm
+ */
+function subsection_cm_info_dynamic(cm_info $cm) {
+ $cm->set_no_view_link();
+}
+
+/**
+ * Sets the special subsection display on course page.
+ *
+ * @param cm_info $cm Course-module object
+ */
+function subsection_cm_info_view(cm_info $cm) {
+ global $DB, $PAGE;
+
+ $cm->set_custom_cmlist_item(true);
+ $course = $DB->get_record('course', ['id' => $cm->course], '*', MUST_EXIST);
+
+ // Get the section info.
+ $delegatedsection = manager::create_from_coursemodule($cm)->get_delegated_section_info();
+
+ // Render the delegated section.
+ $format = course_get_format($course);
+ $renderer = $PAGE->get_renderer('format_' . $course->format);
+ $outputclass = $format->get_output_classname('content\\delegatedsection');
+ /** @var \core_courseformat\output\local\content\delegatedsection $delegatedsectionoutput */
+ $delegatedsectionoutput = new $outputclass($format, $delegatedsection);
+
+ $cm->set_content($renderer->render($delegatedsectionoutput), true);
+}
diff --git a/mod/subsection/tests/behat/subsection_actionmenu.feature b/mod/subsection/tests/behat/subsection_actionmenu.feature
index ed1aa6dae47..7c180323305 100644
--- a/mod/subsection/tests/behat/subsection_actionmenu.feature
+++ b/mod/subsection/tests/behat/subsection_actionmenu.feature
@@ -101,7 +101,7 @@ Feature: The module menu replaces the delegated section menu
When I choose "Edit settings" in the open action menu
And the field "Section name" matches value "Subsection1"
And I click on "Cancel" "button"
- And I am on the "Subsection1" "subsection activity" page
+ And I am on the "C1 > Subsection1" "course > section" page
# Subsection page. Open the section header action menu.
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
And I choose "Edit settings" in the open action menu
@@ -120,7 +120,7 @@ Feature: The module menu replaces the delegated section menu
When I choose "Permalink" in the open action menu
Then I click on "Copy to clipboard" "link"
And I should see "Text copied to clipboard"
- And I am on the "Subsection1" "subsection activity" page
+ And I am on the "C1 > Subsection1" "course > section" page
# Subsection page. Open the section header action menu.
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
And I choose "Permalink" in the open action menu
@@ -153,7 +153,7 @@ Feature: The module menu replaces the delegated section menu
And I choose "Delete" in the open action menu
And I click on "Delete" "button" in the "Delete activity?" "dialogue"
And "Subsection2" "link" should not exist in the "#region-main-box" "css_element"
- And I am on the "Subsection3" "subsection activity" page
+ And I am on the "C1 > Subsection3" "course > section" page
# Subsection page. Open the section header action menu.
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
And "Delete" "link" should not exist in the "[data-region='header-actions-container']" "css_element"
diff --git a/mod/subsection/tests/behat/subsection_coursepage.feature b/mod/subsection/tests/behat/subsection_coursepage.feature
new file mode 100644
index 00000000000..2caa5b96b58
--- /dev/null
+++ b/mod/subsection/tests/behat/subsection_coursepage.feature
@@ -0,0 +1,66 @@
+@mod @mod_subsection
+Feature: Users view subsections on course page
+ In order to use subsections
+ As an user
+ I need to view subsections on course page
+
+ Background:
+ Given I enable "subsection" "mod" plugin
+ And the following "users" exist:
+ | username | firstname | lastname | email |
+ | teacher1 | Teacher | 1 | teacher1@example.com |
+ | student1 | Student | 1 | student1@example.com |
+ And the following "courses" exist:
+ | fullname | shortname | category | numsections |
+ | Course 1 | C1 | 0 | 2 |
+ And the following "course enrolments" exist:
+ | user | course | role |
+ | teacher1 | C1 | editingteacher |
+ | student1 | C1 | student |
+ And the following "activities" exist:
+ | activity | name | course | idnumber | section |
+ | subsection | Subsection1 | C1 | sub1 | 1 |
+ | page | Page1 in Subsection1 | C1 | page11 | 3 |
+ | subsection | Subsection2 | C1 | sub2 | 1 |
+
+ @javascript
+ Scenario: Student can view, expand and collapse subsections on course page
+ When I log in as "student1"
+ And I am on "Course 1" course homepage
+ Then I should see "Subsection1" in the "region-main" "region"
+ And I should see "Page1 in Subsection1" in the "Subsection1" "activity"
+ And I click on "Collapse" "link" in the "Subsection1" "activity"
+ And I should not see "Page1 in Subsection1" in the "Subsection1" "activity"
+ And I click on "Expand" "link" in the "Subsection1" "activity"
+ And I click on "Page1 in Subsection1" "link" in the "Subsection1" "activity"
+
+ @javascript
+ Scenario: Teacher can create activities inside subsections on course page
+ When I log in as "teacher1"
+ And I am on "Course 1" course homepage with editing mode on
+ # Add an assignment to the top of Subsection1.
+ And I hover "Insert an activity or resource before 'Page1 in Subsection1'" "button"
+ And I press "Insert an activity or resource before 'Page1 in Subsection1'"
+ And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
+ And I set the following fields to these values:
+ | Assignment name | Assignment1 in Subsection1 |
+ And I press "Save and return to course"
+ Then I should see "Assignment1 in Subsection1" in the "Subsection1" "activity"
+ # Add an assignment to the empty Subsection2.
+ And I add an "assign" activity to course "Course 1" section "4" and I fill the form with:
+ | Assignment name | Assignment1 in Subsection2 |
+ And I should see "Assignment1 in Subsection2" in the "Subsection2" "activity"
+
+ @javascript
+ Scenario: Teacher can create activities between subsections on course page
+ When I log in as "teacher1"
+ And I am on "Course 1" course homepage with editing mode on
+ And I hover "Insert an activity or resource before 'Subsection2'" "button"
+ And I press "Insert an activity or resource before 'Subsection2'"
+ And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
+ And I set the following fields to these values:
+ | Assignment name | Assignment between subsections |
+ And I press "Save and return to course"
+ And I wait "5" seconds
+ And "Assignment between subsections" "link" should appear after "Page1 in Subsection1" "text"
+ And "Assignment between subsections" "link" should appear before "Subsection2" "text"
diff --git a/mod/subsection/tests/behat/subsection_rename.feature b/mod/subsection/tests/behat/subsection_rename.feature
index e1d758a709c..ec310da2a98 100644
--- a/mod/subsection/tests/behat/subsection_rename.feature
+++ b/mod/subsection/tests/behat/subsection_rename.feature
@@ -25,10 +25,11 @@ Feature: Teachers can rename subsections
@javascript
Scenario: Renaming the subsection activity changes the subsection name
Given I should see "Subsection activity" in the "page-content" "region"
- When I set the field "Edit title" in the "Subsection activity" "activity" to "New name"
+ When I set the field "Edit section name" in the "Subsection activity" "activity" to "New name"
And I should not see "Subsection activity" in the "region-main" "region"
And I should see "New name" in the "page-content" "region"
- Then I click on "New name" "link" in the "page-content" "region"
+ Then I open "New name" actions menu
+ And I choose "View" in the open action menu
And I should see "New name" in the "page" "region"
And I should see "Subactivity" in the "region-main" "region"
diff --git a/mod/subsection/tests/behat/subsection_handling.feature b/mod/subsection/tests/behat/subsection_sectionpage.feature
similarity index 67%
rename from mod/subsection/tests/behat/subsection_handling.feature
rename to mod/subsection/tests/behat/subsection_sectionpage.feature
index 0224555f3b8..3e99c1bccc5 100644
--- a/mod/subsection/tests/behat/subsection_handling.feature
+++ b/mod/subsection/tests/behat/subsection_sectionpage.feature
@@ -1,6 +1,6 @@
@mod @mod_subsection
-Feature: Teachers create and destroy subsections
- In order to use subsections
+Feature: Teachers create and destroy subsections on section page
+ In order to use subsections on section page
As an teacher
I need to create and destroy subsections
@@ -17,18 +17,6 @@ Feature: Teachers create and destroy subsections
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
- Scenario: Subsections are not listed as regular sections
- Given the following "activities" exist:
- | activity | name | course | idnumber | section |
- | subsection | Subsection1 | C1 | forum1 | 1 |
- | data | Subactivity1 | C1 | data1 | 3 |
- When I am on "Course 1" course homepage
- Then "Subsection1" "section" should not exist
- And I should not see "Subactivity1" in the "region-main" "region"
- And I click on "Subsection1" "link" in the "region-main" "region"
- And I should see "Subsection1" in the "page" "region"
- And I should see "Subactivity1" in the "region-main" "region"
-
Scenario: Activities can be created in a subsection
Given the following "activities" exist:
| activity | name | course | idnumber | section |
@@ -40,8 +28,6 @@ Feature: Teachers create and destroy subsections
And I am on "Course 1" course homepage
And I click on "Subsection1" "link" in the "region-main" "region"
Then I should see "Test assignment name" in the "region-main" "region"
- And I am on "Course 1" course homepage
- And I should not see "Test assignment name" in the "region-main" "region"
@javascript
Scenario: Teacher can create activities in a subsection page with the activity chooser
@@ -57,5 +43,3 @@ Feature: Teachers create and destroy subsections
| Description | Test assignment description |
And I press "Save and return to course"
Then I should see "Test assignment name" in the "region-main" "region"
- And I am on "Course 1" course homepage
- And I should not see "Test assignment name" in the "region-main" "region"
diff --git a/mod/subsection/view.php b/mod/subsection/view.php
index 82f97a7bede..aa1fa788b57 100644
--- a/mod/subsection/view.php
+++ b/mod/subsection/view.php
@@ -39,19 +39,6 @@ require_login($course, true, $cm);
$modulecontext = $manager->get_context();
$manager->set_module_viewed($course);
+$delegatesection = $manager->get_delegated_section_info();
-$modinfo = get_fast_modinfo($course);
-
-$delegatesection = $modinfo->get_section_info_by_component(manager::PLUGINNAME, $moduleinstance->id);
-if (!$delegatesection) {
- // Some restorations can produce a situation where the section is not found.
- // In that case, we create a new one.
- formatactions::section($course)->create_delegated(
- manager::PLUGINNAME,
- $id,
- (object) [
- 'name' => $moduleinstance->name,
- ]
- );
-}
redirect(new moodle_url('/course/section.php', ['id' => $delegatesection->id]));
diff --git a/theme/boost/scss/moodle/course.scss b/theme/boost/scss/moodle/course.scss
index f36eb2b0a5f..035e6f55024 100644
--- a/theme/boost/scss/moodle/course.scss
+++ b/theme/boost/scss/moodle/course.scss
@@ -1078,6 +1078,7 @@ span.editinstructions {
/* Variables definition*/
+$activity-item-padding: 0.75rem !default;
$activity-border-radius: 1rem !default;
$activity-border-width: 2px !default;
$activity-hover-border-color: $primary !default;
@@ -1211,10 +1212,15 @@ $divider-hover-color: $primary !default;
}
// Override '.btn.btn-icon' styles from buttons.scss to make action menu buttons smaller.
- .action-menu .btn.btn-icon {
- height: map-get($iconsizes, 5);
- width: map-get($iconsizes, 5);
- @include border-radius();
+ .action-menu {
+ .btn.btn-icon {
+ height: map-get($iconsizes, 5);
+ width: map-get($iconsizes, 5);
+ @include border-radius();
+ }
+ &.section-actions .btn.btn-icon {
+ font-size: $font-size-lg;
+ }
}
.section-summary-activities {
@@ -1299,8 +1305,9 @@ $divider-hover-color: $primary !default;
padding-top: map-get($spacers, 1);
margin-top: map-get($spacers, 1);
border-top: $border-width solid $border-color;
- // Custom styles for activity while editing.
- .editing & {
+ // Custom styles for activity while editing and for the first activity card in the section.
+ .editing &,
+ .section &:first-child {
// Remove activity top border and spacing, while editing a separator is displayed.
padding-top: 0;
margin-top: 0;
@@ -1310,10 +1317,10 @@ $divider-hover-color: $primary !default;
.activity-item {
position: relative;
- padding: .75rem;
- background-color: $white;
+ padding: $activity-item-padding;
+ @include border-radius($activity-border-radius);
&.activityinline {
- padding: .75rem 0;
+ padding: $activity-item-padding 0;
}
&.hiddenactivity {
background-color: $gray-100;
@@ -1325,14 +1332,13 @@ $divider-hover-color: $primary !default;
// Custom styles for activity cards while editing.
.editing & {
cursor: move;
- border: $activity-border-width solid transparent;
- @include border-radius($activity-border-radius);
.a {
cursor: pointer;
}
- &:hover,
+ // Add a border on hover to the activity card (avoiding hover effect in inner activities).
+ &:hover:not(:has(.activity:hover)),
&.selected {
- border: $activity-border-width solid $activity-hover-border-color;
+ outline: $activity-border-width solid $activity-hover-border-color;
box-shadow: $box-shadow-sm;
.activityiconcontainer,
.badge {
@@ -1677,6 +1683,11 @@ $divider-hover-color: $primary !default;
position: absolute;
left: -2rem;
}
+ // Delegated sections are not available for bulk editing.
+ &:has(.delegated-section):hover {
+ outline: none !important; // stylelint-disable-line declaration-no-important
+ box-shadow: none !important; // stylelint-disable-line declaration-no-important
+ }
}
.course-section-header .bulkselect {
left: -2.75rem;
@@ -1737,6 +1748,7 @@ $divider-hover-color: $primary !default;
}
/* Styles for the Move activity and Move section modals */
+
.move-activity-tree {
.collapse-list-item {
@include border-radius();
@@ -1776,3 +1788,50 @@ $divider-hover-color: $primary !default;
font-weight: bold;
}
}
+
+/* Subsection specific styles */
+
+.activity.subsection {
+ border-top: none;
+ > .activity-item {
+ border: $border-width solid $border-color;
+ padding: 0;
+ .activity-altcontent {
+ margin-top: 0;
+ }
+ }
+ .section {
+ margin-top: 0;
+ .section-item {
+ border: none;
+ padding: $activity-item-padding;
+ }
+ .icons-collapse-expand:has(+ h4) {
+ height: map-get($iconsizes, 4);
+ width: map-get($iconsizes, 4);
+ font-size: $font-size-sm;
+ }
+ h4 {
+ font-size: $h5-font-size;
+ }
+ .section-actions .btn.btn-icon {
+ font-size: inherit;
+ }
+ }
+ + .activity {
+ border-top: none;
+ }
+ // Allow v-parent-focus only for closest acvitity (avoiding subsection).
+ .focus-control:not(:has(.focus-control)) {
+ &:focus-within .v-parent-focus,
+ &:hover .v-parent-focus {
+ opacity: 1 !important; // stylelint-disable-line declaration-no-important
+ visibility: visible !important; // stylelint-disable-line declaration-no-important
+ }
+ }
+ .focus-control:focus-within .focus-control .v-parent-focus,
+ .focus-control:hover .focus-control .v-parent-focus {
+ opacity: 0;
+ visibility: hidden;
+ }
+}
diff --git a/theme/boost/scss/moodle/undo.scss b/theme/boost/scss/moodle/undo.scss
index 0cb23fbb6ba..e384d7804da 100644
--- a/theme/boost/scss/moodle/undo.scss
+++ b/theme/boost/scss/moodle/undo.scss
@@ -11,7 +11,6 @@ li.activity.label,
.file-picker td.label {
background: inherit;
color: inherit;
- border: inherit;
text-shadow: none;
white-space: normal;
display: block;
@@ -21,6 +20,7 @@ li.activity.label,
}
.file-picker td.label {
+ border: inherit;
display: table-cell;
text-align: right;
padding: 8px;
@@ -55,7 +55,7 @@ li.activity.label,
* it to white?
*/
-li.section.hidden,
+.section.hidden,
.block.hidden,
.block.invisible {
visibility: visible;
diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css
index 045580a0e08..ae6f748b20b 100644
--- a/theme/boost/style/moodle.css
+++ b/theme/boost/style/moodle.css
@@ -29068,6 +29068,9 @@ span.editinstructions .alert-link {
width: 32px;
border-radius: 0.5rem;
}
+.course-section .action-menu.section-actions .btn.btn-icon {
+ font-size: 1.171875rem;
+}
.course-section .section-summary-activities .icon {
width: inherit;
color: #0f6cbf;
@@ -29133,7 +29136,7 @@ span.editinstructions .alert-link {
margin-top: 0.25rem;
border-top: 1px solid #dee2e6;
}
-.editing .activity {
+.editing .activity, .section .activity:first-child {
padding-top: 0;
margin-top: 0;
border-top: none;
@@ -29142,7 +29145,7 @@ span.editinstructions .alert-link {
.activity-item {
position: relative;
padding: 0.75rem;
- background-color: #fff;
+ border-radius: 1rem;
}
.activity-item.activityinline {
padding: 0.75rem 0;
@@ -29156,18 +29159,16 @@ span.editinstructions .alert-link {
}
.editing .activity-item {
cursor: move;
- border: 2px solid transparent;
- border-radius: 1rem;
}
.editing .activity-item .a {
cursor: pointer;
}
-.editing .activity-item:hover, .editing .activity-item.selected {
- border: 2px solid #0f6cbf;
+.editing .activity-item:hover:not(:has(.activity:hover)), .editing .activity-item.selected {
+ outline: 2px solid #0f6cbf;
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}
-.editing .activity-item:hover .activityiconcontainer,
-.editing .activity-item:hover .badge, .editing .activity-item.selected .activityiconcontainer,
+.editing .activity-item:hover:not(:has(.activity:hover)) .activityiconcontainer,
+.editing .activity-item:hover:not(:has(.activity:hover)) .badge, .editing .activity-item.selected .activityiconcontainer,
.editing .activity-item.selected .badge {
mix-blend-mode: multiply;
}
@@ -29863,6 +29864,10 @@ span.editinstructions .alert-link {
position: absolute;
left: -2rem;
}
+.bulkenabled .activity-item:has(.delegated-section):hover {
+ outline: none !important;
+ box-shadow: none !important;
+}
.bulkenabled .course-section-header .bulkselect {
left: -2.75rem;
position: relative;
@@ -29941,6 +29946,48 @@ span.editinstructions .alert-link {
font-weight: bold;
}
+/* Subsection specific styles */
+.activity.subsection {
+ border-top: none;
+}
+.activity.subsection > .activity-item {
+ border: 1px solid #dee2e6;
+ padding: 0;
+}
+.activity.subsection > .activity-item .activity-altcontent {
+ margin-top: 0;
+}
+.activity.subsection .section {
+ margin-top: 0;
+}
+.activity.subsection .section .section-item {
+ border: none;
+ padding: 0.75rem;
+}
+.activity.subsection .section .icons-collapse-expand:has(+ h4) {
+ height: 24px;
+ width: 24px;
+ font-size: 0.8203125rem;
+}
+.activity.subsection .section h4 {
+ font-size: 1.171875rem;
+}
+.activity.subsection .section .section-actions .btn.btn-icon {
+ font-size: inherit;
+}
+.activity.subsection + .activity {
+ border-top: none;
+}
+.activity.subsection .focus-control:not(:has(.focus-control)):focus-within .v-parent-focus, .activity.subsection .focus-control:not(:has(.focus-control)):hover .v-parent-focus {
+ opacity: 1 !important;
+ visibility: visible !important;
+}
+.activity.subsection .focus-control:focus-within .focus-control .v-parent-focus,
+.activity.subsection .focus-control:hover .focus-control .v-parent-focus {
+ opacity: 0;
+ visibility: hidden;
+}
+
/* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */
:target,
:focus {
@@ -36146,7 +36193,6 @@ li.activity.label,
.file-picker td.label {
background: inherit;
color: inherit;
- border: inherit;
text-shadow: none;
white-space: normal;
display: block;
@@ -36156,6 +36202,7 @@ li.activity.label,
}
.file-picker td.label {
+ border: inherit;
display: table-cell;
text-align: right;
padding: 8px;
@@ -36187,7 +36234,7 @@ li.activity.label,
* nice effect, though they'd still be active. Maybe reverse
* it to white?
*/
-li.section.hidden,
+.section.hidden,
.block.hidden,
.block.invisible {
visibility: visible;
diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css
index 96e0804f59d..f02544c7eee 100644
--- a/theme/classic/style/moodle.css
+++ b/theme/classic/style/moodle.css
@@ -29068,6 +29068,9 @@ span.editinstructions .alert-link {
width: 32px;
border-radius: 0.25rem;
}
+.course-section .action-menu.section-actions .btn.btn-icon {
+ font-size: 1.171875rem;
+}
.course-section .section-summary-activities .icon {
width: inherit;
color: #0f6cbf;
@@ -29133,7 +29136,7 @@ span.editinstructions .alert-link {
margin-top: 0.25rem;
border-top: 1px solid #dee2e6;
}
-.editing .activity {
+.editing .activity, .section .activity:first-child {
padding-top: 0;
margin-top: 0;
border-top: none;
@@ -29142,7 +29145,7 @@ span.editinstructions .alert-link {
.activity-item {
position: relative;
padding: 0.75rem;
- background-color: #fff;
+ border-radius: 1rem;
}
.activity-item.activityinline {
padding: 0.75rem 0;
@@ -29156,18 +29159,16 @@ span.editinstructions .alert-link {
}
.editing .activity-item {
cursor: move;
- border: 2px solid transparent;
- border-radius: 1rem;
}
.editing .activity-item .a {
cursor: pointer;
}
-.editing .activity-item:hover, .editing .activity-item.selected {
- border: 2px solid #0f6cbf;
+.editing .activity-item:hover:not(:has(.activity:hover)), .editing .activity-item.selected {
+ outline: 2px solid #0f6cbf;
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}
-.editing .activity-item:hover .activityiconcontainer,
-.editing .activity-item:hover .badge, .editing .activity-item.selected .activityiconcontainer,
+.editing .activity-item:hover:not(:has(.activity:hover)) .activityiconcontainer,
+.editing .activity-item:hover:not(:has(.activity:hover)) .badge, .editing .activity-item.selected .activityiconcontainer,
.editing .activity-item.selected .badge {
mix-blend-mode: multiply;
}
@@ -29863,6 +29864,10 @@ span.editinstructions .alert-link {
position: absolute;
left: -2rem;
}
+.bulkenabled .activity-item:has(.delegated-section):hover {
+ outline: none !important;
+ box-shadow: none !important;
+}
.bulkenabled .course-section-header .bulkselect {
left: -2.75rem;
position: relative;
@@ -29941,6 +29946,48 @@ span.editinstructions .alert-link {
font-weight: bold;
}
+/* Subsection specific styles */
+.activity.subsection {
+ border-top: none;
+}
+.activity.subsection > .activity-item {
+ border: 1px solid #dee2e6;
+ padding: 0;
+}
+.activity.subsection > .activity-item .activity-altcontent {
+ margin-top: 0;
+}
+.activity.subsection .section {
+ margin-top: 0;
+}
+.activity.subsection .section .section-item {
+ border: none;
+ padding: 0.75rem;
+}
+.activity.subsection .section .icons-collapse-expand:has(+ h4) {
+ height: 24px;
+ width: 24px;
+ font-size: 0.8203125rem;
+}
+.activity.subsection .section h4 {
+ font-size: 1.171875rem;
+}
+.activity.subsection .section .section-actions .btn.btn-icon {
+ font-size: inherit;
+}
+.activity.subsection + .activity {
+ border-top: none;
+}
+.activity.subsection .focus-control:not(:has(.focus-control)):focus-within .v-parent-focus, .activity.subsection .focus-control:not(:has(.focus-control)):hover .v-parent-focus {
+ opacity: 1 !important;
+ visibility: visible !important;
+}
+.activity.subsection .focus-control:focus-within .focus-control .v-parent-focus,
+.activity.subsection .focus-control:hover .focus-control .v-parent-focus {
+ opacity: 0;
+ visibility: hidden;
+}
+
/* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */
:target,
:focus {
@@ -36146,7 +36193,6 @@ li.activity.label,
.file-picker td.label {
background: inherit;
color: inherit;
- border: inherit;
text-shadow: none;
white-space: normal;
display: block;
@@ -36156,6 +36202,7 @@ li.activity.label,
}
.file-picker td.label {
+ border: inherit;
display: table-cell;
text-align: right;
padding: 8px;
@@ -36187,7 +36234,7 @@ li.activity.label,
* nice effect, though they'd still be active. Maybe reverse
* it to white?
*/
-li.section.hidden,
+.section.hidden,
.block.hidden,
.block.invisible {
visibility: visible;