Files
edx-platform/cms/templates/export.html
cahrens 763ff9c818 Make export URL restful.
STUD-846
2013-10-30 15:24:42 -04:00

122 lines
4.1 KiB
HTML

<%inherit file="base.html" />
<%namespace name='static' file='static_content.html'/>
<%!
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
import json
%>
<%block name="title">${_("Course Export")}</%block>
<%block name="bodyclass">is-signedin course tools view-export</%block>
<%block name="jsextra">
% if in_err:
<script type='text/javascript'>
var hasUnit = ${json.dumps(bool(unit))},
editUnitUrl = "${edit_unit_url or ""}",
courseHomeUrl = "${course_home_url or ""}",
errMsg = "${raw_err_msg or ""}";
require(["domReady!", "gettext", "js/views/feedback_prompt"], function(doc, gettext, PromptView) {
var dialog;
if(hasUnit) {
dialog = new PromptView({
title: gettext('There has been an error while exporting.'),
message: gettext("There has been a failure to export to XML at least one component. It is recommended that you go to the edit page and repair the error before attempting another export. Please check that all components on the page are valid and do not display any error messages."),
intent: "error",
actions: {
primary: {
text: gettext('Correct failed component'),
click: function(view) {
view.hide();
document.location = editUnitUrl;
}
},
secondary: {
text: gettext('Return to Export'),
click: function(view) {
view.hide();
}
}
}
});
} else {
var msg = "<p>" + gettext("There has been a failure to export your course to XML. Unfortunately, we do not have specific enough information to assist you in identifying the failed component. It is recommended that you inspect your courseware to identify any components in error and try again.") + "</p><p>" + gettext("The raw error message is:") + "</p>" + errMsg;
dialog = new PromptView({
title: gettext('There has been an error with your export.'),
message: msg,
intent: "error",
actions: {
primary: {
text: gettext('Yes, take me to the main course page'),
click: function(view) {
view.hide();
document.location = courseHomeUrl;
}
},
secondary: {
text: gettext('Cancel'),
click: function(view) {
view.hide();
}
}
}
});
}
// The CSS animation for the dialog relies on the 'js' class
// being on the body. This happens after this JavaScript is executed,
// causing a "bouncing" of the dialog after it is initially shown.
// As a workaround, add this class first.
$('body').addClass('js');
dialog.show();
});
</script>
%endif
</%block>
<%block name="content">
<div class="wrapper-mast wrapper">
<header class="mast has-subtitle">
<h1 class="page-header">
<small class="subtitle">${_("Tools")}</small>
<span class="sr">&gt; </span>${_("Course Export")}
</h1>
</header>
</div>
<div class="main-wrapper">
<div class="inner-wrapper">
<article class="export-overview">
<div class="description">
<h2>${_("About Exporting Courses")}</h2>
## Translators: ".tar.gz" is a file extension, and should not be translated
<p>${_("When exporting your course, you will receive a .tar.gz formatted file that contains the following course data:")}</p>
<ul>
<li>${_("Course Structure (Sections and sub-section ordering)")}</li>
<li>${_("Individual Units")}</li>
<li>${_("Individual Problems")}</li>
<li>${_("Static Pages")}</li>
<li>${_("Course Assets")}</li>
</ul>
<p>${_("Your course export <strong>will not include</strong>: student data, forum/discussion data, course settings, certificates, grading information, or user data.")}</p>
</div>
<!-- default state -->
<div class="export-form-wrapper">
<form method="post" enctype="multipart/form-data" class="export-form">
<h2>${_("Export Course:")}</h2>
<a href="${export_url}" class="button-export">${_("Download Files")}</a>
</form>
</div>
</article>
</div>
</div>
</%block>