From 5f7d25587f0a94c6907a6932397148e63b98d1fe Mon Sep 17 00:00:00 2001 From: Ernie Park Date: Wed, 1 Feb 2012 14:05:12 -0500 Subject: [PATCH 01/18] open close sidebar implement js adding removing closed class on accordion --HG-- branch : close_sidebar --- accordion_init.js | 13 +++++++++++-- courseware.html | 3 +++ sass/_courseware.scss | 10 +--------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/accordion_init.js b/accordion_init.js index 138ac15608..bf31e0b21f 100644 --- a/accordion_init.js +++ b/accordion_init.js @@ -1,10 +1,19 @@ $("#accordion").accordion({ active: ${ active_chapter }, - autoHeight: false + header: 'h3', + autoHeight: false, +}); + +$("#open_close_accordion").click(function(){ + if ($("#accordion").hasClass("closed")){ + $("#accordion").removeClass("closed"); + } else { + $("#accordion").addClass("closed"); + } }); $('.ui-accordion').bind('accordionchange', function(event, ui) { var event_data = {'newheader':ui.newHeader.text(), - 'oldheader':ui.oldHeader.text()}; + 'oldheader':ui.oldHeader.text()}; log_event('accordion', event_data); }); diff --git a/courseware.html b/courseware.html index 99444c5077..bce8589d6c 100644 --- a/courseware.html +++ b/courseware.html @@ -28,6 +28,9 @@
+
+ Courseware +
${accordion}
diff --git a/sass/_courseware.scss b/sass/_courseware.scss index 3c59e6e0c8..b4ea8e3cbf 100644 --- a/sass/_courseware.scss +++ b/sass/_courseware.scss @@ -9,16 +9,8 @@ div.course-wrapper { @extend .sidebar; div#open_close_accordion { - position: absolute; - right: 0px; - width: 20px; - height: 20px; - background: #ccc; - border: 1px solid black; - right: -22px; - top: 5px; } - + h3 { overflow: hidden; margin: 0; From ff129a01f2abdc59af98559a3892f45c58a8830e Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Tue, 7 Feb 2012 15:43:10 -0500 Subject: [PATCH 02/18] Added start to some styles --HG-- branch : close_sidebar --- accordion_init.js | 6 +++--- courseware.html | 3 ++- sass/_courseware.scss | 46 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/accordion_init.js b/accordion_init.js index bf31e0b21f..1afaa058ac 100644 --- a/accordion_init.js +++ b/accordion_init.js @@ -5,10 +5,10 @@ $("#accordion").accordion({ }); $("#open_close_accordion").click(function(){ - if ($("#accordion").hasClass("closed")){ - $("#accordion").removeClass("closed"); + if ($(".course-wrapper").hasClass("closed")){ + $(".course-wrapper").removeClass("closed"); } else { - $("#accordion").addClass("closed"); + $(".course-wrapper").addClass("closed"); } }); diff --git a/courseware.html b/courseware.html index 0867ea9eb6..9458306e3b 100644 --- a/courseware.html +++ b/courseware.html @@ -29,7 +29,8 @@
- Courseware +

Courseware Index

+ close
${accordion}
diff --git a/sass/_courseware.scss b/sass/_courseware.scss index 85fe533df2..9e76474d8c 100644 --- a/sass/_courseware.scss +++ b/sass/_courseware.scss @@ -7,11 +7,24 @@ div.course-wrapper { div#accordion { @extend .sidebar; + @include transition( all, .5s, $ease-in-out-quad); div#open_close_accordion { + h2 { + display: inline-block; + } + + a { + text-indent: -9999px; + display: inline-block; + background: red; + width: 16px; + height: 16px; + } } h3 { + @include transition( all, .5s, $ease-in-out-quad); overflow: hidden; margin: 0; @@ -77,6 +90,7 @@ div.course-wrapper { section.course-content { @extend .content; + @include transition( all, .5s, $ease-in-out-quad); p { margin-bottom: lh(); @@ -203,4 +217,36 @@ div.course-wrapper { } } } + + &.closed { + + div#accordion { + width: flex-grid(.5); + + div#open_close_accordion { + h2 { + position: relative; + left: -100%; + } + } + + h3, ul, li { + position: relative; + left: -100%; + } + } + + section.course-content { + width: flex-grid(11.5) + flex-gutter(); + } + + // div#accordion { + // left: -(flex-grid(2.7)); + // } + + // section.course-content { + // left: -(flex-grid(2.7)); + // position: relative; + // } + } } From a89de961e82eb0fd6922901c7ebfb3e183ddf4a2 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Wed, 8 Feb 2012 11:05:08 -0500 Subject: [PATCH 03/18] Added more styles for cloes and open sidebar --HG-- branch : close_sidebar --- courseware.html | 9 ++- sass/_courseware.scss | 146 +++++++++++++++++++++--------------------- 2 files changed, 80 insertions(+), 75 deletions(-) diff --git a/courseware.html b/courseware.html index 9458306e3b..b77806f3e1 100644 --- a/courseware.html +++ b/courseware.html @@ -27,13 +27,16 @@
-
+

Courseware Index

close
- ${accordion} -
+ +
+ ${accordion} +
+
${content} diff --git a/sass/_courseware.scss b/sass/_courseware.scss index 9e76474d8c..2323206590 100644 --- a/sass/_courseware.scss +++ b/sass/_courseware.scss @@ -5,92 +5,102 @@ div.course-wrapper { list-style: none; } - div#accordion { + .tran { + @include transition( all, .2s, $ease-in-out-quad); + } + + section.course-index { @extend .sidebar; - @include transition( all, .5s, $ease-in-out-quad); + position: relative; + @extend .tran; div#open_close_accordion { h2 { - display: inline-block; + padding: 0 lh(); } a { text-indent: -9999px; - display: inline-block; background: red; width: 16px; height: 16px; + position: absolute; + padding: 8px; + top: 12px; + right: 0; } } - h3 { - @include transition( all, .5s, $ease-in-out-quad); - overflow: hidden; - margin: 0; + div#accordion { - &:last-child { - @include box-shadow(none); - } + h3 { + overflow: hidden; + margin: 0; - &.ui-accordion-header { - color: #000; - - a { - font-size: $body-font-size; - color: lighten($text-color, 10%); + &:last-child { + @include box-shadow(none); } - &.ui-state-hover { - border: none; - border-bottom: 1px solid #d3d3d3; - } - - &.ui-state-active { - @extend .active; - } - } - } - - ul.ui-accordion-content { - @include border-radius(0); - @include box-shadow( inset -1px 0 0 #e6e6e6); - background: #d6d6d6; - border: none; - border-bottom: 1px solid #c3c3c3; - font-size: 12px; - margin: 0; - overflow: hidden; - - li { - &.active { - font-weight: bold; - } - - a { - text-decoration: none; - margin-bottom: lh(.5); - display: block; + &.ui-accordion-header { color: #000; - &:hover { - color: #666; + a { + font-size: $body-font-size; + color: lighten($text-color, 10%); } - p { - margin-bottom: 0; + &.ui-state-hover { + border: none; + border-bottom: 1px solid #d3d3d3; + } - &.subtitle { + &.ui-state-active { + @extend .active; + } + } + } + + ul.ui-accordion-content { + @include border-radius(0); + @include box-shadow( inset -1px 0 0 #e6e6e6); + background: #d6d6d6; + border: none; + border-bottom: 1px solid #c3c3c3; + font-size: 12px; + margin: 0; + overflow: hidden; + + li { + &.active { + font-weight: bold; + } + + a { + text-decoration: none; + margin-bottom: lh(.5); + display: block; + color: #000; + + &:hover { color: #666; } + + p { + margin-bottom: 0; + + &.subtitle { + color: #666; + } + } } } } } } + section.course-content { @extend .content; - @include transition( all, .5s, $ease-in-out-quad); p { margin-bottom: lh(); @@ -219,34 +229,26 @@ div.course-wrapper { } &.closed { - - div#accordion { + section.course-index { width: flex-grid(.5); + div#open_close_accordion { - div#open_close_accordion { - h2 { - position: relative; - left: -100%; - } + h2 { + visibility: hidden; + width: 10px; + padding: 0; } + } - h3, ul, li { - position: relative; - left: -100%; + div#accordion { + visibility: hidden; + width: 10px; + padding: 0; } } section.course-content { width: flex-grid(11.5) + flex-gutter(); } - - // div#accordion { - // left: -(flex-grid(2.7)); - // } - - // section.course-content { - // left: -(flex-grid(2.7)); - // position: relative; - // } } } From 5cf7d9ab8ccc32b613341bb870c7d4de23797862 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Wed, 8 Feb 2012 16:32:48 -0500 Subject: [PATCH 04/18] Added more styles for the slider --HG-- branch : close_sidebar --- sass/_courseware.scss | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sass/_courseware.scss b/sass/_courseware.scss index 2323206590..559333255e 100644 --- a/sass/_courseware.scss +++ b/sass/_courseware.scss @@ -20,14 +20,21 @@ div.course-wrapper { } a { - text-indent: -9999px; - background: red; width: 16px; + text-indent: -9999px; height: 16px; position: absolute; padding: 8px; top: 12px; - right: 0; + right: -1px; + border: 1px solid #D3D3D3; + background: #eee url('/static/images/slide-left-icon.png') center center no-repeat; + @include box-shadow(0 0 0 1px #fff); + @include border-radius(3px 0 0 3px); + + &:hover { + background-color: white; + } } } @@ -230,8 +237,13 @@ div.course-wrapper { &.closed { section.course-index { - width: flex-grid(.5); + width: flex-grid(.6); + padding-left: 4px; + div#open_close_accordion { + a { + background-image: url('/static/images/slide-right-icon.png'); + } h2 { visibility: hidden; From a8a01ce94281bd3de9fd7b55c0e2af1de4855737 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Thu, 9 Feb 2012 14:55:40 -0500 Subject: [PATCH 05/18] 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 +