From daee441153a4037c4071c8c03db1dfbeb934d910 Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Mon, 15 Oct 2012 14:34:30 -0400 Subject: [PATCH 1/4] client-side check for a .tar.gz extension --- cms/static/js/base.js | 16 +++++++++++----- cms/static/sass/_import.scss | 19 ++++++++++++++----- cms/templates/import.html | 8 +++++--- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/cms/static/js/base.js b/cms/static/js/base.js index 787cd2f524..a07ba7702f 100644 --- a/cms/static/js/base.js +++ b/cms/static/js/base.js @@ -80,11 +80,17 @@ $(document).ready(function() { }); function showImportSubmit(e) { - $('.file-name').html($(this).val()) - $('.file-name-block').show(); - $('.import .choose-file-button').hide(); - $('.submit-button').show(); - $('.progress').show(); + var filepath = $(this).val(); + if(filepath.substr(filepath.length - 6, 6) == 'tar.gz') { + $('.error-block').hide(); + $('.file-name').html($(this).val()); + $('.file-name-block').show(); + $('.import .choose-file-button').hide(); + $('.submit-button').show(); + $('.progress').show(); + } else { + $('.error-block').html('File format not supported. Please upload a file with a tar.gz extension.').show(); + } } function syncReleaseDate(e) { diff --git a/cms/static/sass/_import.scss b/cms/static/sass/_import.scss index ac1044788f..54ea335d26 100644 --- a/cms/static/sass/_import.scss +++ b/cms/static/sass/_import.scss @@ -11,11 +11,15 @@ margin-right: 3%; font-size: 14px; - h3 { - margin-bottom: 20px; - font-size: 18px; + h2 { font-weight: 700; - color: $error-red; + font-size: 19px; + margin-bottom: 20px; + } + + strong { + font-weight: 700; + // color: $error-red; } p + p { @@ -39,12 +43,17 @@ font-weight: 300; } - .file-name-block { + .file-name-block, + .error-block { display: none; margin-bottom: 15px; font-size: 13px; } + .error-block { + color: $error-red; + } + .choose-file-button { @include blue-button; padding: 10px 50px 11px; diff --git a/cms/templates/import.html b/cms/templates/import.html index ffce24ed74..135acdeb8d 100644 --- a/cms/templates/import.html +++ b/cms/templates/import.html @@ -11,15 +11,17 @@

Import

-

Importing a new course will delete all course content currently associated with your course - and replace it with the contents of the uploaded file.

+

Please read the documentation before attempting an import!

+

Importing a new course will delete all content currently associated with your course + and replace it with the contents of the uploaded file.

File uploads must be zip files containing, at a minimum, a course.xml file.

Please note that if your course has any problems with auto-generated url_name nodes, re-importing your course could cause the loss of student data associated with those problems.

Course to import:

- Choose File +

+ Choose File

change

From c542ac5bd671ce435a7687eb8d853a8cc8de6c61 Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Mon, 15 Oct 2012 14:35:44 -0400 Subject: [PATCH 2/4] added link to documentation --- cms/templates/import.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/templates/import.html b/cms/templates/import.html index 135acdeb8d..84e136fef9 100644 --- a/cms/templates/import.html +++ b/cms/templates/import.html @@ -11,7 +11,7 @@

Import

-

Please read the documentation before attempting an import!

+

Please read the documentation before attempting an import!

Importing a new course will delete all content currently associated with your course and replace it with the contents of the uploaded file.

File uploads must be zip files containing, at a minimum, a course.xml file.

From c9abddc9a8f7cac4a7bad51bc6609950487c664a Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Mon, 15 Oct 2012 14:37:05 -0400 Subject: [PATCH 3/4] removed css comment --- cms/static/sass/_import.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/cms/static/sass/_import.scss b/cms/static/sass/_import.scss index 54ea335d26..a0a1f5e512 100644 --- a/cms/static/sass/_import.scss +++ b/cms/static/sass/_import.scss @@ -19,7 +19,6 @@ strong { font-weight: 700; - // color: $error-red; } p + p { From f10d1773c7a8ab4dd78c2086fb87e74448c56022 Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Mon, 15 Oct 2012 14:44:53 -0400 Subject: [PATCH 4/4] added open sans pull --- cms/static/sass/base-style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/cms/static/sass/base-style.scss b/cms/static/sass/base-style.scss index 0824cc380d..6a6105c109 100644 --- a/cms/static/sass/base-style.scss +++ b/cms/static/sass/base-style.scss @@ -5,6 +5,7 @@ @import 'reset'; @import 'mixins'; +@import "fonts"; @import "variables"; @import "cms_mixins"; @import "base";