From 574c8ad48d82cfb503b7150241a290a51a93ef61 Mon Sep 17 00:00:00 2001 From: Frances Botsford Date: Wed, 5 Jun 2013 16:57:03 -0400 Subject: [PATCH] more form styling for textbook upload and first rough pass at file uploader --- cms/static/sass/views/_textbooks.scss | 544 ++++++++++++++-------- cms/templates/js/chapter.underscore | 2 +- cms/templates/js/textbook.underscore | 16 +- cms/templates/js/upload-dialog.underscore | 25 +- cms/templates/textbooks.html | 11 +- 5 files changed, 388 insertions(+), 210 deletions(-) diff --git a/cms/static/sass/views/_textbooks.scss b/cms/static/sass/views/_textbooks.scss index 30f907753b..a56c2c131f 100644 --- a/cms/static/sass/views/_textbooks.scss +++ b/cms/static/sass/views/_textbooks.scss @@ -10,235 +10,401 @@ body.course.textbooks { text-align: center; } - form { - @include box-sizing(border-box); - @include box-shadow(0 1px 2px $shadow-l1); - @include border-radius(2px); - width: 100%; - border: 1px solid $gray-l2; + form { + @include box-sizing(border-box); + @include box-shadow(0 1px 2px $shadow-l1); + @include border-radius(2px); + width: 100%; + border: 1px solid $gray-l2; +// padding: $baseline ($baseline*1.5); + background: $white; + + fieldset { + padding: 0 ($baseline*1.5); + } + + fieldset.textbook { + border-bottom: 2px solid $gray-l3; + background-color: $gray-l5; padding: $baseline ($baseline*1.5); - background: $white; + } - .actions { - margin-top: $baseline; + .actions { + margin-top: $baseline; + padding: 0 ($baseline*1.5) $baseline ($baseline*1.5); - .action-add-chapter { - @extend .t-action2; - //@include grey-button; - @include transition(all .15s); - display: block; - width: 100%; - margin-bottom: ($baseline*1.5); - border-radius: 5px; - border: none; - padding: $baseline; - background-color: #DFE5EF; - color: #8EABBE; - font-weight: 600; - - &:hover { - background: #5597DD; - color: #fff; - } - } - - .action-primary { - @include blue-button; + .action-add-chapter { @extend .t-action2; + //@include grey-button; @include transition(all .15s); - display: inline-block; - padding: ($baseline/5) $baseline; + display: block; + width: 100%; + margin-bottom: ($baseline*1.5); + border-radius: 5px; + border: none; + padding: $baseline; + background-color: #DFE5EF; + color: #8EABBE; font-weight: 600; - text-transform: uppercase; - } - - .action-secondary { - @include grey-button; - @extend .t-action2; - @include transition(all .15s); - display: inline-block; - padding: ($baseline/5) $baseline; - font-weight: 600; - text-transform: uppercase; - } - + &:hover { + background: #5597DD; + color: #fff; + } } - .copy { - @include font-size(12); - margin: ($baseline) 0 ($baseline/2) 0; - color: $gray; - - - strong { - font-weight: 600; - } - - + .action-primary { + @include blue-button; + @extend .t-action2; + @include transition(all .15s); + display: inline-block; + padding: ($baseline/5) $baseline; + font-weight: 600; + text-transform: uppercase; } - .list-input { - margin: 0; - padding: 0; - list-style: none; + .action-secondary { + @include grey-button; + @extend .t-action2; + @include transition(all .15s); + display: inline-block; + padding: ($baseline/5) $baseline; + font-weight: 600; + text-transform: uppercase; + } - .field { - margin: 0 0 ($baseline*0.75) 0; - &:last-child { - margin-bottom: 0; - } + } - &.required { + .copy { + @include font-size(12); + margin: ($baseline) 0 ($baseline/2) 0; + color: $gray; - label { - font-weight: 600; - } - label:after { - margin-left: ($baseline/4); - content: "*"; - } - } + strong { + font-weight: 600; + } - label, input, textarea { - display: block; - } + + } + + .list-input { + margin: 0; + padding: 0; + list-style: none; + + .field { + margin: 0 0 ($baseline*0.75) 0; + + &:last-child { + margin-bottom: 0; + } + + &.required { label { - @extend .t-copy-sub1; - @include transition(color, 0.15s, ease-in-out); - margin: 0 0 ($baseline/4) 0; - - &.is-focused { - color: $blue; - } + font-weight: 600; } - input, textarea { - @extend .t-copy-base; - height: 100%; - width: 100%; - padding: ($baseline/2); - - &.long { - width: 100%; - } - - &.short { - width: 25%; - } - - ::-webkit-input-placeholder { - color: $gray-l4; - } - - :-moz-placeholder { - color: $gray-l3; - } - - ::-moz-placeholder { - color: $gray-l3; - } - - :-ms-input-placeholder { - color: $gray-l3; - } - - &:focus { - - + .tip { - color: $gray; - } - } - } - - textarea.long { - height: ($baseline*5); - } - - input[type="checkbox"] { - display: inline-block; - margin-right: ($baseline/4); - width: auto; - height: auto; - - & + label { - display: inline-block; - } - } - - .tip { - @extend .t-copy-sub2; - @include transition(color, 0.15s, ease-in-out); - display: block; - margin-top: ($baseline/4); - color: $gray-l3; + label:after { + margin-left: ($baseline/4); + content: "*"; } } - .field-group { - @include clearfix(); - margin: 0 0 ($baseline/2) 0; + label, input, textarea { + display: block; + } - .field { - display: block; - width: 46.5%; - border-bottom: none; - margin: 0 $baseline 0 0; - padding: ($baseline/4) 0 0 0; - float: left; - position: relative; + label { + @extend .t-copy-sub1; + @include transition(color, 0.15s, ease-in-out); + margin: 0 0 ($baseline/4) 0; - input, textarea { - width: 100%; - } + &.is-focused { + color: $blue; + } + } - .action-uploadasset { - @extend .t-action4; - @include blue-button; - @include transition(all .15s); - @include font-size(12); - font-weight: 600; - text-align: center; - position: absolute; - top: 2px; - right: 0; - padding: 3px ($baseline/2) 1px ($baseline/2); - } + &.add-textbook-name label { + @extend .t-title5; + } + + input, textarea { + @extend .t-copy-base; + height: 100%; + width: 100%; + padding: ($baseline/2); + + &.long { + width: 100%; } - .action-close { - @include white-button; - @include font-size(18); - margin-top: ($baseline*2); - border: 0; - padding: 0; - background: transparent; - - &:hover { - color: $blue; - background: transparent; - box-shadow: none; - } + &.short { + width: 25%; } + ::-webkit-input-placeholder { + color: $gray-l4; + } + + :-moz-placeholder { + color: $gray-l3; + } + + ::-moz-placeholder { + color: $gray-l3; + } + + :-ms-input-placeholder { + color: $gray-l3; + } + + &:focus { + + + .tip { + color: $gray; + } + } + } + + textarea.long { + height: ($baseline*5); + } + + input[type="checkbox"] { + display: inline-block; + margin-right: ($baseline/4); + width: auto; + height: auto; + + & + label { + display: inline-block; + } + } + + .tip { + @extend .t-copy-sub2; + @include transition(color, 0.15s, ease-in-out); + display: block; + margin-top: ($baseline/4); + color: $gray-l3; } } - } - .wrapper-prompt-assetupload .prompt { - width: $baseline*20; + .field-group { + @include clearfix(); + margin: 0 0 ($baseline/2) 0; + + .field { + display: block; + width: 46.5%; + border-bottom: none; + margin: 0 $baseline 0 0; + padding: ($baseline/4) 0 0 0; + float: left; + position: relative; + + input, textarea { + width: 100%; + } + + .action-upload { + @extend .t-action4; + @include blue-button; + @include transition(all .15s); + @include font-size(12); + font-weight: 600; + text-align: center; + position: absolute; + top: 2px; + right: 0; +/* height: 40px; + top: 33px; + right: 2px; */ + padding: 3px ($baseline/2) 1px ($baseline/2); + } - h2 { - color: $gray; - font-weight: bold; } + .action-close { + @include white-button; + @include font-size(18); + margin-top: ($baseline*2); + border: 0; + padding: 0; + background: transparent; + + &:hover { + color: $blue; + background: transparent; + box-shadow: none; + } + } + + } + } + } + + + + // dialog +.wrapper-dialog { + @extend .depth5; + @include transition(all 0.05s ease-in-out); + position: fixed; + top: 0; + background: $black-t0; + width: 100%; + height: 100%; + text-align: center; + + &:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; + margin-right: -0.25em; /* Adjusts for spacing */ + } + + .dialog { + @include box-sizing(border-box); + @include border-radius(($baseline/5)); + background-color: $gray-l6; + display: inline-block; + vertical-align: middle; + width: $baseline*20; + text-align: left; + + .title { + @include font-size(18); + font-weight: bold; + color: $black; + } + + .copy { + @extend .t-copy-sub2; + color: $gray-l1; + } + + form { + padding: 0; + background-color: transparent; + + .form-content { + padding: ($baseline*1.5) ($baseline*1.5) 0 ($baseline*1.5); + } + + .wrapper-progress { + @include box-shadow(inset 0 0 4px $shadow-d1); + margin-top: $baseline; + border-radius: ($baseline*.75); + background-color: $white; + padding: 3px 8px; + height: 25px; + + progress { + width: 100%; + border: none; + border-radius: ($baseline*.75); + background-color: #eee; + + &::-webkit-progress-bar { + background-color: transparent; + border-radius: ($baseline*.75); + } + + &::-webkit-progress-value { + background-color: $green-s1; + border-radius: ($baseline*.75); + } + + &::-moz-progress-bar { + background-color: $green-s1; + border-radius: ($baseline*.75); + } + + } + + } + + .actions { + @include box-shadow(inset 0 1px 2px $shadow); + border-top: 1px solid $gray-l1; + padding: ($baseline*0.75) $baseline; + background: $white; + + .action-item { + @extend .t-action4; + display: inline-block; + margin-right: ($baseline*0.75); + + &:last-child { + margin-right: 0; + } + } + + .action-upload { + font-weight: 600; + color: $white; + } + + .action-cancel { + @extend .t-action4; + border: 0; + background: none; + color: $blue; + + &:hover { + color: $blue-s3; + } + } + + } } + } + +} + +// ==================== + +// js enabled +.js { + + // dialog set-up + .wrapper-dialog { + visibility: hidden; + pointer-events: none; + + .dialog { + opacity: 0; + } + } + + // dialog showing/hiding + &.dialog-is-shown { + + .wrapper-view { + -webkit-filter: blur(2px) grayscale(25%); + filter: blur(2px) grayscale(25%); + } + + .wrapper-dialog.is-shown { + visibility: visible; + pointer-events: auto; + + .dialog { + opacity: 1.0; + } + } + } + +} + + } diff --git a/cms/templates/js/chapter.underscore b/cms/templates/js/chapter.underscore index 2f63c1c072..3562e790ff 100644 --- a/cms/templates/js/chapter.underscore +++ b/cms/templates/js/chapter.underscore @@ -8,7 +8,7 @@ " value="<%= asset_path %>" type="text"> <%= gettext("provide the path to a file added to this course or upload a new one") %> - + <%= gettext("delete chapter") %> diff --git a/cms/templates/js/textbook.underscore b/cms/templates/js/textbook.underscore index 02b37a0121..06459e58ff 100644 --- a/cms/templates/js/textbook.underscore +++ b/cms/templates/js/textbook.underscore @@ -1,21 +1,27 @@
-
- <%= gettext("Required information to edit or add a textbook and chapters") %> +
  1. +
    + <%= gettext("Textbook information") %>
    - + " value="<%= name %>"> <%= gettext("the title/name of the text book as you would like your students to see it.") %>
    +
  2. +
    + <%= gettext("Chapter(s) information") %> +
      + +
    -

    <%= gettext("Note: It's best practice to break your course's textbook into multiple chapters to reduce loading times for students. Breaking up textbooks into chapters can also help with students more easily finding a concept or topic-based information.") %>

    -
    +
    diff --git a/cms/templates/js/upload-dialog.underscore b/cms/templates/js/upload-dialog.underscore index 5994cabcb8..20a4b5a13c 100644 --- a/cms/templates/js/upload-dialog.underscore +++ b/cms/templates/js/upload-dialog.underscore @@ -1,16 +1,17 @@ -