Merge pull request #1841 from MITx/fix/btalbot/loginregister-actions
Fix/btalbot/loginregister actions
This commit is contained in:
@@ -391,7 +391,7 @@
|
|||||||
button[type="submit"] {
|
button[type="submit"] {
|
||||||
@extend .button-primary;
|
@extend .button-primary;
|
||||||
|
|
||||||
&:disabled {
|
&:disabled, &.is-disabled {
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
cursor: default !important;
|
cursor: default !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<%block name="js_extra">
|
<%block name="js_extra">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
var view_name = 'view-login';
|
var view_name = 'view-login';
|
||||||
|
|
||||||
// adding js class for styling with accessibility in mind
|
// adding js class for styling with accessibility in mind
|
||||||
@@ -30,8 +30,10 @@
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
$(document).delegate('#login-form', 'ajax:success', function(data, json, xhr) {
|
$(document).delegate('#login-form', 'ajax:success', function(data, json, xhr) {
|
||||||
|
$(this).find('.form-actions #submit').addClass('is-disabled');
|
||||||
|
|
||||||
if(json.success) {
|
if(json.success) {
|
||||||
$('.message.submission-error').removeClass('is-shown');
|
$('.message.submission-error').removeClass('is-shown');
|
||||||
toggleSubmitButton();
|
toggleSubmitButton();
|
||||||
var u=decodeURI(window.location.search);
|
var u=decodeURI(window.location.search);
|
||||||
next=u.split("next=")[1];
|
next=u.split("next=")[1];
|
||||||
@@ -41,7 +43,7 @@
|
|||||||
location.href="${reverse('dashboard')}";
|
location.href="${reverse('dashboard')}";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$('.message.submission-error').addClass('is-shown');
|
$('.message.submission-error').addClass('is-shown');
|
||||||
toggleSubmitButton();
|
toggleSubmitButton();
|
||||||
$('.message.submission-error .message-copy').html(json.value);
|
$('.message.submission-error .message-copy').html(json.value);
|
||||||
}
|
}
|
||||||
@@ -51,13 +53,14 @@
|
|||||||
function toggleSubmitButton(e) {
|
function toggleSubmitButton(e) {
|
||||||
var $msgError = $('form .status.submission-error');
|
var $msgError = $('form .status.submission-error');
|
||||||
var $submitButton = $('form .form-actions #submit');
|
var $submitButton = $('form .form-actions #submit');
|
||||||
|
var $submitButtonCopy = $submitButton.html();
|
||||||
|
|
||||||
if(!$msgError.hasClass('is-shown')) {
|
if(!$msgError.hasClass('is-shown')) {
|
||||||
$submitButton.prop('disabled', true);
|
$submitButton.prop('disabled', true).html('Processing your account information …');
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
$submitButton.prop('disabled', false);
|
$submitButton.prop('disabled', false).html($submitButtonCopy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -76,7 +79,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<form role="form" id="login-form" method="post" data-remote="true" action="/login_ajax">
|
<form role="form" id="login-form" method="post" data-remote="true" action="/login_ajax">
|
||||||
|
|
||||||
<!-- status messages -->
|
<!-- status messages -->
|
||||||
<div role="alert" class="status message">
|
<div role="alert" class="status message">
|
||||||
<h3 class="message-title">We're Sorry, edX accounts are unavailable currently</h3>
|
<h3 class="message-title">We're Sorry, edX accounts are unavailable currently</h3>
|
||||||
@@ -91,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="instructions sr">
|
<p class="instructions sr">
|
||||||
Please provide the following information to log into your edX account. Required fields are noted by <strong class="indicator">bold text and an asterisk (*)</strong>.
|
Please provide the following information to log into your edX account. Required fields are noted by <strong class="indicator">bold text and an asterisk (*)</strong>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<fieldset class="group group-form group-form-requiredinformation">
|
<fieldset class="group group-form group-form-requiredinformation">
|
||||||
@@ -100,7 +103,7 @@
|
|||||||
<ol class="list-input">
|
<ol class="list-input">
|
||||||
<li class="field required text" id="field-email">
|
<li class="field required text" id="field-email">
|
||||||
<label for="email">E-mail</label>
|
<label for="email">E-mail</label>
|
||||||
<input class="" id="email" type="email" name="email" value="" placeholder="example: username@domain.com" />
|
<input class="" id="email" type="email" name="email" value="" placeholder="example: username@domain.com" />
|
||||||
</li>
|
</li>
|
||||||
<li class="field required password" id="field-password">
|
<li class="field required password" id="field-password">
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
|
|||||||
@@ -36,8 +36,10 @@
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
$(document).delegate('#register-form', 'ajax:success', function(data, json, xhr) {
|
$(document).delegate('#register-form', 'ajax:success', function(data, json, xhr) {
|
||||||
|
$(this).find('.form-actions #submit').addClass('is-disabled');
|
||||||
|
|
||||||
if(json.success) {
|
if(json.success) {
|
||||||
$('.message.submission-error').removeClass('is-shown');
|
$('.message.submission-error').removeClass('is-shown');
|
||||||
toggleSubmitButton();
|
toggleSubmitButton();
|
||||||
location.href="${reverse('dashboard')}";
|
location.href="${reverse('dashboard')}";
|
||||||
} else {
|
} else {
|
||||||
@@ -52,13 +54,14 @@
|
|||||||
function toggleSubmitButton(e) {
|
function toggleSubmitButton(e) {
|
||||||
var $msgError = $('form .status.submission-error');
|
var $msgError = $('form .status.submission-error');
|
||||||
var $submitButton = $('form .form-actions #submit').prop('disabled', true);
|
var $submitButton = $('form .form-actions #submit').prop('disabled', true);
|
||||||
|
var $submitButtonCopy = $submitButton.html();
|
||||||
|
|
||||||
if(!$msgError.hasClass('is-shown')) {
|
if(!$msgError.hasClass('is-shown')) {
|
||||||
$submitButton.prop('disabled', true);
|
$submitButton.prop('disabled', true).html('Processing your registration …');
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
$submitButton.prop('disabled', false);
|
$submitButton.prop('disabled', false).html($submitButtonCopy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -77,7 +80,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<form role="form" id="register-form" method="post" data-remote="true" action="/create_account">
|
<form role="form" id="register-form" method="post" data-remote="true" action="/create_account">
|
||||||
|
|
||||||
<!-- status messages -->
|
<!-- status messages -->
|
||||||
<div role="alert" class="status message">
|
<div role="alert" class="status message">
|
||||||
<h3 class="message-title">We're sorry, edX enrollment is not available in your region</h3>
|
<h3 class="message-title">We're sorry, edX enrollment is not available in your region</h3>
|
||||||
@@ -91,7 +94,7 @@
|
|||||||
|
|
||||||
<p class="instructions">
|
<p class="instructions">
|
||||||
Please complete the following fields to register for an edX account. <br />
|
Please complete the following fields to register for an edX account. <br />
|
||||||
Required fields are noted by <strong class="indicator">bold text and an asterisk (*)</strong>.
|
Required fields are noted by <strong class="indicator">bold text and an asterisk (*)</strong>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<fieldset class="group group-form group-form-requiredinformation">
|
<fieldset class="group group-form group-form-requiredinformation">
|
||||||
@@ -102,7 +105,7 @@
|
|||||||
<ol class="list-input">
|
<ol class="list-input">
|
||||||
<li class="field required text" id="field-email">
|
<li class="field required text" id="field-email">
|
||||||
<label for="email">E-mail</label>
|
<label for="email">E-mail</label>
|
||||||
<input class="" id="email" type="email" name="email" value="" placeholder="example: username@domain.com" />
|
<input class="" id="email" type="email" name="email" value="" placeholder="example: username@domain.com" />
|
||||||
</li>
|
</li>
|
||||||
<li class="field required password" id="field-password">
|
<li class="field required password" id="field-password">
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
@@ -236,4 +239,4 @@
|
|||||||
<p>Need help in registering with edX? <a href="#">View our FAQs for answers to commonly asked questions</a>. Once registered, most questions can be answered in the course specific discussion forums or through the FAQs.</p>
|
<p>Need help in registering with edX? <a href="#">View our FAQs for answers to commonly asked questions</a>. Once registered, most questions can be answered in the course specific discussion forums or through the FAQs.</p>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user