Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions example.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,14 @@
"body": "Body",
"instruction": "Instruction"
}

// course.json
// Priority labels configuration
"_globals": {
"_priorityLabels": {
"_menuItem": {
"_showWhenOptional": false,
"_showWhenRequired": false
}
}
}
18 changes: 18 additions & 0 deletions templates/boxMenuItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export default function BoxMenuItem (props) {
_isComplete,
title,
_isOptional,
_priorityClass,
_priorityIconClass,
priorityLabel,
_nthChild,
_totalChild
} = props;
Expand Down Expand Up @@ -49,6 +52,21 @@ export default function BoxMenuItem (props) {
<div className="menu-item__details boxmenu-item__details">
<div className="menu-item__details-inner boxmenu-item__details-inner">

{priorityLabel &&
<div className={classes([
'menu-item__priority boxmenu-item__priority',
_priorityClass
])}>
{_priorityIconClass &&
<span className={classes(['icon', _priorityIconClass])} aria-hidden="true" />
}
<div
className="menu-item__priority-label boxmenu-item__priority-label"
dangerouslySetInnerHTML={{ __html: compile(priorityLabel, props) }}
/>
</div>
}

{displayTitle &&
<div className="menu-item__title boxmenu-item__title">
<div
Expand Down