import.html 11.7 KB
Newer Older
1
<%page expression_filter="h"/>
2
<%inherit file="base.html" />
3 4 5 6 7 8 9 10
<%def name="online_help_token()">
<% 
if library:
    return "import_library" 
else:
    return "import_course"
%>
</%def>
11
<%namespace name='static' file='static_content.html'/>
12 13
<%!
  from django.utils.translation import ugettext as _
14 15 16
  from openedx.core.djangolib.js_utils import (
      dump_js_escaped_json, js_escaped_string
  )
17
  from openedx.core.djangolib.markup import HTML, Text
18
%>
19 20 21 22 23 24 25
<%block name="title">
%if library:
    ${_("Library Import")}
%else:
    ${_("Course Import")}
%endif
</%block>
26
<%block name="bodyclass">is-signedin course tools view-import</%block>
27 28

<%block name="content">
29
<div class="wrapper-mast wrapper">
30
  <header class="mast has-subtitle">
Brian Talbot committed
31
    <h1 class="page-header">
David Baumgold committed
32
      <small class="subtitle">${_("Tools")}</small>
33 34 35 36 37 38
      <span class="sr">&gt; </span>
        %if library:
            ${_("Library Import")}
        %else:
            ${_("Course Import")}
        %endif
Brian Talbot committed
39
    </h1>
40 41 42
  </header>
</div>

43 44 45 46
<div class="wrapper-content wrapper">
  <section class="content">
    <article class="content-primary" role="main">
      <div class="introduction">
47 48
        ## Translators: ".tar.gz" is a file extension, and files with that extension are called "gzipped tar files": these terms should not be translated
        %if library:
49
            <p>${Text(_("Be sure you want to import a library before continuing. The contents of the imported library will replace the contents of the existing library. {em_start}You cannot undo a library import{em_end}. Before you proceed, we recommend that you export the current library, so that you have a backup copy of it.")).format(em_start=HTML('<strong>'), em_end=HTML("</strong>"))}</p>
50 51 52
            <p>${_("The library that you import must be in a .tar.gz file (that is, a .tar file compressed with GNU Zip). This .tar.gz file must contain a library.xml file. It may also contain other files.")}</p>
            <p>${_("The import process has five stages. During the first two stages, you must stay on this page. You can leave this page after the Unpacking stage has completed. We recommend, however, that you don't make important changes to your library until the import operation has completed.")}</p>
        %else:
53
            <p>${Text(_("Be sure you want to import a course before continuing. The contents of the imported course will replace the contents of the existing course. {em_start}You cannot undo a course import{em_end}. Before you proceed, we recommend that you export the current course, so that you have a backup copy of it.")).format(em_start=HTML('<strong>'), em_end=HTML("</strong>"))}</p>
54 55 56 57
            <p>${_("The course that you import must be in a .tar.gz file (that is, a .tar file compressed with GNU Zip). This .tar.gz file must contain a course.xml file. It may also contain other files.")}</p>
            <p>${_("The import process has five stages. During the first two stages, you must stay on this page. You can leave this page after the Unpacking stage has completed. We recommend, however, that you don't make important changes to your course until the import operation has completed.")}</p>
        %endif

Tom Giannattasio committed
58
      </div>
59

60
      <form id="fileupload" method="post" enctype="multipart/form-data" class="import-form">
61

62
        ## Translators: ".tar.gz" is a file extension, and files with that extension are called "gzipped tar files": these terms should not be translated
63 64 65 66 67 68 69
        <h2 class="title">
            %if library:
                ${_("Select a .tar.gz File to Replace Your Library Content")}
            %else:
                ${_("Select a .tar.gz File to Replace Your Course Content")}
            %endif
        </h2>
70

71
        <p class="error-block"></p>
72

73
        <a href="#" class="action action-choose-file choose-file-button">
74
          <span class="icon fa fa-upload" aria-hidden="true"></span>
75 76
          <span class="copy">${_("Choose a File to Import")}</span>
        </a>
77 78 79

        <div class="wrapper wrapper-file-name file-name-block">
            <h3 class="title">
80
              <span class="label">${_("File Chosen:")}</span>
81 82 83 84 85
              <span class="file-name"></span>
            </h3>

          <input type="file" name="course-data" class="file-input" />

86 87 88 89 90 91 92
          <input type="submit"
          %if library:
              value="${_('Replace my library with the selected file')}"
          %else:
              value="${_('Replace my course with the selected file')}"
          %endif
           class="submit-button" id="replace-courselike-button" />
93
        </div>
94 95

        <div class="wrapper wrapper-status is-hidden">
96 97 98 99 100 101 102
          <h3 class="title">
              %if library:
                  ${_("Library Import Status")}
              %else:
                  ${_("Course Import Status")}
              %endif
          </h3>
103 104 105 106

          <ol class="status-progress list-progress">
            <li class="item-progresspoint item-progresspoint-upload is-complete">
              <span class="deco status-visual">
107 108
                <span class="icon fa fa-cog" aria-hidden="true"></span>
                <span class="icon fa fa-warning" aria-hidden="true"></span>
109 110 111 112
              </span>

              <div class="status-detail">
                <h3 class="title">${_("Uploading")}</h3>
113 114 115
                <div class="progress-bar">
                  <div class="progress-fill"></div>
                </div>
116 117 118 119 120 121
                <p class="copy">${_("Transferring your file to our servers")}</p>
              </div>
            </li>

            <li class="item-progresspoint item-progresspoint-unpack is-started">
              <span class="deco status-visual">
122
                <span class="icon fa fa-cog" aria-hidden="true"></span>
