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
6bd35fd6
Commit
6bd35fd6
authored
Jun 08, 2016
by
Tasawer Nawaz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12644 from edx/tasawer/story/ecom-4559-update-receipt-page
Update Receipt page
parents
905c5c56
38104eb6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
lms/static/js/commerce/views/receipt_view.js
+14
-0
lms/static/js/spec/commerce/receipt_view_spec.js
+10
-2
lms/templates/commerce/receipt.underscore
+3
-2
No files found.
lms/static/js/commerce/views/receipt_view.js
View file @
6bd35fd6
...
...
@@ -47,6 +47,8 @@ var edx = edx || {};
this
.
renderCourseNamePlaceholder
(
this
.
courseKey
);
this
.
renderUserFullNamePlaceholder
(
this
.
username
);
providerId
=
this
.
getCreditProviderId
(
data
);
if
(
providerId
)
{
this
.
getProviderData
(
providerId
).
then
(
this
.
renderProvider
,
this
.
renderError
)
...
...
@@ -61,6 +63,18 @@ var edx = edx || {};
$courseNamePlaceholder
.
text
(
responseData
.
name
);
});
},
renderUserFullNamePlaceholder
:
function
(
username
)
{
var
userModel
=
Backbone
.
Model
.
extend
({
urlRoot
:
'/api/user/v1/accounts/'
,
url
:
function
()
{
return
this
.
urlRoot
+
this
.
id
;
}
});
this
.
user
=
new
userModel
({
id
:
username
});
this
.
user
.
fetch
({
success
:
function
(
userData
)
{
$
(
".full_name_placeholder"
).
text
(
userData
.
get
(
'name'
));
}});
},
renderProvider
:
function
(
context
)
{
var
templateHtml
=
$
(
"#provider-tpl"
).
html
(),
providerDiv
=
this
.
$el
.
find
(
"#receipt-provider"
);
...
...
lms/static/js/spec/commerce/receipt_view_spec.js
View file @
6bd35fd6
...
...
@@ -7,7 +7,8 @@ define([
function
(
$
,
AjaxRetry
,
ReceiptView
,
AjaxHelpers
){
'use strict'
;
describe
(
'edx.commerce.ReceiptView'
,
function
()
{
var
data
,
courseResponseData
,
providerResponseData
,
mockRequests
,
mockRender
,
createReceiptView
;
var
data
,
courseResponseData
,
providerResponseData
,
mockRequests
,
mockRender
,
createReceiptView
,
userResponseData
;
createReceiptView
=
function
()
{
return
new
ReceiptView
({
el
:
$
(
'#receipt-container'
)});
...
...
@@ -39,6 +40,10 @@ define([
requests
,
'GET'
,
'/api/courses/v1/courses/course-v1:edx+dummy+2015_T3/'
,
courseResponseData
);
mockRequests
(
requests
,
'GET'
,
'/api/user/v1/accounts/user-1'
,
userResponseData
);
mockRequests
(
requests
,
'GET'
,
'/api/credit/v1/providers/edx/'
,
providerResponseData
);
return
view
;
};
...
...
@@ -141,7 +146,10 @@ define([
"start"
:
"2030-01-01T00:00:00Z"
,
"end"
:
null
};
userResponseData
=
{
"username"
:
"user-1"
,
"name"
:
"full name"
};
});
it
(
'sends analytic event when verified receipt is rendered'
,
function
()
{
...
...
lms/templates/commerce/receipt.underscore
View file @
6bd35fd6
...
...
@@ -2,8 +2,9 @@
<article class="content-main">
<h3 class="title">
<%= interpolate(
gettext( "Thank you! We have received your payment for %(course_name)s."),
{ course_name: "<span class='course_name_placeholder'></span>" }, true
gettext( "Thank you %(full_name)s! We have received your payment for %(course_name)s."),
{ course_name: "<span class='course_name_placeholder'></span>",
full_name: "<span class='full_name_placeholder'></span>"}, true
) %>
</h3>
...
...
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