Skip to content

Commit

Permalink
MDL-76992 core_courseindex: Apply indentation in the course index
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaia Anabitarte committed Feb 28, 2023
1 parent b37fe9a commit 2a7632f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion course/format/amd/build/local/courseindex/cm.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion course/format/amd/build/local/courseindex/cm.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions course/format/amd/src/local/courseindex/cm.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default class Component extends DndCmItem {
LOCKED: 'editinprogress',
RESTRICTIONS: 'restrictions',
PAGEITEM: 'pageitem',
INDENTED: 'indented',
};
// We need our id to watch specific events.
this.id = this.element.dataset.id;
Expand Down Expand Up @@ -132,6 +133,7 @@ export default class Component extends DndCmItem {
this.element.classList.toggle(this.classes.DRAGGING, element.dragging ?? false);
this.element.classList.toggle(this.classes.LOCKED, element.locked ?? false);
this.element.classList.toggle(this.classes.RESTRICTIONS, element.hascmrestrictions ?? false);
this.element.classList.toggle(this.classes.INDENTED, element.indent);
this.locked = element.locked;
}

Expand Down
6 changes: 4 additions & 2 deletions course/format/templates/local/courseindex/cm.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
"isactive": 1,
"uniqid": "0",
"accessvisible": 1,
"hascmrestrictions": 0
"hascmrestrictions": 0,
"indent": 1
}
}}
<li class="courseindex-item
{{#isactive}}active{{/isactive}}
{{#hascmrestrictions}}restrictions{{/hascmrestrictions}}
{{^accessvisible}}dimmed{{/accessvisible}}
{{#url}} d-flex {{/url}} {{^url}} d-flex-noedit {{/url}}"
{{#url}} d-flex {{/url}} {{^url}} d-flex-noedit {{/url}}
{{#indent}} indented {{/indent}}"
id="{{uniqid}}-course-index-cm-{{id}}"
data-for="cm"
data-id="{{id}}"
Expand Down
4 changes: 4 additions & 0 deletions theme/boost/scss/moodle/courseindex.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ $courseindex-item-current: $primary !default;
color: $danger;
}
}

&.indented {
margin-left: map-get($spacers, 3);
}
}

// The full section collapsable.
Expand Down
2 changes: 2 additions & 0 deletions theme/boost/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -21892,6 +21892,8 @@ div.editor_atto_toolbar button .icon {
color: #357a32; }
.courseindex .courseindex-item .completioninfo.completion_fail {
color: #ca3120; }
.courseindex .courseindex-item.indented {
margin-left: 1rem; }

.courseindex .courseindex-section {
border-left: solid 3px transparent; }
Expand Down
2 changes: 2 additions & 0 deletions theme/classic/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -21838,6 +21838,8 @@ div.editor_atto_toolbar button .icon {
color: #357a32; }
.courseindex .courseindex-item .completioninfo.completion_fail {
color: #ca3120; }
.courseindex .courseindex-item.indented {
margin-left: 1rem; }

.courseindex .courseindex-section {
border-left: solid 3px transparent; }
Expand Down

0 comments on commit 2a7632f

Please sign in to comment.