Skip to content
Snippets Groups Projects
Commit 72341569 authored by David Ormsbee's avatar David Ormsbee
Browse files

Remove sections from ever getting appended in the first place if hide_from_toc is true

parent 2671801f
No related branches found
No related tags found
No related merge requests found
......@@ -58,11 +58,11 @@ def toc_for_course(user, request, course, active_chapter, active_section):
section.metadata.get('display_name') == active_section)
hide_from_toc = section.metadata.get('hide_from_toc', 'false').lower() == 'true'
sections.append({'name': section.metadata.get('display_name'),
'format': section.metadata.get('format', ''),
'due': section.metadata.get('due', ''),
'active': active,
'hide_from_toc' : hide_from_toc})
if not hide_from_toc:
sections.append({'name': section.metadata.get('display_name'),
'format': section.metadata.get('format', ''),
'due': section.metadata.get('due', ''),
'active': active})
chapters.append({'name': chapter.metadata.get('display_name'),
'sections': sections,
......
......@@ -5,17 +5,15 @@
<ul>
% for section in chapter['sections']:
% if not section['hide_from_toc']:
<li${' class="active"' if 'active' in section and section['active'] else ''}>
<a href="${reverse('courseware_section', args=[course_id] + format_url_params([chapter['name'], section['name']]))}">
<p>${section['name']}
<span class="subtitle">
${section['format']} ${"due " + section['due'] if 'due' in section and section['due'] != '' else ''}
</span>
</p>
</a>
</li>
% endif
<li${' class="active"' if 'active' in section and section['active'] else ''}>
<a href="${reverse('courseware_section', args=[course_id] + format_url_params([chapter['name'], section['name']]))}">
<p>${section['name']}
<span class="subtitle">
${section['format']} ${"due " + section['due'] if 'due' in section and section['due'] != '' else ''}
</span>
</p>
</a>
</li>
% endfor
</ul>
</%def>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment