Skip to content

Commit

Permalink
Hide maintenance-mode content from ToC
Browse files Browse the repository at this point in the history
Fixes #1124
Fixes #438
  • Loading branch information
ihalaij1 authored and markkuriekkinen committed May 31, 2023
1 parent 4db0acb commit ba02dcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion exercise/cache/hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ def is_listed(cls, entry):
return (
entry.get('category_status') != LearningObjectCategory.STATUS.HIDDEN
and entry.get('module_status') != CourseModule.STATUS.UNLISTED
and entry['status'] != LearningObject.STATUS.UNLISTED
and not entry['status'] in (
LearningObject.STATUS.UNLISTED,
LearningObject.STATUS.MAINTENANCE,
)
)
if t == 'module':
return entry['status'] != CourseModule.STATUS.UNLISTED
Expand Down
2 changes: 1 addition & 1 deletion exercise/templates/exercise/_children.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% if entry.is_empty %}
{{ entry.name|parse_localization }}
{% else %}
<a href="{{ entry.link }}" class="{% if entry|is_in_maintenance %}maintenance{% endif %}">{{ entry.name|parse_localization }}</a>
<a href="{{ entry.link }}">{{ entry.name|parse_localization }}</a>
{% endif %}
{% if entry.submission_count %}
{% points_badge entry %}
Expand Down

0 comments on commit ba02dcc

Please sign in to comment.