Commit 736b4be3 by Bridger Maxwell

Hiding hidden chapter on profile page

parents 940fe752 a21f01f4
...@@ -91,49 +91,45 @@ $(function() { ...@@ -91,49 +91,45 @@ $(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 %if not chapter['chapter'] == "hidden":
%>
% 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-->
%endif
%endfor
</ol> <!--End chapters-->
</section> </section>
<section class="user-info"> <section class="user-info">
......
...@@ -57,31 +57,50 @@ div.profile-wrapper { ...@@ -57,31 +57,50 @@ div.profile-wrapper {
@extend .top-header; @extend .top-header;
} }
ol { > ol {
list-style: none; list-style: none;
border-top: 1px solid #e3e3e3;
margin-top: lh();
> li { > li {
border-bottom: 1px solid #e3e3e3; border-bottom: 1px solid #e3e3e3;
padding: lh() 0; padding: lh() 0;
width: 100%;
display: table;
@extend .clearfix; @extend .clearfix;
h2 { h2 {
float: left; display: table-cell;
padding: 0; padding: 0;
margin: 0; margin: 0;
width: flex-grid(2, 9); width: flex-grid(2, 9);
margin-right: flex-gutter(9); padding-right: flex-gutter(9);
border-right: 1px dotted #ccc;
@include box-sizing(border-box);
} }
div.scores { ol.sections {
float: left; padding-left: flex-gutter(9);
display: table-cell;
list-style: none;
width: flex-grid(7, 9); width: flex-grid(7, 9);
> li {
padding:0 0 lh() 0;
&:first-child {
padding-top: 0;
}
&:last-child {
border-bottom: 0;
}
h3 { h3 {
color: #666; color: #666;
} }
ul { ol {
list-style: none; list-style: none;
li { li {
...@@ -89,6 +108,7 @@ div.profile-wrapper { ...@@ -89,6 +108,7 @@ div.profile-wrapper {
padding-right: 1em; padding-right: 1em;
} }
} }
}
} }
} }
} }
......
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