Skip to content

Commit

Permalink
MDL-73952 core_course: Rename iscurrent to highlighted
Browse files Browse the repository at this point in the history
The term 'iscurrent' suggests that something is current, when this may
not be technically true. The term highlight is more appropriate as we
are highlighting content. Whether that content is for the current week
may also be true, but it may be that some course formats allow multiple
sections to be highlighted.
  • Loading branch information
andrewnicols committed Mar 28, 2022
1 parent a313795 commit 495da02
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion course/amd/build/actions.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion course/amd/build/actions.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions course/amd/src/actions.js
Expand Up @@ -616,13 +616,13 @@ define(
replaceActionItem(actionItem, 'i/marked',
'highlightoff', 'core', 'removemarker');
courseeditor.dispatch('legacySectionAction', action, sectionid);
setSectionBadge(sectionElement[0], 'iscurrent', true);
setSectionBadge(sectionElement[0], 'highlighted', true);
} else if (action === 'removemarker') {
sectionElement.removeClass('current');
replaceActionItem(actionItem, 'i/marker',
'highlight', 'core', 'setmarker');
courseeditor.dispatch('legacySectionAction', action, sectionid);
setSectionBadge(sectionElement[0], 'iscurrent', false);
setSectionBadge(sectionElement[0], 'highlighted', false);
}
};

Expand Down
8 changes: 4 additions & 4 deletions course/format/templates/local/content/section/badges.mustache
Expand Up @@ -23,14 +23,14 @@
Example context (json):
{
"iscurrent" : true,
"highlighted" : true,
"hiddenfromstudents" : "1",
"notavailable" : "0",
"highlightedlabel" : "Highlighted"
}
}}
{{#editing}}
<span class="badge badge-pill badge-primary order-1 {{^iscurrent}}d-none{{/iscurrent}}" data-type="iscurrent">
<span class="badge badge-pill badge-primary order-1 {{^highlighted}}d-none{{/highlighted}}" data-type="highlighted">
{{ highlightedlabel }}
</span>
<span class="badge badge-pill badge-warning order-2 {{^hiddenfromstudents}}d-none{{/hiddenfromstudents}}" data-type="hiddenfromstudents">
Expand All @@ -41,9 +41,9 @@
</span>
{{/editing}}
{{^editing}}
{{#iscurrent}}
{{#highlighted}}
<span class="badge badge-pill badge-primary order-1">{{ highlightedlabel }}</span>
{{/iscurrent}}
{{/highlighted}}
{{#hiddenfromstudents}}
<span class="badge badge-pill badge-warning order-2">{{#str}}hiddenfromstudents{{/str}}</span>
{{/hiddenfromstudents}}
Expand Down

0 comments on commit 495da02

Please sign in to comment.