Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
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
ecommerce
Commits
80137c29
Commit
80137c29
authored
Feb 12, 2017
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up JS code
ECOM-7141
parent
f29768f3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
33 deletions
+97
-33
ecommerce/conf/locale/en/LC_MESSAGES/djangojs.mo
+0
-0
ecommerce/conf/locale/en/LC_MESSAGES/djangojs.po
+40
-4
ecommerce/conf/locale/eo/LC_MESSAGES/djangojs.mo
+0
-0
ecommerce/conf/locale/eo/LC_MESSAGES/djangojs.po
+38
-2
ecommerce/static/js/pages/basket_page.js
+0
-0
ecommerce/static/js/pages/receipt_page.js
+13
-13
ecommerce/static/js/test/specs/pages/basket_page_spec.js
+0
-9
ecommerce/static/js/test/specs/pages/receipt_page_spec.js
+4
-3
ecommerce/static/js/test/specs/views/offer_view_spec.js
+2
-2
No files found.
ecommerce/conf/locale/en/LC_MESSAGES/djangojs.mo
View file @
80137c29
No preview for this file type
ecommerce/conf/locale/en/LC_MESSAGES/djangojs.po
View file @
80137c29
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-0
1-31 18:11+00
00\n"
"POT-Creation-Date: 2017-0
2-13 10:45-05
00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
@@ -50,11 +50,11 @@ msgstr ""
...
@@ -50,11 +50,11 @@ msgstr ""
msgid "Must occur after start date"
msgid "Must occur after start date"
msgstr ""
msgstr ""
#: ecommerce/static/js/models/coupon_model.js:14
2
#: ecommerce/static/js/models/coupon_model.js:14
5
msgid "Max uses for multi-use coupons must be higher than 2."
msgid "Max uses for multi-use coupons must be higher than 2."
msgstr ""
msgstr ""
#: ecommerce/static/js/models/coupon_model.js:17
0
#: ecommerce/static/js/models/coupon_model.js:17
3
msgid "Must occur before end date"
msgid "Must occur before end date"
msgstr ""
msgstr ""
...
@@ -154,10 +154,46 @@ msgstr ""
...
@@ -154,10 +154,46 @@ msgstr ""
msgid "All credit seats must designate a number of credit hours."
msgid "All credit seats must designate a number of credit hours."
msgstr ""
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:
48
#: ecommerce/static/js/pages/basket_page.js:
27
msgid "Problem occurred during checkout. Please contact support"
msgid "Problem occurred during checkout. Please contact support"
msgstr ""
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:93
msgid "This field is required"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:120
msgid "Invalid card number"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:122
msgid "Unsupported card type"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:124
msgid "Invalid security number"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:129
msgid "Invalid month"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:131
msgid "Invalid year"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:133
msgid "Card expired"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:298
msgid "<Choose state/province>"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:299
msgid "State/Province (required)"
msgstr ""
#: ecommerce/static/js/pages/coupon_create_page.js:12
#: ecommerce/static/js/pages/coupon_create_page.js:12
msgid "Create New Coupon"
msgid "Create New Coupon"
msgstr ""
msgstr ""
...
...
ecommerce/conf/locale/eo/LC_MESSAGES/djangojs.mo
View file @
80137c29
No preview for this file type
ecommerce/conf/locale/eo/LC_MESSAGES/djangojs.po
View file @
80137c29
...
@@ -7,14 +7,14 @@ msgid ""
...
@@ -7,14 +7,14 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-0
1-31 18:11+00
00\n"
"POT-Creation-Date: 2017-0
2-13 10:45-05
00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ecommerce/static/js/models/coupon_model.js
#: ecommerce/static/js/models/coupon_model.js
...
@@ -179,6 +179,42 @@ msgstr ""
...
@@ -179,6 +179,42 @@ msgstr ""
"Prößlém öççürréd dürïng çhéçköüt. Pléäsé çöntäçt süppört Ⱡ'σяєм ιρѕυм ∂σłσя "
"Prößlém öççürréd dürïng çhéçköüt. Pléäsé çöntäçt süppört Ⱡ'σяєм ιρѕυм ∂σłσя "
"ѕιт αмєт, ¢σηѕє¢тєтυя α#"
"ѕιт αмєт, ¢σηѕє¢тєтυя α#"
#: ecommerce/static/js/pages/basket_page.js
msgid "This field is required"
msgstr "Thïs fïéld ïs réqüïréd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Invalid card number"
msgstr "Ìnvälïd çärd nümßér Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт,#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Unsupported card type"
msgstr "Ûnsüppörtéd çärd týpé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
#: ecommerce/static/js/pages/basket_page.js
msgid "Invalid security number"
msgstr "Ìnvälïd séçürïtý nümßér Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σ#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Invalid month"
msgstr "Ìnvälïd mönth Ⱡ'σяєм ιρѕυм ∂σłσя ѕι#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Invalid year"
msgstr "Ìnvälïd ýéär Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Card expired"
msgstr "Çärd éxpïréd Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"
#: ecommerce/static/js/pages/basket_page.js
msgid "<Choose state/province>"
msgstr "<Choose state/province> Ⱡ'σяєм#"
#: ecommerce/static/js/pages/basket_page.js
msgid "State/Province (required)"
msgstr "Stäté/Prövïnçé (réqüïréd) Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕ#"
#: ecommerce/static/js/pages/coupon_create_page.js
#: ecommerce/static/js/pages/coupon_create_page.js
msgid "Create New Coupon"
msgid "Create New Coupon"
msgstr "Çréäté Néw Çöüpön Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмє#"
msgstr "Çréäté Néw Çöüpön Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмє#"
...
...
ecommerce/static/js/pages/basket_page.js
View file @
80137c29
This diff is collapsed.
Click to expand it.
ecommerce/static/js/pages/receipt_page.js
View file @
80137c29
...
@@ -5,32 +5,32 @@
...
@@ -5,32 +5,32 @@
define
([
define
([
'jquery'
'jquery'
],
],
function
(
$
function
(
$
)
{
)
{
'use strict'
;
'use strict'
;
var
onReady
=
function
()
{
function
trackPurchase
(
order_id
,
total_amount
,
currency
)
{
window
.
analytics
.
track
(
'Completed Purchase'
,
{
orderId
:
order_id
,
total
:
total_amount
,
currency
:
currency
});
}
function
onReady
()
{
var
el
=
$
(
'#receipt-container'
),
var
el
=
$
(
'#receipt-container'
),
order_id
=
el
.
data
(
'order-id'
),
order_id
=
el
.
data
(
'order-id'
),
fire_tracking_events
=
el
.
data
(
'fire-tracking-events'
),
fire_tracking_events
=
el
.
data
(
'fire-tracking-events'
),
total_amount
=
el
.
data
(
'total-amount'
),
total_amount
=
el
.
data
(
'total-amount'
),
currency
=
el
.
data
(
'currency'
);
currency
=
el
.
data
(
'currency'
);
if
(
order_id
&&
fire_tracking_events
)
{
if
(
order_id
&&
fire_tracking_events
)
{
trackPurchase
(
order_id
,
total_amount
,
currency
);
trackPurchase
(
order_id
,
total_amount
,
currency
);
}
}
},
}
trackPurchase
=
function
(
order_id
,
total_amount
,
currency
)
{
window
.
analytics
.
track
(
'Completed Purchase'
,
{
orderId
:
order_id
,
total
:
total_amount
,
currency
:
currency
});
};
$
(
document
).
ready
(
onReady
);
$
(
document
).
ready
(
onReady
);
return
{
return
{
onReady
:
onReady
,
onReady
:
onReady
};
};
}
}
);
);
ecommerce/static/js/test/specs/pages/basket_page_spec.js
View file @
80137c29
...
@@ -452,15 +452,6 @@ define([
...
@@ -452,15 +452,6 @@ define([
});
});
});
});
describe
(
'appendToForm'
,
function
()
{
it
(
'should append input data to form'
,
function
()
{
_
.
each
(
data
.
payment_form_data
,
function
(
value
,
key
)
{
BasketPage
.
appendToForm
(
value
,
key
,
form
);
});
expect
(
form
.
children
().
length
).
toEqual
(
3
);
});
});
describe
(
'onFail'
,
function
()
{
describe
(
'onFail'
,
function
()
{
it
(
'should report error to message div element'
,
function
()
{
it
(
'should report error to message div element'
,
function
()
{
$
(
'<div id="messages"></div>'
).
appendTo
(
'body'
);
$
(
'<div id="messages"></div>'
).
appendTo
(
'body'
);
...
...
ecommerce/static/js/test/specs/pages/receipt_page_spec.js
View file @
80137c29
define
([
define
([
'jquery'
,
'pages/receipt_page'
,
'pages/receipt_page'
,
'utils/analytics_utils'
'utils/analytics_utils'
],
],
function
(
ReceiptPage
,
function
(
$
,
AnalyticsUtils
ReceiptPage
,
)
{
AnalyticsUtils
)
{
'use strict'
;
'use strict'
;
describe
(
'Receipt Page'
,
function
()
{
describe
(
'Receipt Page'
,
function
()
{
...
...
ecommerce/static/js/test/specs/views/offer_view_spec.js
View file @
80137c29
...
@@ -36,7 +36,7 @@ define([
...
@@ -36,7 +36,7 @@ define([
course_start_date
:
'2013-02-05T05:00:00Z'
,
course_start_date
:
'2013-02-05T05:00:00Z'
,
id
:
'course-v1:edX+DemoX+Demo_Course'
,
id
:
'course-v1:edX+DemoX+Demo_Course'
,
voucher_end_date
:
'2016-07-29T00:00:00Z'
,
voucher_end_date
:
'2016-07-29T00:00:00Z'
,
contains_verified
:
true
,
contains_verified
:
true
}),
}),
course2
=
new
OfferModel
({
course2
=
new
OfferModel
({
benefit
:
{
benefit
:
{
...
@@ -58,7 +58,7 @@ define([
...
@@ -58,7 +58,7 @@ define([
course_start_date
:
'2013-02-05T05:00:00Z'
,
course_start_date
:
'2013-02-05T05:00:00Z'
,
id
:
'course-v1:edX+DemoX+Demo_Courseewewe'
,
id
:
'course-v1:edX+DemoX+Demo_Courseewewe'
,
voucher_end_date
:
'2016-07-29T00:00:00Z'
,
voucher_end_date
:
'2016-07-29T00:00:00Z'
,
contains_verified
:
true
,
contains_verified
:
true
});
});
beforeEach
(
function
()
{
beforeEach
(
function
()
{
...
...
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