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
740e5bac
Commit
740e5bac
authored
Sep 10, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent being able to click on disabled button in IE.
Enable display of course org, num in receipt page.
parent
5c7443be
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
26 deletions
+55
-26
common/djangoapps/course_modes/views.py
+4
-1
lms/djangoapps/shoppingcart/models.py
+12
-0
lms/djangoapps/shoppingcart/views.py
+1
-0
lms/djangoapps/verify_student/views.py
+14
-3
lms/static/js/verify_student/photocapture.js
+12
-9
lms/static/sass/elements/_controls.scss
+3
-0
lms/templates/shoppingcart/verified_cert_receipt.html
+4
-8
lms/templates/verify_student/_verification_header.html
+1
-1
lms/templates/verify_student/photo_verification.html
+4
-4
No files found.
common/djangoapps/course_modes/views.py
View file @
740e5bac
...
@@ -25,10 +25,13 @@ class ChooseModeView(View):
...
@@ -25,10 +25,13 @@ class ChooseModeView(View):
if
CourseEnrollment
.
enrollment_mode_for_user
(
request
.
user
,
course_id
)
==
'verified'
:
if
CourseEnrollment
.
enrollment_mode_for_user
(
request
.
user
,
course_id
)
==
'verified'
:
return
redirect
(
reverse
(
'dashboard'
))
return
redirect
(
reverse
(
'dashboard'
))
modes
=
CourseMode
.
modes_for_course_dict
(
course_id
)
modes
=
CourseMode
.
modes_for_course_dict
(
course_id
)
course
=
course_from_id
(
course_id
)
context
=
{
context
=
{
"course_id"
:
course_id
,
"course_id"
:
course_id
,
"modes"
:
modes
,
"modes"
:
modes
,
"course_name"
:
course_from_id
(
course_id
)
.
display_name
,
"course_name"
:
course
.
display_name_with_default
,
"course_org"
:
course
.
display_org_with_default
,
"course_num"
:
course
.
display_number_with_default
,
"chosen_price"
:
None
,
"chosen_price"
:
None
,
"error"
:
error
,
"error"
:
error
,
}
}
...
...
lms/djangoapps/shoppingcart/models.py
View file @
740e5bac
...
@@ -381,6 +381,18 @@ class CertificateItem(OrderItem):
...
@@ -381,6 +381,18 @@ class CertificateItem(OrderItem):
return
super
(
CertificateItem
,
self
)
.
single_item_receipt_template
return
super
(
CertificateItem
,
self
)
.
single_item_receipt_template
@property
@property
def
single_item_receipt_context
(
self
):
course
=
course_from_id
(
self
.
course_id
)
return
{
"course_id"
:
self
.
course_id
,
"course_name"
:
course
.
display_name_with_default
,
"course_org"
:
course
.
display_org_with_default
,
"course_num"
:
course
.
display_number_with_default
,
"course_start_date_text"
:
course
.
start_date_text
,
"course_has_started"
:
course
.
start
>
datetime
.
today
()
.
replace
(
tzinfo
=
pytz
.
utc
),
}
@property
def
additional_instruction_text
(
self
):
def
additional_instruction_text
(
self
):
return
_
(
"Note - you have up to 2 weeks into the course to unenroll from the Verified Certificate option "
return
_
(
"Note - you have up to 2 weeks into the course to unenroll from the Verified Certificate option "
"and receive a full refund. To receive your refund, contact {billing_email}. "
"and receive a full refund. To receive your refund, contact {billing_email}. "
...
...
lms/djangoapps/shoppingcart/views.py
View file @
740e5bac
...
@@ -113,5 +113,6 @@ def show_receipt(request, ordernum):
...
@@ -113,5 +113,6 @@ def show_receipt(request, ordernum):
if
order_items
.
count
()
==
1
:
if
order_items
.
count
()
==
1
:
receipt_template
=
order_items
[
0
]
.
single_item_receipt_template
receipt_template
=
order_items
[
0
]
.
single_item_receipt_template
context
.
update
(
order_items
[
0
]
.
single_item_receipt_context
)
return
render_to_response
(
receipt_template
,
context
)
return
render_to_response
(
receipt_template
,
context
)
lms/djangoapps/verify_student/views.py
View file @
740e5bac
...
@@ -55,11 +55,15 @@ class VerifyView(View):
...
@@ -55,11 +55,15 @@ class VerifyView(View):
chosen_price
=
request
.
session
[
"donation_for_course"
][
course_id
]
chosen_price
=
request
.
session
[
"donation_for_course"
][
course_id
]
else
:
else
:
chosen_price
=
verify_mode
.
min_price
chosen_price
=
verify_mode
.
min_price
course
=
course_from_id
(
course_id
)
context
=
{
context
=
{
"progress_state"
:
progress_state
,
"progress_state"
:
progress_state
,
"user_full_name"
:
request
.
user
.
profile
.
name
,
"user_full_name"
:
request
.
user
.
profile
.
name
,
"course_id"
:
course_id
,
"course_id"
:
course_id
,
"course_name"
:
course_from_id
(
course_id
)
.
display_name
,
"course_name"
:
course
.
display_name_with_default
,
"course_org"
:
course
.
display_org_with_default
,
"course_num"
:
course
.
display_number_with_default
,
"purchase_endpoint"
:
get_purchase_endpoint
(),
"purchase_endpoint"
:
get_purchase_endpoint
(),
"suggested_prices"
:
[
"suggested_prices"
:
[
decimal
.
Decimal
(
price
)
decimal
.
Decimal
(
price
)
...
@@ -91,9 +95,12 @@ class VerifiedView(View):
...
@@ -91,9 +95,12 @@ class VerifiedView(View):
else
:
else
:
chosen_price
=
verify_mode
.
min_price
.
format
(
"{:g}"
)
chosen_price
=
verify_mode
.
min_price
.
format
(
"{:g}"
)
course
=
course_from_id
(
course_id
)
context
=
{
context
=
{
"course_id"
:
course_id
,
"course_id"
:
course_id
,
"course_name"
:
course_from_id
(
course_id
)
.
display_name
,
"course_name"
:
course
.
display_name_with_default
,
"course_org"
:
course
.
display_org_with_default
,
"course_num"
:
course
.
display_number_with_default
,
"purchase_endpoint"
:
get_purchase_endpoint
(),
"purchase_endpoint"
:
get_purchase_endpoint
(),
"currency"
:
verify_mode
.
currency
.
upper
(),
"currency"
:
verify_mode
.
currency
.
upper
(),
"chosen_price"
:
chosen_price
,
"chosen_price"
:
chosen_price
,
...
@@ -150,10 +157,14 @@ def show_requirements(request, course_id):
...
@@ -150,10 +157,14 @@ def show_requirements(request, course_id):
"""
"""
if
CourseEnrollment
.
enrollment_mode_for_user
(
request
.
user
,
course_id
)
==
'verified'
:
if
CourseEnrollment
.
enrollment_mode_for_user
(
request
.
user
,
course_id
)
==
'verified'
:
return
redirect
(
reverse
(
'dashboard'
))
return
redirect
(
reverse
(
'dashboard'
))
course
=
course_from_id
(
course_id
)
context
=
{
context
=
{
"course_id"
:
course_id
,
"course_id"
:
course_id
,
"course_name"
:
course
.
display_name_with_default
,
"course_org"
:
course
.
display_org_with_default
,
"course_num"
:
course
.
display_number_with_default
,
"is_not_active"
:
not
request
.
user
.
is_active
,
"is_not_active"
:
not
request
.
user
.
is_active
,
"course_name"
:
course_from_id
(
course_id
)
.
display_name
,
}
}
return
render_to_response
(
"verify_student/show_requirements.html"
,
context
)
return
render_to_response
(
"verify_student/show_requirements.html"
,
context
)
...
...
lms/static/js/verify_student/photocapture.js
View file @
740e5bac
...
@@ -47,18 +47,20 @@ var submitToPaymentProcessing = function() {
...
@@ -47,18 +47,20 @@ var submitToPaymentProcessing = function() {
});
});
}
}
function
doResetButton
(
resetButton
,
captureButton
,
approveButton
,
nextButton
)
{
function
doResetButton
(
resetButton
,
captureButton
,
approveButton
,
nextButton
Nav
,
nextLink
)
{
approveButton
.
removeClass
(
'approved'
);
approveButton
.
removeClass
(
'approved'
);
nextButton
.
addClass
(
'disabled'
);
nextButtonNav
.
addClass
(
'is-not-ready'
);
nextLink
.
attr
(
'href'
,
"#"
);
captureButton
.
show
();
captureButton
.
show
();
resetButton
.
hide
();
resetButton
.
hide
();
approveButton
.
hide
();
approveButton
.
hide
();
}
}
function
doApproveButton
(
approveButton
,
nextButton
)
{
function
doApproveButton
(
approveButton
,
nextButtonNav
,
nextLink
)
{
nextButtonNav
.
removeClass
(
'is-not-ready'
);
approveButton
.
addClass
(
'approved'
);
approveButton
.
addClass
(
'approved'
);
next
Button
.
removeClass
(
'disabled'
);
next
Link
.
attr
(
'href'
,
"#next"
);
}
}
function
doSnapshotButton
(
captureButton
,
resetButton
,
approveButton
)
{
function
doSnapshotButton
(
captureButton
,
resetButton
,
approveButton
)
{
...
@@ -67,7 +69,6 @@ function doSnapshotButton(captureButton, resetButton, approveButton) {
...
@@ -67,7 +69,6 @@ function doSnapshotButton(captureButton, resetButton, approveButton) {
approveButton
.
show
();
approveButton
.
show
();
}
}
function
submitNameChange
(
event
)
{
function
submitNameChange
(
event
)
{
event
.
preventDefault
();
event
.
preventDefault
();
var
full_name
=
$
(
'input[name="name"]'
).
val
();
var
full_name
=
$
(
'input[name="name"]'
).
val
();
...
@@ -99,7 +100,8 @@ function initSnapshotHandler(names, hasHtml5CameraSupport) {
...
@@ -99,7 +100,8 @@ function initSnapshotHandler(names, hasHtml5CameraSupport) {
var
captureButton
=
$
(
"#"
+
name
+
"_capture_button"
);
var
captureButton
=
$
(
"#"
+
name
+
"_capture_button"
);
var
resetButton
=
$
(
"#"
+
name
+
"_reset_button"
);
var
resetButton
=
$
(
"#"
+
name
+
"_reset_button"
);
var
approveButton
=
$
(
"#"
+
name
+
"_approve_button"
);
var
approveButton
=
$
(
"#"
+
name
+
"_approve_button"
);
var
nextButton
=
$
(
"#"
+
name
+
"_next_button"
);
var
nextButtonNav
=
$
(
"#"
+
name
+
"_next_button_nav"
);
var
nextLink
=
$
(
"#"
+
name
+
"_next_link"
);
var
flashCapture
=
$
(
"#"
+
name
+
"_flash"
);
var
flashCapture
=
$
(
"#"
+
name
+
"_flash"
);
var
ctx
=
null
;
var
ctx
=
null
;
...
@@ -137,12 +139,12 @@ function initSnapshotHandler(names, hasHtml5CameraSupport) {
...
@@ -137,12 +139,12 @@ function initSnapshotHandler(names, hasHtml5CameraSupport) {
flashCapture
[
0
].
reset
();
flashCapture
[
0
].
reset
();
}
}
doResetButton
(
resetButton
,
captureButton
,
approveButton
,
nextButton
);
doResetButton
(
resetButton
,
captureButton
,
approveButton
,
nextButton
Nav
,
nextLink
);
return
false
;
return
false
;
}
}
function
approve
()
{
function
approve
()
{
doApproveButton
(
approveButton
,
nextButton
)
doApproveButton
(
approveButton
,
nextButton
Nav
,
nextLink
)
return
false
;
return
false
;
}
}
...
@@ -150,7 +152,8 @@ function initSnapshotHandler(names, hasHtml5CameraSupport) {
...
@@ -150,7 +152,8 @@ function initSnapshotHandler(names, hasHtml5CameraSupport) {
captureButton
.
show
();
captureButton
.
show
();
resetButton
.
hide
();
resetButton
.
hide
();
approveButton
.
hide
();
approveButton
.
hide
();
nextButton
.
addClass
(
'disabled'
);
nextButtonNav
.
addClass
(
'is-not-ready'
);
nextLink
.
attr
(
'href'
,
"#"
);
// Connect event handlers...
// Connect event handlers...
video
.
click
(
snapshot
);
video
.
click
(
snapshot
);
...
...
lms/static/sass/elements/_controls.scss
View file @
740e5bac
...
@@ -176,6 +176,9 @@
...
@@ -176,6 +176,9 @@
cursor
:
default
;
cursor
:
default
;
pointer-events
:
none
;
pointer-events
:
none
;
box-shadow
:
none
;
box-shadow
:
none
;
:hover
{
pointer-events
:
none
;
}
}
}
// ====================
// ====================
...
...
lms/templates/shoppingcart/verified_cert_receipt.html
View file @
740e5bac
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%!
from
student
.
views
import
course_from_id
%
>
<
%!
from
student
.
views
import
course_from_id
%
>
<
%!
from
datetime
import
datetime
%
>
<
%!
import
pytz
%
>
<
%
inherit
file=
"../main.html"
/>
<
%
inherit
file=
"../main.html"
/>
<
%
block
name=
"bodyclass"
>
register verification-process step-confirmation
</
%
block>
<
%
block
name=
"bodyclass"
>
register verification-process step-confirmation
</
%
block>
...
@@ -15,8 +13,6 @@
...
@@ -15,8 +13,6 @@
${notification}
${notification}
</section>
</section>
% endif
% endif
<
%
course_id =
order_items[0].course_id
%
>
<
%
course =
course_from_id(course_id)
%
>
<div
class=
"container"
>
<div
class=
"container"
>
<section
class=
"wrapper cart-list"
>
<section
class=
"wrapper cart-list"
>
...
@@ -25,7 +21,7 @@
...
@@ -25,7 +21,7 @@
<h2
class=
"title"
>
<h2
class=
"title"
>
<span
class=
"wrapper-sts"
>
<span
class=
"wrapper-sts"
>
<span
class=
"sts"
>
${_("You are now registered for")}
</span>
<span
class=
"sts"
>
${_("You are now registered for")}
</span>
<span
class=
"sts-course"
>
${course
.display_name}
</span>
<span
class=
"sts-course"
>
${course
_name} (${course_org}, ${course_num})
</span>
</span>
</span>
<span
class=
"sts-track"
>
<span
class=
"sts-track"
>
<span
class=
"sts-track-value"
>
<span
class=
"sts-track-value"
>
...
@@ -108,11 +104,11 @@
...
@@ -108,11 +104,11 @@
<tr>
<tr>
<td>
${item.line_desc}
</td>
<td>
${item.line_desc}
</td>
<td>
<td>
${_("Starts: {start_date}").format(start_date=course
.
start_date_text)}
${_("Starts: {start_date}").format(start_date=course
_
start_date_text)}
</td>
</td>
<td
class=
"options"
>
<td
class=
"options"
>
%if course
.start > datetime.today().replace(tzinfo=pytz.utc)
:
%if course
_has_started
:
${_("Starts: {start_date}").format(start_date=course
.
start_date_text)}
${_("Starts: {start_date}").format(start_date=course
_
start_date_text)}
%else:
%else:
<a
class=
"action action-course"
href=
"${reverse('course_root', kwargs={'course_id': item.course_id})}"
>
${_("Go to Course")}
</a>
<a
class=
"action action-course"
href=
"${reverse('course_root', kwargs={'course_id': item.course_id})}"
>
${_("Go to Course")}
</a>
%endif
%endif
...
...
lms/templates/verify_student/_verification_header.html
View file @
740e5bac
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<h2
class=
"title"
>
<h2
class=
"title"
>
<span
class=
"wrapper-sts"
>
<span
class=
"wrapper-sts"
>
<span
class=
"sts"
>
${_("You are registering for")}
</span>
<span
class=
"sts"
>
${_("You are registering for")}
</span>
<span
class=
"sts-course"
>
${course_name}
</span>
<span
class=
"sts-course"
>
${course_name}
(${course_org}, ${course_num})
</span>
</span>
</span>
<span
class=
"sts-track"
>
<span
class=
"sts-track"
>
<span
class=
"sts-track-value"
>
<span
class=
"sts-track-value"
>
...
...
lms/templates/verify_student/photo_verification.html
View file @
740e5bac
...
@@ -141,12 +141,12 @@
...
@@ -141,12 +141,12 @@
</div>
</div>
</div>
</div>
<nav
class=
"nav-wizard"
>
<!-- FIXME: Additional class is-ready, is-not-ready --
>
<nav
class=
"nav-wizard"
id=
"face_next_button_nav"
>
<span
class=
"help help-inline"
>
${_("Once you verify your photo looks good, you can move on to step 2.")}
</span>
<span
class=
"help help-inline"
>
${_("Once you verify your photo looks good, you can move on to step 2.")}
</span>
<ol
class=
"wizard-steps"
>
<ol
class=
"wizard-steps"
>
<li
class=
"wizard-step"
>
<li
class=
"wizard-step"
>
<a
class=
"next action-primary"
id=
"face_next_button
"
href=
"#next"
aria-hidden=
"true"
title=
"Next"
>
${_("Go to Step 2: Take ID Photo")}
</a>
<a
id=
"face_next_link"
class=
"next action-primary
"
href=
"#next"
aria-hidden=
"true"
title=
"Next"
>
${_("Go to Step 2: Take ID Photo")}
</a>
</li>
</li>
</ol>
</ol>
</nav>
</nav>
...
@@ -228,12 +228,12 @@
...
@@ -228,12 +228,12 @@
</div>
</div>
</div>
</div>
<nav
class=
"nav-wizard"
>
<nav
class=
"nav-wizard"
id=
"photo_id_next_button_nav"
>
<span
class=
"help help-inline"
>
${_("Once you verify your ID photo looks good, you can move on to step 3.")}
</span>
<span
class=
"help help-inline"
>
${_("Once you verify your ID photo looks good, you can move on to step 3.")}
</span>
<ol
class=
"wizard-steps"
>
<ol
class=
"wizard-steps"
>
<li
class=
"wizard-step"
>
<li
class=
"wizard-step"
>
<a
class=
"next action-primary"
id=
"photo_id_next_button
"
href=
"#next"
aria-hidden=
"true"
title=
"Next"
>
${_("Go to Step 3: Review Your Info")}
</a>
<a
id=
"photo_id_next_link"
class=
"next action-primary
"
href=
"#next"
aria-hidden=
"true"
title=
"Next"
>
${_("Go to Step 3: Review Your Info")}
</a>
</li>
</li>
</ol>
</ol>
</nav>
</nav>
...
...
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