Commit 740e5bac by David Ormsbee

Prevent being able to click on disabled button in IE.

Enable display of course org, num in receipt page.
parent 5c7443be
...@@ -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,
} }
......
...@@ -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}. "
......
...@@ -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)
...@@ -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)
......
...@@ -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, nextButtonNav, 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');
nextButton.removeClass('disabled'); nextLink.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();
...@@ -84,7 +85,7 @@ function submitNameChange(event) { ...@@ -84,7 +85,7 @@ function submitNameChange(event) {
.fail(function(jqXhr,text_status, error_thrown) { .fail(function(jqXhr,text_status, error_thrown) {
$('.message-copy').html(jqXhr.responseText); $('.message-copy').html(jqXhr.responseText);
}); });
} }
function initSnapshotHandler(names, hasHtml5CameraSupport) { function initSnapshotHandler(names, hasHtml5CameraSupport) {
...@@ -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, nextButtonNav, nextLink);
return false; return false;
} }
function approve() { function approve() {
doApproveButton(approveButton, nextButton) doApproveButton(approveButton, nextButtonNav, 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);
......
...@@ -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;
}
} }
// ==================== // ====================
......
<%! 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
......
...@@ -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">
......
...@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment