Commit a96adea4 by pmitros

Merge pull request #24 from MITx/ps-fix-accordian

Use inline if-else to cleanup HTML
parents 5a0f31f8 7938aa91
...@@ -7,21 +7,12 @@ ...@@ -7,21 +7,12 @@
<ul> <ul>
% for section in chapter['sections']: % for section in chapter['sections']:
<li <li${' class="active"' if 'active' in section and section['active'] else ''}>
% if 'active' in section and section['active']:
class="active"
% endif
>
<a href="${reverse('courseware_section', args=format_url_params([course_name, chapter['name'], section['name']]))}"> <a href="${reverse('courseware_section', args=format_url_params([course_name, chapter['name'], section['name']]))}">
<p>${section['name']}</p> <p>${section['name']}</p>
<p class="subtitle"> <p class="subtitle">
${section['format']} ${section['format']} ${"due " + section['due'] if 'due' in section and section['due'] != '' else ''}
% if 'due' in section and section['due']!="":
due ${section['due']}
% endif
</p> </p>
</a> </a>
% endfor % endfor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment