Commit d4b99561 by srpearce

Merge pull request #8326 from edx/sylvia/docs/SOL_ECOM

Sylvia/docs/sol ecom
parents 44dfecf7 ceb0fc79
...@@ -2115,7 +2115,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2115,7 +2115,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
# check that the coupon redeem count should be 0 # check that the coupon redeem count should be 0
resp = self.client.get(instructor_dashboard) resp = self.client.get(instructor_dashboard)
self.assertEqual(resp.status_code, 200) self.assertEqual(resp.status_code, 200)
self.assertIn('Redeem Count', resp.content) self.assertIn('Number Redeemed', resp.content)
self.assertIn('<td>0</td>', resp.content) self.assertIn('<td>0</td>', resp.content)
# now make the payment of your cart items # now make the payment of your cart items
...@@ -2125,7 +2125,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2125,7 +2125,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
resp = self.client.get(instructor_dashboard) resp = self.client.get(instructor_dashboard)
self.assertEqual(resp.status_code, 200) self.assertEqual(resp.status_code, 200)
self.assertIn('Redeem Count', resp.content) self.assertIn('Number Redeemed', resp.content)
self.assertIn('<td>1</td>', resp.content) self.assertIn('<td>1</td>', resp.content)
def test_get_sale_records_features_csv(self): def test_get_sale_records_features_csv(self):
......
...@@ -46,7 +46,7 @@ class TestECommerceDashboardViews(ModuleStoreTestCase): ...@@ -46,7 +46,7 @@ class TestECommerceDashboardViews(ModuleStoreTestCase):
response = self.client.get(self.url) response = self.client.get(self.url)
self.assertTrue(self.e_commerce_link in response.content) self.assertTrue(self.e_commerce_link in response.content)
# Coupons should show up for White Label sites with priced honor modes. # Coupons should show up for White Label sites with priced honor modes.
self.assertTrue('Coupons' in response.content) self.assertTrue('Coupon Code List' in response.content)
def test_user_has_finance_admin_rights_in_e_commerce_tab(self): def test_user_has_finance_admin_rights_in_e_commerce_tab(self):
response = self.client.get(self.url) response = self.client.get(self.url)
...@@ -77,7 +77,7 @@ class TestECommerceDashboardViews(ModuleStoreTestCase): ...@@ -77,7 +77,7 @@ class TestECommerceDashboardViews(ModuleStoreTestCase):
course_honor_mode = CourseMode.mode_for_course(self.course.id, 'honor') course_honor_mode = CourseMode.mode_for_course(self.course.id, 'honor')
price = course_honor_mode.min_price price = course_honor_mode.min_price
self.assertTrue('Course Price: <span>$' + str(price) + '</span>' in response.content) self.assertTrue('Course price per seat: <span>$' + str(price) + '</span>' in response.content)
self.assertFalse('+ Set Price</a></span>' in response.content) self.assertFalse('+ Set Price</a></span>' in response.content)
# removing the course finance_admin role of login user # removing the course finance_admin role of login user
...@@ -109,7 +109,7 @@ class TestECommerceDashboardViews(ModuleStoreTestCase): ...@@ -109,7 +109,7 @@ class TestECommerceDashboardViews(ModuleStoreTestCase):
url = reverse('instructor_dashboard', kwargs={'course_id': self.course.id.to_deprecated_string()}) url = reverse('instructor_dashboard', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url) response = self.client.get(url)
self.assertTrue('Course Price: <span>$' + str(price) + '</span>' in response.content) self.assertTrue('Course price per seat: <span>$' + str(price) + '</span>' in response.content)
def test_user_admin_set_course_price(self): def test_user_admin_set_course_price(self):
""" """
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
${_("Thank you for your purchase of {course_name}!").format(course_name=course.display_name)} ${_("Thank you for purchasing enrollments in {course_name}.").format(course_name=course.display_name)}
${_("An invoice for {currency_symbol}{total_price} is attached. Payment is due immediately. Information on payment methods can be found on the invoice.").format(currency_symbol=currency_symbol, total_price=sale_price)} ${_("An invoice for {currency_symbol}{total_price} is attached. Payment is due upon receipt. You can find information about payment methods on the invoice.").format(currency_symbol=currency_symbol, total_price=sale_price)}
${_("A CSV file of your registration codes is attached. Please distribute registration codes to each student planning to enroll using the email template below.")} ${_("A .csv file that lists your enrollment codes is attached. You can use the email template below to distribute enrollment codes to your students. Each student must use a separate enrollment code.")}
## Translators: This is the signature of an email. "\n" is a newline character ## Translators: This is the signature of an email. "\n" is a newline character
## and should be placed between the closing word and the signature. ## and should be placed between the closing word and the signature.
......
...@@ -7,7 +7,7 @@ ${corp_address} ...@@ -7,7 +7,7 @@ ${corp_address}
${_("Date: {date}").format(date=date)} ${_("Date: {date}").format(date=date)}
${_("Invoice No: {invoice_number}").format(invoice_number=invoice.id)} ${_("Invoice No: {invoice_number}").format(invoice_number=invoice.id)}
${_("Terms: Due Immediately")} ${_("Terms: Due Upon Receipt")}
${_("Due Date: {date}").format(date=date)} ${_("Due Date: {date}").format(date=date)}
${_("Bill to:")} ${_("Bill to:")}
...@@ -33,10 +33,10 @@ ${_("Total: {currency_symbol}{sale_price}").format(sale_price=sale_price, c ...@@ -33,10 +33,10 @@ ${_("Total: {currency_symbol}{sale_price}").format(sale_price=sale_price, c
——————————————————————————————————————————— ———————————————————————————————————————————
${_("Payment instructions")} ${_("Payment Instructions")}
${payment_instructions} ${payment_instructions}
${_("Failure to pay this invoice will result the invalidation of student enrollment that use these codes. All purchases are final. Please refer to the cancellation policy on {site_name} for more information.").format(site_name=site_name)} ${_("If we do not receive payment, the learner enrollments that use these codes will be canceled and learners will not be able to access course materials. All purchases are final. For more information, see the {site_name} cancellation policy.").format(site_name=site_name)}
${_("If you have payment questions, please contact {contact_email}").format(contact_email=contact_email)} ${_("For payment questions, contact {contact_email}").format(contact_email=contact_email)}
...@@ -3,7 +3,7 @@ from django.utils.translation import ugettext as _ ...@@ -3,7 +3,7 @@ from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
%> %>
<%page args="section_data"/> <%page args="section_data"/>
<section id="add-coupon-modal" class="modal" role="dialog" tabindex="-1" aria-label="${_('Add Coupon')}"> <section id="add-coupon-modal" class="modal" role="dialog" tabindex="-1" aria-label="${_('Add Coupon Code')}">
<div class="inner-wrapper"> <div class="inner-wrapper">
<button class="close-modal"> <button class="close-modal">
<i class="icon fa fa-remove"></i> <i class="icon fa fa-remove"></i>
...@@ -15,12 +15,12 @@ from django.core.urlresolvers import reverse ...@@ -15,12 +15,12 @@ from django.core.urlresolvers import reverse
<div id="coupon-content"> <div id="coupon-content">
<header> <header>
<h2>${_("Add Coupon")}</h2> <h2>${_("Add Coupon Code")}</h2>
</header> </header>
<div class="instructions"> <div class="instructions">
<p> <p>
${_("Please enter Coupon detail below")}</p> ${_("Enter information about the coupon code below.")}</p>
</div> </div>
<form id="add_coupon_form"> <form id="add_coupon_form">
...@@ -30,12 +30,12 @@ from django.core.urlresolvers import reverse ...@@ -30,12 +30,12 @@ from django.core.urlresolvers import reverse
<ol class="list-input"> <ol class="list-input">
<li class="field required text" id="add-coupon-modal-field-code"> <li class="field required text" id="add-coupon-modal-field-code">
<label for="coupon_code" class="required">${_("Code")}</label> <label for="coupon_code" class="required">${_("Coupon Code")}</label>
<input class="" id="coupon_code" type="text" name="code" maxlength="16" value="" placeholder="example: A123DS" <input class="" id="coupon_code" type="text" name="code" maxlength="16" value="" placeholder="example: A123DS"
aria-required="true"/> aria-required="true"/>
</li> </li>
<li class="field required text" id="add-coupon-modal-field-discount"> <li class="field required text" id="add-coupon-modal-field-discount">
<label for="coupon_discount" class="required text">${_("Percentage Discount")}</label> <label for="coupon_discount" class="required text">${_("Discount Percentage")}</label>
<input class="field required" id="coupon_discount" type="text" name="discount" value="" maxlength="3" <input class="field required" id="coupon_discount" type="text" name="discount" value="" maxlength="3"
aria-required="true"/> aria-required="true"/>
</li> </li>
...@@ -62,7 +62,7 @@ from django.core.urlresolvers import reverse ...@@ -62,7 +62,7 @@ from django.core.urlresolvers import reverse
</fieldset> </fieldset>
<div class="submit"> <div class="submit">
<input name="submit" type="button" id="add_coupon_button" value="${_('Add Coupon')}"/> <input name="submit" type="button" id="add_coupon_button" value="${_('Add Coupon Code')}"/>
</div> </div>
</form> </form>
</div> </div>
......
...@@ -24,7 +24,7 @@ import pytz ...@@ -24,7 +24,7 @@ import pytz
<a id="query_registration_code_link" href="#invalidate_registration_code_modal" rel="leanModal" class="add blue-button">${_('Change Enrollment Code Status')}</a> <a id="query_registration_code_link" href="#invalidate_registration_code_modal" rel="leanModal" class="add blue-button">${_('Change Enrollment Code Status')}</a>
</span> </span>
%endif %endif
<p>${_('Download a .csv file of all enrollment codes for this course')}</p> <p>${_('Download a .csv file of all enrollment codes for this course.')}</p>
<p> <p>
<form action="${ section_data['get_registration_code_csv_url'] }" id="download_registration_codes" method="post"> <form action="${ section_data['get_registration_code_csv_url'] }" id="download_registration_codes" method="post">
<input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }"> <input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }">
...@@ -32,7 +32,7 @@ import pytz ...@@ -32,7 +32,7 @@ import pytz
<input type="submit" name="list-registration-codes-csv" value="${_("Download All Enrollment Codes")}" data-csv="true"> <input type="submit" name="list-registration-codes-csv" value="${_("Download All Enrollment Codes")}" data-csv="true">
</form> </form>
</p> </p>
<p>${_('Download a .csv file of all unused enrollment codes for this course')}</p> <p>${_('Download a .csv file of all unused enrollment codes for this course.')}</p>
<p> <p>
<form action="${ section_data['active_registration_code_csv_url'] }" id="active_registration_codes" method="post"> <form action="${ section_data['active_registration_code_csv_url'] }" id="active_registration_codes" method="post">
<input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }"> <input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }">
...@@ -40,7 +40,7 @@ import pytz ...@@ -40,7 +40,7 @@ import pytz
<input type="submit" name="active-registration-codes-csv" value="${_("Download Unused Enrollment Codes")}" data-csv="true"> <input type="submit" name="active-registration-codes-csv" value="${_("Download Unused Enrollment Codes")}" data-csv="true">
</form> </form>
</p> </p>
<p>${_('Download a .csv file of all used enrollment codes for this course')}</p> <p>${_('Download a .csv file of all used enrollment codes for this course.')}</p>
<p> <p>
<form action="${ section_data['spent_registration_code_csv_url'] }" id="spent_registration_codes" method="post"> <form action="${ section_data['spent_registration_code_csv_url'] }" id="spent_registration_codes" method="post">
<input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }"> <input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }">
...@@ -56,9 +56,9 @@ import pytz ...@@ -56,9 +56,9 @@ import pytz
<div class="wrap"> <div class="wrap">
<h2>${_("Course Price")}</h2> <h2>${_("Course Price")}</h2>
<div> <div>
<span class="tip">${_("Course Price: ")}<span>${section_data['currency_symbol']}${section_data['course_price']}</span> <span class="tip">${_("Course price per seat: ")}<span>${section_data['currency_symbol']}${section_data['course_price']}</span>
%if section_data['access']['finance_admin'] is True: %if section_data['access']['finance_admin'] is True:
<a id="course_price_link" href="#set-course-mode-price-modal" rel="leanModal" class="add blue-button">+ ${_('Set Price')}</a> <a id="course_price_link" href="#set-course-mode-price-modal" rel="leanModal" class="add blue-button">+ ${_('Edit Price')}</a>
%endif %endif
</span> </span>
</div> </div>
...@@ -74,7 +74,7 @@ import pytz ...@@ -74,7 +74,7 @@ import pytz
%endif %endif
<span class="csv_tip"> <span class="csv_tip">
<div> <div>
<p>${_("Download a .csv file for all credit card purchases or for all invoices, regardless of status")}</p> <p>${_("Download a .csv file for all credit card purchases or for all invoices, regardless of status.")}</p>
<input type="button" class="add blue-button" name="list-sale-csv" value="${_("Download All Invoices")}" data-endpoint="${ section_data['get_sale_records_url'] }" data-csv="true"> <input type="button" class="add blue-button" name="list-sale-csv" value="${_("Download All Invoices")}" data-endpoint="${ section_data['get_sale_records_url'] }" data-csv="true">
<input type="button" class="add blue-button" name="list-order-sale-csv" value="${_("Download All Credit Card Purchases")}" data-endpoint="${ section_data['get_sale_order_records_url'] }" data-csv="true"> <input type="button" class="add blue-button" name="list-order-sale-csv" value="${_("Download All Credit Card Purchases")}" data-endpoint="${ section_data['get_sale_order_records_url'] }" data-csv="true">
</div> </div>
...@@ -96,7 +96,7 @@ import pytz ...@@ -96,7 +96,7 @@ import pytz
<div> <div>
<span class="csv_tip"> <span class="csv_tip">
<div> <div>
<p>${_("Download a .csv file for all credit card purchases or for all invoices, regardless of status")}</p> <p>${_("Download a .csv file for all credit card purchases or for all invoices, regardless of status.")}</p>
<input type="button" class="add blue-button" name="user-enrollment-report" value="${_("Download Enrollment Report")}" data-endpoint="${ section_data['enrollment_report_url'] }"> <input type="button" class="add blue-button" name="user-enrollment-report" value="${_("Download Enrollment Report")}" data-endpoint="${ section_data['enrollment_report_url'] }">
</div> </div>
<div class="request-response msg msg-confirm copy" id="report-request-response"></div> <div class="request-response msg msg-confirm copy" id="report-request-response"></div>
...@@ -104,11 +104,11 @@ import pytz ...@@ -104,11 +104,11 @@ import pytz
<br> <br>
</span> </span>
<div class="reports-download-container action-type-container"> <div class="reports-download-container action-type-container">
<p><b>${_("Reports Available for Download")}</b></p> <p><b>${_("Available Reports")}</b></p>
<p>${_("The reports listed below are available for download. A link to every report remains available on this page, identified by the UTC date and time of generation. Reports are not deleted, so you will always be able to access previously generated reports from this page.")}</p> <p>${_("The following reports are available for download. Reports are not deleted. A link to every report remains available on this page, identified by the date and time (in UTC) that the report was generated.")}</p>
## Translators: a table of URL links to report files appears after this sentence. ## Translators: a table of URL links to report files appears after this sentence.
<p>${_("<b>Note</b>: To keep student data secure, you cannot save or email these links for direct access. Copies of links expire within 5 minutes.")}</p><br> <p>${_("<b>Note</b>: To help protect learner data, links to these reports that you save outside of this page or that you send or receive in email expire after five minutes.")}</p><br>
<div class="report-downloads-table" id="report-downloads-table" <div class="report-downloads-table" id="report-downloads-table"
data-endpoint="${ section_data['list_financial_report_downloads_url'] }"></div> data-endpoint="${ section_data['list_financial_report_downloads_url'] }"></div>
...@@ -131,26 +131,26 @@ import pytz ...@@ -131,26 +131,26 @@ import pytz
%endif %endif
%if section_data['coupons_enabled']: %if section_data['coupons_enabled']:
<div class="wrap"> <div class="wrap">
<h2>${_("Coupons List")}</h2> <h2>${_("Coupon Code List")}</h2>
<div> <div>
<span class="csv_tip">${_("Click to generate a CSV file of all Coupon Codes:")} <span class="csv_tip">${_("Download a .csv file of all coupon codes for this course.")}
<input class="add blue-button" type="button" name="download-coupon-codes-csv" value="${_("Download coupon codes")}" data-endpoint="${ section_data['download_coupon_codes_url'] }" data-csv="true"> <input class="add blue-button" type="button" name="download-coupon-codes-csv" value="${_("Download Coupon Codes")}" data-endpoint="${ section_data['download_coupon_codes_url'] }" data-csv="true">
</span> </span>
<span class="tip">${_("Coupons Information")} <a id="add_coupon_link" href="#add-coupon-modal" rel="leanModal" <span class="tip">${_("Coupon Codes")} <a id="add_coupon_link" href="#add-coupon-modal" rel="leanModal"
class="add blue-button">+ ${_("Add Coupon")}</a></span> class="add blue-button">+ ${_("Add Coupon Code")}</a></span>
<div class="wrapper-content wrapper"> <div class="wrapper-content wrapper">
<section class="content"> <section class="content">
%if len(section_data['coupons']): %if len(section_data['coupons']):
<table class="coupons-table"> <table class="coupons-table">
<thead> <thead>
<tr class="coupons-headings"> <tr class="coupons-headings">
<th class="c_code">${_("Code")}</th> <th class="c_code">${_("Coupon Code")}</th>
<th class="c_dsc">${_("Description")}</th> <th class="c_dsc">${_("Description")}</th>
<th class="c_expiry">${_("Expiry Date")}</th> <th class="c_expiry">${_("Expiration Date")}</th>
<th class="c_discount">${_("Discount (%)")}</th> <th class="c_discount">${_("Coupon (%)")}</th>
<th class="c_count">${_("Redeem Count")}</th> <th class="c_count">${_("Number Redeemed")}</th>
<th class="c_action">${_("Actions")}</th> <th class="c_action">${_("Actions")}</th>
</tr> </tr>
</thead> </thead>
...@@ -246,7 +246,7 @@ import pytz ...@@ -246,7 +246,7 @@ import pytz
} }
if($('#invoice_number').val() == "") { if($('#invoice_number').val() == "") {
$('#error-msg').attr('class','error-msgs') $('#error-msg').attr('class','error-msgs')
$('#error-msg').html("${_('Invoice number should not be empty.')}").show(); $('#error-msg').html("${_('The Invoice Number field cannot be empty.')}").show();
return return
} }
$.ajax({ $.ajax({
...@@ -290,7 +290,7 @@ import pytz ...@@ -290,7 +290,7 @@ import pytz
$('input#edit_coupon_expiration_date').val(data.expiry_date); $('input#edit_coupon_expiration_date').val(data.expiry_date);
} }
else { else {
$('input#edit_coupon_expiration_date').val("${_('Never Expires')}"); $('input#edit_coupon_expiration_date').val("${_('No Expiration Date')}");
} }
$('#edit-modal-trigger').click(); $('#edit-modal-trigger').click();
}, },
...@@ -350,91 +350,91 @@ import pytz ...@@ -350,91 +350,91 @@ import pytz
if (company_name == '') { if (company_name == '') {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the company name')}"); registration_code_error.text("${_('Enter the company name.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (($.isNumeric(company_name))) { if (($.isNumeric(company_name))) {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the non-numeric value for company name')}"); registration_code_error.text("${_('The company name cannot be a number.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (company_contact_name == '') { if (company_contact_name == '') {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the company contact name')}"); registration_code_error.text("${_('Enter the company contact name.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (($.isNumeric(company_contact_name))) { if (($.isNumeric(company_contact_name))) {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the non-numeric value for company contact name')}"); registration_code_error.text("${_('The company contact name cannot be a number.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (company_contact_email == '') { if (company_contact_email == '') {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the company contact email')}"); registration_code_error.text("${_('Enter the email address for the company contact.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (!(validateEmail(company_contact_email))) { if (!(validateEmail(company_contact_email))) {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the valid email address')}"); registration_code_error.text("${_('Enter a valid email address.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (recipient_name == '') { if (recipient_name == '') {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the recipient name')}"); registration_code_error.text("${_('Enter the recipient name.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (($.isNumeric(recipient_name))) { if (($.isNumeric(recipient_name))) {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the non-numeric value for recipient name')}"); registration_code_error.text("${_('The recipient name cannot be a number.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (recipient_email == '') { if (recipient_email == '') {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the recipient email')}"); registration_code_error.text("${_('Enter the recipient email address.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (!(validateEmail(recipient_email))) { if (!(validateEmail(recipient_email))) {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the valid email address')}"); registration_code_error.text("${_('Enter a valid email address.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (address_line == '') { if (address_line == '') {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the billing address')}"); registration_code_error.text("${_('Enter the billing address.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
if (unit_price == '') { if (unit_price == '') {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the unit price')}"); registration_code_error.text("${_('Enter the price per course seat.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false return false
} }
if (!($.isNumeric(unit_price))) { if (!($.isNumeric(unit_price))) {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the numeric value for unit price')}"); registration_code_error.text("${_('Enter a numeric value for the price per course seat. Do not include currency symbols.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false return false
} }
if (total_registration_codes == '') { if (total_registration_codes == '') {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the number of enrollment codes')}"); registration_code_error.text("${_('Enter the number of enrollment codes.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false return false
} }
if (!($.isNumeric(total_registration_codes))) { if (!($.isNumeric(total_registration_codes))) {
registration_code_error.attr('style', 'display: block !important'); registration_code_error.attr('style', 'display: block !important');
registration_code_error.text("${_('Please enter the numeric value for number of enrollment codes')}"); registration_code_error.text("${_('Enter a numeric value for the number of enrollment codes.')}");
generate_registration_button.removeAttr('disabled'); generate_registration_button.removeAttr('disabled');
return false; return false;
} }
...@@ -489,19 +489,19 @@ import pytz ...@@ -489,19 +489,19 @@ import pytz
// Check if empty of not // Check if empty of not
if (course_price === '') { if (course_price === '') {
$('#set_price_form #course_form_error').attr('style', 'display: block !important'); $('#set_price_form #course_form_error').attr('style', 'display: block !important');
$('#set_price_form #course_form_error').text("${_('Please enter the course price')}"); $('#set_price_form #course_form_error').text("${_('Enter the price per course seat.')}");
$("#set_course_button").removeAttr('disabled'); $("#set_course_button").removeAttr('disabled');
return false; return false;
} }
if (!$.isNumeric(course_price)) { if (!$.isNumeric(course_price)) {
$("#set_course_button").removeAttr('disabled'); $("#set_course_button").removeAttr('disabled');
$('#set_price_form #course_form_error').attr('style', 'display: block !important'); $('#set_price_form #course_form_error').attr('style', 'display: block !important');
$('#set_price_form #course_form_error').text("${_('Please enter the numeric value for course price')}"); $('#set_price_form #course_form_error').text("${_('Enter a numeric value for the price per course seat. Do not include currency symbols.')}");
return false; return false;
} }
if (currency == '') { if (currency == '') {
$('#set_price_form #course_form_error').attr('style', 'display: block !important'); $('#set_price_form #course_form_error').attr('style', 'display: block !important');
$('#set_price_form #course_form_error').text("${_('Please select the currency')}"); $('#set_price_form #course_form_error').text("${_('Select a currency.')}");
$("#set_course_button").removeAttr('disabled'); $("#set_course_button").removeAttr('disabled');
return false; return false;
} }
...@@ -536,19 +536,19 @@ import pytz ...@@ -536,19 +536,19 @@ import pytz
if (code === '') { if (code === '') {
$("#add_coupon_button").removeAttr('disabled'); $("#add_coupon_button").removeAttr('disabled');
$('#add_coupon_form #coupon_form_error').attr('style', 'display: block !important'); $('#add_coupon_form #coupon_form_error').attr('style', 'display: block !important');
$('#add_coupon_form #coupon_form_error').text("${_('Please enter the coupon code')}"); $('#add_coupon_form #coupon_form_error').text("${_('Enter a coupon code.')}");
return false; return false;
} }
if (parseInt(coupon_discount) > 100) { if (parseInt(coupon_discount) > 100) {
$('#add_coupon_form #coupon_form_error').attr('style', 'display: block !important'); $('#add_coupon_form #coupon_form_error').attr('style', 'display: block !important');
$('#add_coupon_form #coupon_form_error').text("${_('Please enter the coupon discount value less than or equal to 100')}"); $('#add_coupon_form #coupon_form_error').text("${_('The discount percentage must be less than or equal to 100.')}");
$("#add_coupon_button").removeAttr('disabled'); $("#add_coupon_button").removeAttr('disabled');
return false; return false;
} }
if (!$.isNumeric(coupon_discount)) { if (!$.isNumeric(coupon_discount)) {
$("#add_coupon_button").removeAttr('disabled'); $("#add_coupon_button").removeAttr('disabled');
$('#add_coupon_form #coupon_form_error').attr('style', 'display: block !important'); $('#add_coupon_form #coupon_form_error').attr('style', 'display: block !important');
$('#add_coupon_form #coupon_form_error').text("${_('Please enter the numeric value for discount')}"); $('#add_coupon_form #coupon_form_error').text("${_('Enter a numeric value for the discount amount. Do not include the percent sign.')}");
return false; return false;
} }
$.ajax({ $.ajax({
......
...@@ -3,7 +3,7 @@ from django.utils.translation import ugettext as _ ...@@ -3,7 +3,7 @@ from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
%> %>
<%page args="section_data"/> <%page args="section_data"/>
<section id="edit-coupon-modal" class="modal" role="dialog" tabindex="-1" aria-label="${_('Edit Coupon')}"> <section id="edit-coupon-modal" class="modal" role="dialog" tabindex="-1" aria-label="${_('Edit Coupon Code')}">
<div class="inner-wrapper"> <div class="inner-wrapper">
<button class="close-modal"> <button class="close-modal">
<i class="icon fa fa-remove"></i> <i class="icon fa fa-remove"></i>
...@@ -15,12 +15,12 @@ from django.core.urlresolvers import reverse ...@@ -15,12 +15,12 @@ from django.core.urlresolvers import reverse
<div id="coupon-content"> <div id="coupon-content">
<header> <header>
<h2>${_("Update Coupon")}</h2> <h2>${_("Edit Coupon Code")}</h2>
</header> </header>
<div class="instructions"> <div class="instructions">
<p> <p>
${_("Update Coupon Information")}</p> ${_("Edit Coupon Code Information")}</p>
</div> </div>
<form id="edit_coupon_form" action="${section_data['ajax_update_coupon']}" method="post" data-remote="true"> <form id="edit_coupon_form" action="${section_data['ajax_update_coupon']}" method="post" data-remote="true">
...@@ -62,7 +62,7 @@ from django.core.urlresolvers import reverse ...@@ -62,7 +62,7 @@ from django.core.urlresolvers import reverse
<div class="submit"> <div class="submit">
<input type="hidden" name="coupon_id" id="coupon_id"/> <input type="hidden" name="coupon_id" id="coupon_id"/>
<input name="submit" type="button" id="update_coupon_button" value="${_('Update Coupon')}"/> <input name="submit" type="button" id="update_coupon_button" value="${_('Update Coupon Code')}"/>
</div> </div>
</form> </form>
</div> </div>
......
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