Commit 5e426614 by Qubad786

remove nits and violation

parent b79b6e6a
...@@ -11,7 +11,7 @@ else: ...@@ -11,7 +11,7 @@ else:
<%namespace name='static' file='static_content.html'/> <%namespace name='static' file='static_content.html'/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from openedx.core.djangolib.js_utils import ( from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string dump_js_escaped_json, js_escaped_string
) )
...@@ -46,11 +46,17 @@ else: ...@@ -46,11 +46,17 @@ else:
<div class="introduction"> <div class="introduction">
## Translators: ".tar.gz" is a file extension, and files with that extension are called "gzipped tar files": these terms should not be translated ## 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: %if library:
<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> <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>
<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 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> <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: %else:
<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> <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>
<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 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> <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 %endif
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<%def name="online_help_token()"><% return "register" %></%def> <%def name="online_help_token()"><% return "register" %></%def>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
%> %>
......
...@@ -36,21 +36,21 @@ from courseware.courses import get_course_about_section ...@@ -36,21 +36,21 @@ from courseware.courses import get_course_about_section
% if can_add_course_to_cart: % if can_add_course_to_cart:
add_course_complete_handler = function(jqXHR, textStatus) { add_course_complete_handler = function(jqXHR, textStatus) {
if (jqXHR.status == 200) { if (jqXHR.status == 200) {
location.href = "${cart_link| n, js_escaped_string}"; location.href = "${cart_link | n, js_escaped_string}";
} }
if (jqXHR.status == 400) { if (jqXHR.status == 400) {
$("#register_error") $("#register_error")
.text(jqXHR.responseText ? jqXHR.responseText : "${_('An error occurred. Please try again later.')| n, js_escaped_string}") .text(jqXHR.responseText ? jqXHR.responseText : "${_('An error occurred. Please try again later.') | n, js_escaped_string}")
.css("display", "block"); .css("display", "block");
} }
else if (jqXHR.status == 403) { else if (jqXHR.status == 403) {
location.href = "${reg_then_add_to_cart_link| n, js_escaped_string}"; location.href = "${reg_then_add_to_cart_link | n, js_escaped_string}";
} }
}; };
$("#add_to_cart_post").click(function(event){ $("#add_to_cart_post").click(function(event){
$.ajax({ $.ajax({
url: "${reverse('add_course_to_cart', args=[course.id.to_deprecated_string()])| n, js_escaped_string}", url: "${reverse('add_course_to_cart', args=[course.id.to_deprecated_string()]) | n, js_escaped_string}",
type: "POST", type: "POST",
/* Rant: HAD TO USE COMPLETE B/C PROMISE.DONE FOR SOME REASON DOES NOT WORK ON THIS PAGE. */ /* Rant: HAD TO USE COMPLETE B/C PROMISE.DONE FOR SOME REASON DOES NOT WORK ON THIS PAGE. */
complete: add_course_complete_handler complete: add_course_complete_handler
...@@ -73,17 +73,17 @@ from courseware.courses import get_course_about_section ...@@ -73,17 +73,17 @@ from courseware.courses import get_course_about_section
%> %>
$('#class_enroll_form').on('ajax:complete', function(event, xhr) { $('#class_enroll_form').on('ajax:complete', function(event, xhr) {
if(xhr.status == 200) { if(xhr.status == 200) {
location.href = "${reverse('dashboard')| n, js_escaped_string}"; location.href = "${reverse('dashboard') | n, js_escaped_string}";
} else if (xhr.status == 403) { } else if (xhr.status == 403) {
location.href = "${reverse('course-specific-register', args=[course.id.to_deprecated_string()])| n, js_escaped_string}?course_id=${course.id| n, js_escaped_string}&enrollment_action=enroll"; location.href = "${reverse('course-specific-register', args=[course.id.to_deprecated_string()]) | n, js_escaped_string}?course_id=${course.id | n, js_escaped_string}&enrollment_action=enroll";
} else if (xhr.status == 400) {//This means the user did not have permission } else if (xhr.status == 400) {//This means the user did not have permission
edx.HtmlUtils.setHtml( edx.HtmlUtils.setHtml(
$('#register_error'), $('#register_error'),
"${perms_error}" edx.HtmlUtils.HTML("${perms_error | n, js_escaped_string}")
) )
} else { } else {
$('#register_error').text( $('#register_error').text(
(xhr.responseText ? xhr.responseText : "${_('An error occurred. Please try again later.')| n, js_escaped_string}") (xhr.responseText ? xhr.responseText : "${_('An error occurred. Please try again later.') | n, js_escaped_string}")
).css("display", "block"); ).css("display", "block");
} }
}); });
...@@ -93,16 +93,16 @@ from courseware.courses import get_course_about_section ...@@ -93,16 +93,16 @@ from courseware.courses import get_course_about_section
$('#class_enroll_form').on('ajax:complete', function(event, xhr) { $('#class_enroll_form').on('ajax:complete', function(event, xhr) {
if(xhr.status == 200) { if(xhr.status == 200) {
if (xhr.responseText == "") { if (xhr.responseText == "") {
location.href = "${reverse('dashboard')| n, js_escaped_string}"; location.href = "${reverse('dashboard') | n, js_escaped_string}";
} }
else { else {
location.href = xhr.responseText; location.href = xhr.responseText;
} }
} else if (xhr.status == 403) { } else if (xhr.status == 403) {
location.href = "${reverse('register_user')| n, js_escaped_string}?course_id=${course.id| n, js_escaped_string}&enrollment_action=enroll"; location.href = "${reverse('register_user') | n, js_escaped_string}?course_id=${course.id | n, js_escaped_string}&enrollment_action=enroll";
} else { } else {
$('#register_error').text( $('#register_error').text(
(xhr.responseText ? xhr.responseText : "${_('An error occurred. Please try again later.')| n, js_escaped_string}") (xhr.responseText ? xhr.responseText : "${_('An error occurred. Please try again later.') | n, js_escaped_string}")
).css("display", "block"); ).css("display", "block");
} }
}); });
......
<%page expression_filter="h"/> <%page expression_filter="h"/>
<div id="problem_${element_id}" class="problems-wrapper" data-problem-id="${id}" data-url="${ajax_url}" data-progress_status="${progress_status}" data-progress_detail="${progress_detail}" data-content="${content}"></div> <div id="problem_${element_id}" class="problems-wrapper" data-problem-id="${id}" data-url="${ajax_url}" data-progress_status="${progress_status}" data-progress_detail="${progress_detail}" data-content="${content}"></div>
\ No newline at end of file
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