From a8a01ce94281bd3de9fd7b55c0e2af1de4855737 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Thu, 9 Feb 2012 14:55:40 -0500 Subject: [PATCH 1/3] Cleaning up profile to output better lists --HG-- branch : templates-profilecleanup --- profile.html | 76 ++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/profile.html b/profile.html index 422d21f2b8..a3280e8f01 100644 --- a/profile.html +++ b/profile.html @@ -91,49 +91,43 @@ $(function() {
-
    - <% - lastChapter = None - %> - % for hw in homeworks: +
      + %for chapter in chapters:
    1. - %if hw['chapter'] != lastChapter: -

      - ${ hw['chapter'] }

      - <% lastChapter = hw['chapter'] %> - %else: -

      -

      - %endif - -
      -

      - <% - earned = hw['section_total'][0] - total = hw['section_total'][1] - percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 else "" - %> - ${ hw['section'] } ${"({0}/{1}) {2}".format( earned, total, percentageString )}

      - ${hw['subtitle']} - % if 'due' in hw and hw['due']!="": - due ${hw['due']} - % endif - -
        - %if len(hw['scores']) > 0: - %if hw['graded']: - Problem Scores: - %else: - Practice Scores: - %endif - % for score in hw['scores']: -
      • ${ score[0] }/${ score[1] }
      • - % endfor +

        + ${ chapter['chapter'] }

        + +
          + %for section in chapter['sections']: +
        1. + <% + earned = section['section_total'][0] + total = section['section_total'][1] + percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 else "" + %> + +

          + ${ section['section'] } ${"({0}/{1}) {2}".format( earned, total, percentageString )}

          + ${section['subtitle']} + %if 'due' in section and section['due']!="": + due ${section['due']} %endif -
      -
      -
    2. - % endfor -
    + + %if len(section['scores']) > 0: +
      + ${ "Problem Scores: " if section['graded'] else "Practice Scores: "} + %for score in section['scores']: +
    1. ${ score[0] }/${ score[1] }
    2. + %endfor +
    + %endif + + + %endfor +
+ + %endfor +
From 56e1111a4a83f9345b3fab02076d0acc27965af4 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Mon, 13 Feb 2012 14:35:18 -0500 Subject: [PATCH 2/3] Added style for the layout --HG-- branch : templates-profilecleanup --- sass/_profile.scss | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sass/_profile.scss b/sass/_profile.scss index b383c61a85..ad99c2f621 100644 --- a/sass/_profile.scss +++ b/sass/_profile.scss @@ -52,7 +52,7 @@ div.profile-wrapper { section.course-info { @extend .content; - ol { + > ol { list-style: none; > li { @@ -68,15 +68,28 @@ div.profile-wrapper { margin-right: flex-gutter(9); } - div.scores { + ol.sections { float: left; + list-style: none; width: flex-grid(7, 9); + > li { + border-bottom: 1px solid #e3e3e3; + padding: lh() 0; + + &:first-child { + padding-top: 0; + } + + &:last-child { + border-bottom: 0; + } + h3 { color: #666; } - ul { + ol { list-style: none; li { @@ -84,6 +97,7 @@ div.profile-wrapper { padding-right: 1em; } } + } } } } From a21f01f468e61b20b45822d6d1b625734a81b4fa Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Wed, 15 Feb 2012 09:51:18 -0500 Subject: [PATCH 3/3] Added more style for the progress list --HG-- branch : templates-profilecleanup --- sass/_profile.scss | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sass/_profile.scss b/sass/_profile.scss index ceff56ccfc..8a08759294 100644 --- a/sass/_profile.scss +++ b/sass/_profile.scss @@ -59,28 +59,34 @@ div.profile-wrapper { > ol { list-style: none; + border-top: 1px solid #e3e3e3; + margin-top: lh(); > li { border-bottom: 1px solid #e3e3e3; padding: lh() 0; + width: 100%; + display: table; @extend .clearfix; h2 { - float: left; + display: table-cell; padding: 0; margin: 0; 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); } ol.sections { - float: left; + padding-left: flex-gutter(9); + display: table-cell; list-style: none; width: flex-grid(7, 9); > li { - border-bottom: 1px solid #e3e3e3; - padding: lh() 0; + padding:0 0 lh() 0; &:first-child { padding-top: 0;