123
                <span class="icon fa fa-warning" aria-hidden="true"></span>
124 125 126 127
              </span>

              <div class="status-detail">
                <h3 class="title">${_("Unpacking")}</h3>
128
                <p class="copy">${_("Expanding and preparing folder/file structure (You can now leave this page safely, but avoid making drastic changes to content until this import is complete)")}</p>
129 130 131 132 133 134
              </div>
            </li>


            <li class="item-progresspoint item-progresspoint-verify is-not-started">
              <span class="deco status-visual">
135 136
                <span class="icon fa fa-cog" aria-hidden="true"></span>
                <span class="icon fa fa-warning" aria-hidden="true"></span>
137 138 139 140 141 142 143 144 145 146
              </span>

              <div class="status-detail">
                <h3 class="title">${_("Verifying")}</h3>
                <p class="copy">${_("Reviewing semantics, syntax, and required data")}</p>
              </div>
            </li>

            <li class="item-progresspoint item-progresspoint-import is-not-started">
              <span class="deco status-visual">
147 148
                <span class="icon fa fa-cog" aria-hidden="true"></span>
                <span class="icon fa fa-warning" aria-hidden="true"></span>
149 150 151
              </span>

              <div class="status-detail">
152 153 154 155 156 157 158 159 160 161 162 163 164 165
                <h3 class="title">
                    %if library:
                        ${_("Updating Library")}
                    %else:
                        ${_("Updating Course")}
                    %endif
                </h3>
                <p class="copy">
                    %if Library:
                        ${_("Integrating your imported content into this library. This process might take longer with larger libraries.")}
                    %else:
                        ${_("Integrating your imported content into this course. This process might take longer with larger courses.")}
                    %endif
                </p>
166 167
              </div>
            </li>
168
            <li class="item-progresspoint item-progresspoint-success has-actions is-not-started">
169
              <span class="deco status-visual">
170
                <span class="icon fa fa-square-o" aria-hidden="true"></span>
171 172 173
              </span>

              <div class="status-detail">
174 175 176 177
                <h3 class="title">
                  ${_("Success")}
                  <span class="item-progresspoint-success-date"></span>
                </h3>
178 179 180 181 182 183 184
                <p class="copy">
                    %if library:
                        ${_("Your imported content has now been integrated into this library")}
                    %else:
                        ${_("Your imported content has now been integrated into this course")}
                    %endif
                </p>
185

186 187
                <ul class="list-actions">
                  <li class="item-action">
188 189 190 191 192 193 194
                    <a href="${successful_import_redirect_url}" id="view-updated-button" class="action action-primary">
                        %if library:
                            ${_("View Updated Library")}
                        %else:
                            ${_("View Updated Outline")}
                        %endif
                    </a>
195 196 197
                  </li>
                </ul>
              </div>
198
            </li>
199
          </ol>
200
        </div>
Tom Giannattasio committed
201 202
      </form>
    </article>
203

204 205 206 207
  %if library:
    <aside class="content-supplementary" role="complimentary">
      <div class="bit">
          <h3 class="title-3">${_("Why import a library?")}</h3>
208
          <p>${_("You might want to update an existing library to a new version, or replace an existing library entirely. You might also have developed a library outside of {studio_name}.").format(studio_name=settings.STUDIO_SHORT_NAME)}</p>
209 210 211 212 213 214
      </div>

      <div class="bit">
          <h3 class="title-3">${_("Note: Library content is not automatically updated in courses")}</h3>
          <p>${_("If you change and import a library that is referenced by randomized content blocks in one or more courses, those courses do not automatically use the updated content. You must manually refresh the randomized content blocks to bring them up to date with the latest library content.")}</p>
      </div>
215 216 217
      <div class="bit external-help">
          <a href="${get_online_help_info(online_help_token())['doc_url']}" target="_blank" class="button external-help-button">${_("Learn more about importing a library")}</a>
      </div>      
218 219
    </aside>
  %else:
220
    <aside class="content-supplementary" role="complementary">
221
      <div class="bit">
222
        <h3 class="title-3">${_("Why import a course?")}</h3>
223
        <p>${_("You may want to run a new version of an existing course, or replace an existing course altogether. Or, you may have developed a course outside {studio_name}.").format(studio_name=settings.STUDIO_SHORT_NAME)}</p>
224 225 226
      </div>

      <div class="bit">
227 228
        <h3 class="title-3">${_("What content is imported?")}</h3>
        <p>${_("Only the course content and structure (including sections, subsections, and units) are imported. Other data, including student data, grading information, discussion forum data, course settings, and course team information, remains the same as it was in the existing course.")}</p>
229
      </div>
230 231

      <div class="bit">
232 233
        <h3 class="title-3">${_("Warning: Importing while a course is running")}</h3>
        <p>${_("If you perform an import while your course is running, and you change the URL names (or url_name nodes) of any Problem components, the student data associated with those Problem components may be lost. This data includes students' problem scores.")}</p>
234
      </div>
235 236 237
      <div class="bit external-help">
          <a href="${get_online_help_info(online_help_token())['doc_url']}" target="_blank" class="button external-help-button">${_("Learn more about importing a course")}</a>
      </div>      
238
    </aside>
239
  %endif
240
  </section>
241
</div>
242 243
</%block>

244 245
<%block name="requirejs">
  require(["js/factories/import"], function(ImportFactory) {
246 247 248 249
      ImportFactory(
          "${import_status_url | n, js_escaped_string}",
          ${library | n, dump_js_escaped_json}
      );
250
  });
Brian Talbot committed
251
</%block>