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
086e15c9
Commit
086e15c9
authored
Aug 22, 2017
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update event naming for course sock.
Only show course sock to English readers.
parent
dc576c6c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
11 deletions
+16
-11
lms/static/js/courseware/course_home_events.js
+2
-2
lms/static/js/dashboard/legacy.js
+1
-1
lms/static/js/spec/courseware/course_home_events_spec.js
+2
-2
openedx/features/course_experience/static/course_experience/js/CourseSock.js
+5
-5
openedx/features/course_experience/views/course_sock.py
+6
-1
No files found.
lms/static/js/courseware/course_home_events.js
View file @
086e15c9
...
...
@@ -9,10 +9,10 @@
});
});
$
(
'.date-summary-verified-upgrade-deadline .date-summary-link'
).
on
(
'click'
,
function
()
{
Logger
.
log
(
'edx.course.
home.upgrade_verified
.clicked'
,
{
location
:
'sidebar'
});
Logger
.
log
(
'edx.course.
enrollment.upgrade
.clicked'
,
{
location
:
'sidebar'
});
});
$
(
'.upgrade-banner-button'
).
on
(
'click'
,
function
()
{
Logger
.
log
(
'edx.course.
home.upgrade_verified
.clicked'
,
{
location
:
'notification'
});
Logger
.
log
(
'edx.course.
enrollment.upgrade
.clicked'
,
{
location
:
'notification'
});
});
$
(
'.view-verified-info'
).
on
(
'click'
,
function
()
{
Logger
.
log
(
'edx.course.home.learn_about_verified.clicked'
,
{
location
:
'notification'
});
...
...
lms/static/js/dashboard/legacy.js
View file @
086e15c9
...
...
@@ -120,7 +120,7 @@
var
user
=
$
(
event
.
target
).
closest
(
'.action-upgrade'
).
data
(
'user'
),
course
=
$
(
event
.
target
).
closest
(
'.action-upgrade'
).
data
(
'course-id'
);
Logger
.
log
(
'edx.course.enrollment.upgrade.clicked'
,
[
user
,
course
],
null
);
Logger
.
log
(
'edx.course.enrollment.upgrade.clicked'
,
[
user
,
course
],
{
location
:
'learner_dashboard'
}
);
});
$
(
'.action-email-settings'
).
click
(
function
(
event
)
{
...
...
lms/static/js/spec/courseware/course_home_events_spec.js
View file @
086e15c9
...
...
@@ -19,13 +19,13 @@ define(['jquery', 'logger', 'js/courseware/course_home_events'], function($, Log
it
(
'sends an event when "Upgrade to Verified" is clicked from the sidebar'
,
function
()
{
$
(
'.date-summary-link'
).
click
();
expect
(
Logger
.
log
).
toHaveBeenCalledWith
(
'edx.course.
home.upgrade_verified
.clicked'
,
{
location
:
'sidebar'
});
expect
(
Logger
.
log
).
toHaveBeenCalledWith
(
'edx.course.
enrollment.upgrade
.clicked'
,
{
location
:
'sidebar'
});
});
it
(
'sends an event when "Upgrade Now" is clicked from the upsell notification'
,
function
()
{
$
(
'.upgrade-banner-button'
).
click
();
expect
(
Logger
.
log
).
toHaveBeenCalledWith
(
'edx.course.
home.upgrade_verified
.clicked'
,
{
location
:
'notification'
}
'edx.course.
enrollment.upgrade
.clicked'
,
{
location
:
'notification'
}
);
});
...
...
openedx/features/course_experience/static/course_experience/js/CourseSock.js
View file @
086e15c9
...
...
@@ -57,9 +57,9 @@ export class CourseSock { // eslint-disable-line import/prefer-default-export
// Log open and close events
const
isOpening
=
$toggleActionButton
.
hasClass
(
'active'
);
const
logMessage
=
isOpening
?
'
User opened the verification sock.
'
:
'
User closed the verification sock.
'
;
Logger
.
log
(
const
logMessage
=
isOpening
?
'
edx.bi.course.sock.toggle_opened
'
:
'
edx.bi.course.sock.toggle_closed
'
;
window
.
analytics
.
track
(
logMessage
,
{
from_page
:
pageLocation
,
...
...
@@ -69,9 +69,9 @@ export class CourseSock { // eslint-disable-line import/prefer-default-export
$upgradeToVerifiedButton
.
on
(
'click'
,
()
=>
{
Logger
.
log
(
'
User clicked the upgrade button in the verification sock.
'
,
'
edx.course.enrollment.upgrade.clicked
'
,
{
from_page
:
pageLocation
,
location
:
'sock'
,
},
);
});
...
...
openedx/features/course_experience/views/course_sock.py
View file @
086e15c9
...
...
@@ -2,6 +2,7 @@
Fragment for rendering the course's sock and associated toggle button.
"""
from
django.template.loader
import
render_to_string
from
django.utils.translation
import
get_language
from
opaque_keys.edx.keys
import
CourseKey
from
web_fragments.fragment
import
Fragment
...
...
@@ -37,7 +38,11 @@ class CourseSockFragmentView(EdxFragmentView):
verification_deadline
=
VerifiedUpgradeDeadlineDate
(
course
,
request
.
user
)
deadline_has_passed
=
verification_deadline
.
deadline_has_passed
()
show_course_sock
=
has_verified_mode
and
not
is_already_verified
and
not
deadline_has_passed
# If this proves its worth, we can internationalize and display for more than English speakers.
show_course_sock
=
(
has_verified_mode
and
not
is_already_verified
and
not
deadline_has_passed
and
get_language
()
==
'en'
)
# Get the price of the course and format correctly
course_price
=
get_cosmetic_verified_display_price
(
course
)
...
...
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