Skip to content

Commit

Permalink
fix: add hide_from_toc field as inheritable
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Dec 18, 2023
1 parent f01ad94 commit aa347d8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
10 changes: 9 additions & 1 deletion cms/static/js/views/modals/course_outline_modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -1064,12 +1064,20 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
if (this.currentVisibility() === 'staff_only') {
metadata.visible_to_staff_only = true;
metadata.hide_after_due = null;
metadata.hide_from_toc = null;
} else if (this.currentVisibility() === 'hide_after_due') {
metadata.visible_to_staff_only = null;
metadata.hide_after_due = true;
} else {
metadata.hide_from_toc = null;
} else if (this.currentVisibility() === 'hide_from_toc'){
metadata.visible_to_staff_only = null;
metadata.hide_after_due = null;
metadata.hide_from_toc = true;
}
else {
metadata.visible_to_staff_only = null;
metadata.hide_after_due = null;
metadata.hide_from_toc = null;
}

return {
Expand Down
25 changes: 15 additions & 10 deletions cms/static/sass/elements/_modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -507,17 +507,17 @@ $outline-indent-width: $baseline;
}
}

// CASE: is hidden from TOC
&.is-hidden-from-toc {
// needed to make sure direct children only
> .section-status,
> .subsection-status,
> .unit-status {
.status-message .icon {
color: $color-hide-from-toc;
}
// CASE: is hidden from TOC
&.is-hidden-from-toc {
// needed to make sure direct children only
> .section-status,
> .subsection-status,
> .unit-status {
.status-message .icon {
color: $color-hide-from-toc;
}
}
}

// CASE: has gated content
&.is-gated {
Expand Down Expand Up @@ -615,6 +615,11 @@ $outline-indent-width: $baseline;
border-left-color: $color-staff-only;
}

// CASE: is hidden from TOC
&.is-hidden-from-toc {
border-left-color: $color-hide-from-toc;
}

// CASE: has gated content
&.is-gated {
border-left-color: $color-gated;
Expand Down Expand Up @@ -711,7 +716,7 @@ $outline-indent-width: $baseline;
}

// CASE: is hidden from TOC
&.is-staff-only {
&.is-hidden-from-toc {
border-left-color: $color-hide-from-toc;
}

Expand Down
7 changes: 7 additions & 0 deletions xmodule/modulestore/inheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ class InheritanceMixin(XBlockMixin):
scope=Scope.settings
)

hide_from_toc = Boolean(
display_name=_("Hide from Table of Contents"),
help=_("Enter true or false. If true, this block will be hidden from the Table of Contents."),
default=False,
scope=Scope.settings
)

@property
def close_date(self):
"""
Expand Down

0 comments on commit aa347d8

Please sign in to comment.