Commit 146ad77c by chrisndodge

Merge pull request #919 from MITx/feature/tomg/cas-import-text

tweaked import text; added check for .tar.gz
parents 158c000a f10d1773
...@@ -80,11 +80,17 @@ $(document).ready(function() { ...@@ -80,11 +80,17 @@ $(document).ready(function() {
}); });
function showImportSubmit(e) { function showImportSubmit(e) {
$('.file-name').html($(this).val()) 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(); $('.file-name-block').show();
$('.import .choose-file-button').hide(); $('.import .choose-file-button').hide();
$('.submit-button').show(); $('.submit-button').show();
$('.progress').show(); $('.progress').show();
} else {
$('.error-block').html('File format not supported. Please upload a file with a <code>tar.gz</code> extension.').show();
}
} }
function syncReleaseDate(e) { function syncReleaseDate(e) {
......
...@@ -11,11 +11,14 @@ ...@@ -11,11 +11,14 @@
margin-right: 3%; margin-right: 3%;
font-size: 14px; font-size: 14px;
h3 { h2 {
font-weight: 700;
font-size: 19px;
margin-bottom: 20px; margin-bottom: 20px;
font-size: 18px; }
strong {
font-weight: 700; font-weight: 700;
color: $error-red;
} }
p + p { p + p {
...@@ -39,12 +42,17 @@ ...@@ -39,12 +42,17 @@
font-weight: 300; font-weight: 300;
} }
.file-name-block { .file-name-block,
.error-block {
display: none; display: none;
margin-bottom: 15px; margin-bottom: 15px;
font-size: 13px; font-size: 13px;
} }
.error-block {
color: $error-red;
}
.choose-file-button { .choose-file-button {
@include blue-button; @include blue-button;
padding: 10px 50px 11px; padding: 10px 50px 11px;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
@import 'reset'; @import 'reset';
@import 'mixins'; @import 'mixins';
@import "fonts";
@import "variables"; @import "variables";
@import "cms_mixins"; @import "cms_mixins";
@import "base"; @import "base";
......
...@@ -11,14 +11,16 @@ ...@@ -11,14 +11,16 @@
<h1>Import</h1> <h1>Import</h1>
<article class="import-overview"> <article class="import-overview">
<div class="description"> <div class="description">
<h3>Importing a new course will delete all course content currently associated with your course <h2>Please <a href="https://edge.edx.org/courses/edX/edx101/edX_Studio_Reference/about" target="_blank">read the documentation</a> before attempting an import!</h2>
and replace it with the contents of the uploaded file.</h3> <p><strong>Importing a new course will delete all content currently associated with your course
and replace it with the contents of the uploaded file.</strong></p>
<p>File uploads must be zip files containing, at a minimum, a <code>course.xml</code> file.</p> <p>File uploads must be zip files containing, at a minimum, a <code>course.xml</code> file.</p>
<p>Please note that if your course has any problems with auto-generated <code>url_name</code> nodes, <p>Please note that if your course has any problems with auto-generated <code>url_name</code> nodes,
re-importing your course could cause the loss of student data associated with those problems.</p> re-importing your course could cause the loss of student data associated with those problems.</p>
</div> </div>
<form action="${reverse('import_course', kwargs=dict(org=context_course.location.org, course=context_course.location.course, name=context_course.location.name))}" method="post" enctype="multipart/form-data" class="import-form"> <form action="${reverse('import_course', kwargs=dict(org=context_course.location.org, course=context_course.location.course, name=context_course.location.name))}" method="post" enctype="multipart/form-data" class="import-form">
<h2>Course to import:</h2> <h2>Course to import:</h2>
<p class="error-block"></p>
<a href="#" class="choose-file-button">Choose File</a> <a href="#" class="choose-file-button">Choose File</a>
<p class="file-name-block"><span class="file-name"></span><a href="#" class="choose-file-button-inline">change</a></p> <p class="file-name-block"><span class="file-name"></span><a href="#" class="choose-file-button-inline">change</a></p>
<input type="file" name="course-data" class="file-input"> <input type="file" name="course-data" class="file-input">
......
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