Commit 7938aa91 by Prem Sichanugrist

Use inline if-else to cleanup HTML

The result from the normal if-else block has linebreak, which result in
poorly formatted HTML code. This should fix it and make the code looks
cleaner.
parent 83f4e1ed
......@@ -7,21 +7,12 @@
<ul>
% for section in chapter['sections']:
<li
% if 'active' in section and section['active']:
class="active"
% endif
>
<li${' class="active"' if 'active' in section and section['active'] else ''}>
<a href="${reverse('courseware_section', args=format_url_params([course_name, chapter['name'], section['name']]))}">
<p>${section['name']}</p>
<p class="subtitle">
${section['format']}
% if 'due' in section and section['due']!="":
due ${section['due']}
% endif
${section['format']} ${"due " + section['due'] if 'due' in section and section['due'] != '' else ''}
</p>
</a>
% 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