Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ff192935
Commit
ff192935
authored
Dec 27, 2013
by
David Ormsbee
Committed by
Sarina Canelake
Jan 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing JS gettext() in favor of server-side substitution.
[LMS-1680]
parent
eeb5f812
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
35 deletions
+36
-35
cms/templates/asset_index.html
+7
-6
cms/templates/textbooks.html
+1
-1
lms/envs/common.py
+1
-1
lms/templates/help_modal.html
+21
-21
lms/templates/login.html
+1
-1
lms/templates/manage_user_standing.html
+1
-1
lms/templates/register-shib.html
+2
-2
lms/templates/register.html
+2
-2
No files found.
cms/templates/asset_index.html
View file @
ff192935
...
...
@@ -18,13 +18,14 @@
<
%
block
name=
"jsextra"
>
<script
type=
"text/javascript"
>
require
([
"domReady"
,
"jquery"
,
"
gettext"
,
"
js/models/asset"
,
"js/collections/asset"
,
require
([
"domReady"
,
"jquery"
,
"js/models/asset"
,
"js/collections/asset"
,
"js/views/assets"
,
"js/views/feedback_prompt"
,
"js/views/feedback_notification"
,
"js/views/paging_header"
,
"js/views/paging_footer"
,
"js/utils/modal"
,
"jquery.fileupload"
],
function
(
domReady
,
$
,
gettext
,
AssetModel
,
AssetCollection
,
AssetsView
,
PromptView
,
NotificationView
,
function
(
domReady
,
$
,
AssetModel
,
AssetCollection
,
AssetsView
,
PromptView
,
NotificationView
,
PagingHeader
,
PagingFooter
,
ModalUtils
)
{
var
assets
=
new
AssetCollection
();
assets
.
url
=
"${asset_callback_url}"
;
var
assetsView
=
new
AssetsView
({
collection
:
assets
,
el
:
$
(
'#asset-library'
)});
assetsView
.
render
();
...
...
@@ -74,7 +75,7 @@ require(["domReady", "jquery", "gettext", "js/models/asset", "js/collections/ass
var
startUpload
=
function
(
e
)
{
var
file
=
e
.
target
.
value
;
$
(
'.upload-modal h1'
).
html
(
gettext
(
'Uploading…'
)
);
$
(
'.upload-modal h1'
).
text
(
"${_(u'Uploading…')}"
);
$
(
'.upload-modal .file-name'
).
html
(
file
.
substring
(
file
.
lastIndexOf
(
"
\
\"
) + 1));
$('.upload-modal .choose-file-button').hide();
$('.upload-modal .progress-bar').removeClass('loaded').show();
...
...
@@ -90,7 +91,7 @@ require(["domReady", "jquery", "gettext", "js/models/asset", "js/collections/ass
$('.upload-modal .file-name').show();
$('.upload-modal .file-name').html('');
$('.upload-modal .choose-file-button').
html(gettext('Choose File')
);
$('.upload-modal .choose-file-button').
text("
$
{
_
(
'Choose File'
)}
"
);
$('.upload-modal .embeddable-xml-input').val('');
$('.upload-modal .embeddable').hide();
};
...
...
@@ -104,12 +105,12 @@ require(["domReady", "jquery", "gettext", "js/models/asset", "js/collections/ass
var displayFinishedUpload = function (resp) {
var asset = resp.asset;
$('.upload-modal h1').
html(gettext('Upload New File')
);
$('.upload-modal h1').
text("
$
{
_
(
'Upload New File'
)}
"
);
$('.upload-modal .embeddable-xml-input').val(asset.portable_url);
$('.upload-modal .embeddable').show();
$('.upload-modal .file-name').hide();
$('.upload-modal .progress-fill').html(resp.msg);
$('.upload-modal .choose-file-button').
html(gettext('Load Another File')
).show();
$('.upload-modal .choose-file-button').
text("
$
{
_
(
'Load Another File'
)}
"
).show();
$('.upload-modal .progress-fill').width('100%');
assetsView.addAsset(new AssetModel(asset));
...
...
cms/templates/textbooks.html
View file @
ff192935
...
...
@@ -34,7 +34,7 @@ require(["js/models/section", "js/collections/textbook", "js/views/list_textbook
$
(
window
).
on
(
"beforeunload"
,
function
()
{
var
dirty
=
textbooks
.
find
(
function
(
textbook
)
{
return
textbook
.
isDirty
();
});
if
(
dirty
)
{
return
gettext
(
"You have unsaved changes. Do you really want to leave this page?"
)
;
return
"${_('You have unsaved changes. Do you really want to leave this page?')}"
;
}
})
})
...
...
lms/envs/common.py
View file @
ff192935
...
...
@@ -144,7 +144,7 @@ FEATURES = {
# Enables the student notes API and UI.
'ENABLE_STUDENT_NOTES'
:
True
,
# Provide a UI to allow users to submit feedback from the LMS
# Provide a UI to allow users to submit feedback from the LMS
(left-hand help modal)
'ENABLE_FEEDBACK_SUBMISSION'
:
False
,
# Turn on a page that lets staff enter Python code to be run in the
...
...
lms/templates/help_modal.html
View file @
ff192935
...
...
@@ -60,14 +60,14 @@ discussion_link = get_discussion_link(course) if course else None
<form
id=
"feedback_form"
class=
"feedback_form"
method=
"post"
data-remote=
"true"
action=
"/submit_feedback"
>
<div
id=
"feedback_error"
class=
"modal-form-error"
tabindex=
"-1"
></div>
% if not user.is_authenticated():
<label
data-field=
"name"
for=
"feedback_form_name"
>
${_('Name
*')}
</label>
<label
data-field=
"name"
for=
"feedback_form_name"
>
${_('Name
')}*
</label>
<input
name=
"name"
type=
"text"
id=
"feedback_form_name"
aria-required=
"true"
>
<label
data-field=
"email"
for=
"feedback_form_email"
>
${_('E-mail
*')}
</label>
<label
data-field=
"email"
for=
"feedback_form_email"
>
${_('E-mail
')}*
</label>
<input
name=
"email"
type=
"text"
id=
"feedback_form_email"
aria-required=
"true"
>
% endif
<label
data-field=
"subject"
for=
"feedback_form_subject"
>
${_('Briefly describe your issue
*')}
</label>
<label
data-field=
"subject"
for=
"feedback_form_subject"
>
${_('Briefly describe your issue
')}*
</label>
<input
name=
"subject"
type=
"text"
id=
"feedback_form_subject"
aria-required=
"true"
>
<label
data-field=
"details"
for=
"feedback_form_details"
>
${_('Tell us the details
*')}
<label
data-field=
"details"
for=
"feedback_form_details"
>
${_('Tell us the details
')}*
<span
class=
"tip"
>
${_('Include error messages, steps which lead to the issue, etc')}
</span></label>
<textarea
name=
"details"
id=
"feedback_form_details"
aria-required=
"true"
></textarea>
<input
name=
"issue_type"
type=
"hidden"
>
...
...
@@ -75,7 +75,7 @@ discussion_link = get_discussion_link(course) if course else None
<input
name=
"course_id"
type=
"hidden"
value=
"${course.id | h}"
>
% endif
<div
class=
"submit"
>
<input
name=
"submit"
type=
"submit"
value=
"
Submit
"
id=
"feedback_submit"
>
<input
name=
"submit"
type=
"submit"
value=
"
${_('Submit')}
"
id=
"feedback_submit"
>
</div>
</form>
</div>
...
...
@@ -168,29 +168,29 @@ discussion_link = get_discussion_link(course) if course else None
$
(
"#feedback_link_problem"
).
click
(
function
(
event
)
{
showFeedback
(
event
,
gettext
(
"problem"
)
,
gettext
(
"Report a Problem"
)
,
gettext
(
"Brief description of the problem*"
)
,
gettext
(
"Details of the problem you are encountering*"
)
+
"<span class='tip'>"
+
gettext
(
"Include error messages, steps which lead to the issue, etc."
)
+
"</span>"
"${_('problem')}"
,
"${_('Report a Problem')}"
,
"${_('Brief description of the problem')}"
+
"*"
,
"${_('Details of the problem you are encountering')}"
+
"*"
+
"<span class='tip'>"
+
"${_('Include error messages, steps which lead to the issue, etc.')}"
+
"</span>"
);
});
$
(
"#feedback_link_suggestion"
).
click
(
function
(
event
)
{
showFeedback
(
event
,
gettext
(
"suggestion"
)
,
gettext
(
"Make a Suggestion"
)
,
gettext
(
"Brief description of your suggestion*"
)
,
gettext
(
"Details*"
)
"${_('suggestion')}"
,
"${_('Make a Suggestion')}"
,
"${_('Brief description of your suggestion')}"
+
"*"
,
"${_('Details')}"
+
"*"
);
});
$
(
"#feedback_link_question"
).
click
(
function
(
event
)
{
showFeedback
(
event
,
gettext
(
"question"
)
,
gettext
(
"Ask a Question"
)
,
gettext
(
"Brief summary of your question*"
)
,
gettext
(
"Details*"
)
"${_('question')}"
,
"${_('Ask a Question')}"
,
"${_('Brief summary of your question')}"
+
"*"
,
"${_('Details')}"
+
"*"
);
});
$
(
"#feedback_form"
).
submit
(
function
()
{
...
...
@@ -218,16 +218,16 @@ discussion_link = get_discussion_link(course) if course else None
$
(
"#feedback_error"
).
html
(
responseData
.
error
).
stop
().
css
(
"display"
,
"block"
);
}
else
{
// If no data (or malformed data) is returned, a server error occurred
htmlStr
=
gettext
(
"An error has occurred."
)
;
htmlStr
=
"${_('An error has occurred.')}"
;
%
if
settings
.
FEEDBACK_SUBMISSION_EMAIL
:
htmlStr
+=
" "
+
_
.
template
(
gettext
(
"Please {link_start}send us e-mail{link_end}."
)
,
"${_('Please {link_start}send us e-mail{link_end}.')}"
,
{
link_start
:
'<a href="#" id="feedback_email">'
,
link_end
:
'</a>'
},
{
interpolate
:
/
\{(
.+
?)\}
/g
})
%
else
:
// If no email is configured, we can't do much other than
// ask the user to try again later
htmlStr
+=
gettext
(
" Please try again later."
)
;
htmlStr
+=
"${_('Please try again later.')}"
;
%
endif
$
(
"#feedback_error"
).
html
(
htmlStr
).
stop
().
css
(
"display"
,
"block"
);
%
if
settings
.
FEEDBACK_SUBMISSION_EMAIL
:
...
...
lms/templates/login.html
View file @
ff192935
...
...
@@ -89,7 +89,7 @@
$submitButton
.
addClass
(
'is-disabled'
).
prop
(
'disabled'
,
true
).
html
(
"${_(u'Processing your account information…')}"
);
text
(
"${_(u'Processing your account information…')}"
);
}
}
</script>
...
...
lms/templates/manage_user_standing.html
View file @
ff192935
...
...
@@ -42,7 +42,7 @@
$
(
function
()
{
var
form
=
$
(
"#disable-form"
);
$
(
"#submit-form"
).
click
(
function
(){
$
(
"#account-change-status"
).
html
(
gettext
(
"working..."
)
);
$
(
"#account-change-status"
).
text
(
"${_('working...')}"
);
$
.
ajax
({
type
:
"POST"
,
url
:
form
.
attr
(
'action'
),
...
...
lms/templates/register-shib.html
View file @
ff192935
...
...
@@ -70,13 +70,13 @@
$submitButton
.
removeClass
(
'is-disabled'
).
removeProp
(
'disabled'
).
html
(
"${_('Update my {platform_name} Account').format(platform_name=settings.PLATFORM_NAME)}"
);
text
(
"${_('Update my {platform_name} Account').format(platform_name=settings.PLATFORM_NAME)}"
);
}
else
{
$submitButton
.
addClass
(
'is-disabled'
).
prop
(
'disabled'
,
true
).
html
(
gettext
(
'Processing your account information …'
)
);
text
(
"${_(u'Processing your account information …')}"
);
}
}
</script>
...
...
lms/templates/register.html
View file @
ff192935
...
...
@@ -76,13 +76,13 @@
$submitButton
.
removeClass
(
'is-disabled'
).
removeProp
(
'disabled'
).
html
(
"${_('Create My {platform_name} Account').format(platform_name=settings.PLATFORM_NAME)}"
);
text
(
"${_('Create My {platform_name} Account').format(platform_name=settings.PLATFORM_NAME)}"
);
}
else
{
$submitButton
.
addClass
(
'is-disabled'
).
prop
(
'disabled'
,
true
).
html
(
gettext
(
'Processing your account information …'
)
);
text
(
"${_(u'Processing your account information…')}"
);
}
}
</script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment