Commit a8a01ce9 by Bridger Maxwell

Cleaning up profile to output better lists

--HG--
branch : templates-profilecleanup
parent 8b6188b9
...@@ -91,49 +91,43 @@ $(function() { ...@@ -91,49 +91,43 @@ $(function() {
<div id="grade-detail-graph" style="width:650px;height:200px;"></div> <div id="grade-detail-graph" style="width:650px;height:200px;"></div>
<ol> <ol class="chapters">
<% %for chapter in chapters:
lastChapter = None
%>
% for hw in homeworks:
<li> <li>
%if hw['chapter'] != lastChapter: <h2><a href="${reverse('courseware_chapter', args=format_url_params([chapter['course'], chapter['chapter']])) }">
<h2><a href="${reverse('courseware_chapter', args=format_url_params([hw['course'], hw['chapter']])) }"> ${ chapter['chapter'] }</a></h2>
${ hw['chapter'] }</a></h2>
<% lastChapter = hw['chapter'] %> <ol class="sections">
%else: %for section in chapter['sections']:
<h2>-</h2> <li>
%endif <%
earned = section['section_total'][0]
<div class="scores"> total = section['section_total'][1]
<h3><a href="${reverse('courseware_section', args=format_url_params([hw['course'], hw['chapter'], hw['section']])) }"> percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 else ""
<% %>
earned = hw['section_total'][0]
total = hw['section_total'][1] <h3><a href="${reverse('courseware_section', args=format_url_params([chapter['course'], chapter['chapter'], section['section']])) }">
percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 else "" ${ section['section'] }</a> ${"({0}/{1}) {2}".format( earned, total, percentageString )}</h3>
%> ${section['subtitle']}
${ hw['section'] }</a> ${"({0}/{1}) {2}".format( earned, total, percentageString )}</h3> %if 'due' in section and section['due']!="":
${hw['subtitle']} due ${section['due']}
% if 'due' in hw and hw['due']!="":
due ${hw['due']}
% endif
<ul>
%if len(hw['scores']) > 0:
%if hw['graded']:
Problem Scores:
%else:
Practice Scores:
%endif
% for score in hw['scores']:
<li>${ score[0] }/${ score[1] }</li>
% endfor
%endif %endif
</ul>
</div> %if len(section['scores']) > 0:
</li> <ol class="scores">
% endfor ${ "Problem Scores: " if section['graded'] else "Practice Scores: "}
</ol> %for score in section['scores']:
<li class="score">${ score[0] }/${ score[1] }</li>
%endfor
</ol>
%endif
</li> <!--End section-->
%endfor
</ol> <!--End sections-->
</li> <!--End chapter-->
%endfor
</ol> <!--End chapters-->
</section> </section>
<section class="user-info"> <section class="user-info">
......
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