Remove old logistration templates.
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.urls import reverse
|
||||
%>
|
||||
|
||||
<header>
|
||||
<h2 class="sr">${_("Helpful Information")}</h2>
|
||||
</header>
|
||||
|
||||
<div class="cta cta-help">
|
||||
<h3>${_("Not Enrolled?")}</h3>
|
||||
<p><a href="${reverse('register_user')}">${_("Sign up for {platform_name} today!").format(platform_name=platform_name)}</a></p>
|
||||
|
||||
## Disable help unless the FAQ marketing link is enabled
|
||||
% if settings.MKTG_URL_LINK_MAP.get('FAQ'):
|
||||
<h3>${_("Need Help?")}</h3>
|
||||
<p>${_("Looking for help signing in or with your {platform_name} account?").format(platform_name=platform_name)}
|
||||
<a href="${marketing_link('FAQ')}">
|
||||
${_("View our help section for answers to commonly asked questions.")}
|
||||
</a></p>
|
||||
% endif
|
||||
</div>
|
||||
@@ -1,257 +0,0 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%inherit file="main.html" />
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
|
||||
<%!
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
import third_party_auth
|
||||
from third_party_auth import provider, pipeline
|
||||
%>
|
||||
|
||||
<%!
|
||||
from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json
|
||||
%>
|
||||
|
||||
<%block name="pagetitle">${_("Log into your {platform_name} Account").format(platform_name=platform_name)}</%block>
|
||||
|
||||
<%block name="bodyclass">view-login</%block>
|
||||
|
||||
<%block name="js_extra">
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
// adding js class for styling with accessibility in mind
|
||||
$('body').addClass('js');
|
||||
|
||||
// show forgot password modal UI if URL contains matching DOM ID
|
||||
if ($.deparam.fragment()['forgot-password-modal'] !== undefined) {
|
||||
$('.pwd-reset').click();
|
||||
}
|
||||
|
||||
// new window/tab opening
|
||||
$('a[rel="external"], a[class="new-vp"]')
|
||||
.click( function() {
|
||||
window.open( $(this).attr('href'), '', 'noopener' );
|
||||
return false;
|
||||
});
|
||||
|
||||
// form field label styling on focus
|
||||
$("form :input").focus(function() {
|
||||
$("label[for='" + this.id + "']").parent().addClass("is-focused");
|
||||
}).blur(function() {
|
||||
$("label").parent().removeClass("is-focused");
|
||||
});
|
||||
|
||||
$("#email").focus();
|
||||
});
|
||||
|
||||
(function() {
|
||||
toggleSubmitButton(true);
|
||||
|
||||
$('#login-form').on('submit', function() {
|
||||
toggleSubmitButton(false);
|
||||
});
|
||||
|
||||
$('#login-form').on('ajax:error', function(event, request, status_string) {
|
||||
toggleSubmitButton(true);
|
||||
|
||||
if (request.status === 403) {
|
||||
$('.message.submission-error').removeClass('is-shown');
|
||||
$('.third-party-signin.message').addClass('is-shown').focus();
|
||||
$('.third-party-signin.message .instructions').text(request.responseText);
|
||||
} else {
|
||||
$('.third-party-signin.message').removeClass('is-shown');
|
||||
$('.message.submission-error').addClass('is-shown').focus();
|
||||
$('.message.submission-error').text(gettext("Your request could not be completed. Please try again."));
|
||||
}
|
||||
});
|
||||
|
||||
$('#login-form').on('ajax:success', function(event, json, xhr) {
|
||||
if(json.success) {
|
||||
var nextUrl = "${login_redirect_url | n, js_escaped_string}";
|
||||
if (json.redirect_url) {
|
||||
nextUrl = json.redirect_url; // Most likely third party auth completion. This trumps 'nextUrl' above.
|
||||
}
|
||||
if (!isExternal(nextUrl)) {
|
||||
location.href=nextUrl;
|
||||
} else {
|
||||
location.href="${reverse('dashboard') | n, js_escaped_string}";
|
||||
}
|
||||
} else if(json.hasOwnProperty('redirect')) {
|
||||
// Shibboleth authentication redirect requested by the server:
|
||||
var u=decodeURI(window.location.search);
|
||||
if (!isExternal(json.redirect)) { // a paranoid check. Our server is the one providing json.redirect
|
||||
location.href=json.redirect+u;
|
||||
} // else we just remain on this page, which is fine since this particular path implies a login failure
|
||||
// that has been generated via packet tampering (json.redirect has been messed with).
|
||||
} else {
|
||||
toggleSubmitButton(true);
|
||||
$('.message.submission-error').addClass('is-shown').focus();
|
||||
$('.message.submission-error .message-copy').text(json.value);
|
||||
}
|
||||
});
|
||||
$("#forgot-password-link").click(function() {
|
||||
$("#forgot-password-modal").show();
|
||||
$("#forgot-password-modal .close-modal").focus();
|
||||
});
|
||||
|
||||
})(this);
|
||||
|
||||
function toggleSubmitButton(enable) {
|
||||
var $submitButton = $('form .form-actions #submit');
|
||||
|
||||
if(enable) {
|
||||
var platform = "${_('Log into My {platform_name} Account').format(platform_name=platform_name) | n, js_escaped_string}";
|
||||
var msg = "${_('Access My Courses') | n, js_escaped_string}";
|
||||
var content = edx.HtmlUtils.interpolateHtml(
|
||||
edx.HtmlUtils.HTML("{platform}<span class='orn-plus'>+</span>{msg}"),
|
||||
{
|
||||
platform:platform,
|
||||
msg:msg
|
||||
});
|
||||
|
||||
$submitButton.
|
||||
removeClass('is-disabled').
|
||||
attr('aria-disabled', false).
|
||||
prop('disabled', false).
|
||||
html(edx.HtmlUtils.ensureHtml(content).toString());
|
||||
}
|
||||
else {
|
||||
$submitButton.
|
||||
addClass('is-disabled').
|
||||
prop('disabled', true).
|
||||
text("${_(u'Processing your account information') | n, js_escaped_string}");
|
||||
}
|
||||
}
|
||||
|
||||
function thirdPartySignin(event, url) {
|
||||
event.preventDefault();
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
(function post_form_if_pipeline_running(pipeline_running) {
|
||||
// If the pipeline is running, the user has already authenticated via a
|
||||
// third-party provider. We want to invoke /login_ajax to loop in the
|
||||
// code that does logging and sets cookies on the request. It is most
|
||||
// consistent to do that by using the same mechanism that is used when
|
||||
// the use does first-party sign-in: POSTing the sign-in form.
|
||||
if (pipeline_running) {
|
||||
$('#login-form').submit();
|
||||
}
|
||||
})(${pipeline_running | n, dump_js_escaped_json})
|
||||
</script>
|
||||
</%block>
|
||||
|
||||
<%include file="forgot_password_modal.html" />
|
||||
|
||||
<section class="introduction">
|
||||
<header>
|
||||
<h1 class="title">
|
||||
<span class="title-super">${_("Please log in")}</span>
|
||||
<span class="title-sub">${_("to access your account and courses")}</span>
|
||||
</h1>
|
||||
</header>
|
||||
</section>
|
||||
|
||||
<section class="login container">
|
||||
<section role="main" class="content">
|
||||
<form role="form" id="login-form" method="post" data-remote="true" action="/login_ajax" novalidate>
|
||||
|
||||
<!-- status messages -->
|
||||
<div role="alert" class="status message">
|
||||
<h3 class="message-title">${_("We're Sorry, {platform_name} accounts are unavailable currently").format(platform_name=platform_name)}</h3>
|
||||
</div>
|
||||
|
||||
<div role="alert" class="status message submission-error" tabindex="-1">
|
||||
<h3 class="message-title">${_("We couldn't log you in.")} </h3>
|
||||
<ul class="message-copy">
|
||||
<li>${_("Your email or password is incorrect")}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div role="alert" class="third-party-signin message" tabindex="-1">
|
||||
<p class="instructions"> </p>
|
||||
</div>
|
||||
|
||||
% if third_party_auth_error:
|
||||
<div role="alert" class="status message third-party-auth-error is-shown" tabindex="-1">
|
||||
<h3 class="message-title">${_("An error occurred when signing you in to {platform_name}.").format(platform_name=platform_name)} </h3>
|
||||
<ul class="message-copy">
|
||||
<li>${third_party_auth_error}</li>
|
||||
</ul>
|
||||
</div>
|
||||
% endif
|
||||
|
||||
<p class="instructions sr">
|
||||
${Text(_('Please provide the following information to log into your {platform_name} account. Required fields are noted by {strong_start}bold text and an asterisk (*){strong_end}.')).format(
|
||||
strong_start=HTML('<strong class="indicator">'),
|
||||
strong_end=HTML('</strong>'),
|
||||
platform_name=platform_name)}
|
||||
</p>
|
||||
|
||||
<div class="group group-form group-form-requiredinformation">
|
||||
<h2 class="sr">${_('Required Information')}</h2>
|
||||
|
||||
<ol class="list-input">
|
||||
<li class="field required text" id="field-email">
|
||||
<label for="email">${_('E-mail')}</label>
|
||||
<input class="" id="email" type="email" name="email" value="" placeholder="${_('example: username@domain.com')}" required aria-required="true" aria-describedby="email-tip" />
|
||||
<span class="tip tip-input" id="email-tip">${_("This is the e-mail address you used to register with {platform}").format(platform=platform_name)}</span>
|
||||
</li>
|
||||
<li class="field required password" id="field-password">
|
||||
<label for="password">${_('Password')}</label>
|
||||
<input id="password" type="password" name="password" value="" required aria-required="true" />
|
||||
<span class="tip tip-input">
|
||||
<a href="#forgot-password-modal" rel="leanModal" class="pwd-reset action action-forgotpw" id="forgot-password-link" role="button" aria-haspopup="true">${_('Forgot password?')}</a>
|
||||
</span>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button name="submit" type="submit" id="submit" class="action action-primary action-update login-button"></button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
% if third_party_auth.is_enabled():
|
||||
|
||||
<span class="deco-divider">
|
||||
## Developers: this is a sentence fragment, which is usually frowned upon. The design of the pags uses this fragment to provide an "else" clause underneath a number of choices. It's OK to leave it.
|
||||
## Translators: this is the last choice of a number of choices of how to log in to the site.
|
||||
<span class="copy">${_('or')}</span>
|
||||
</span>
|
||||
|
||||
<div class="form-actions form-third-party-auth">
|
||||
|
||||
% for enabled in provider.Registry.displayed_for_login():
|
||||
## Translators: provider_name is the name of an external, third-party user authentication provider (like Google or LinkedIn).
|
||||
## xss-lint: disable=mako-invalid-html-filter
|
||||
<button type="submit" class="button button-primary button-${enabled.provider_id} login-${enabled.provider_id}" onclick="thirdPartySignin(event, '${pipeline_url[enabled.provider_id]|n}');">
|
||||
% if enabled.icon_class:
|
||||
<span class="icon fa ${enabled.icon_class}" aria-hidden="true"></span>
|
||||
% else:
|
||||
<span class="icon" aria-hidden="true"><img class="icon-image" src="${enabled.icon_image.url}" alt="${enabled.name} icon" /></span>
|
||||
% endif
|
||||
${_('Sign in with {provider_name}').format(provider_name=enabled.name)}
|
||||
</button>
|
||||
% endfor
|
||||
|
||||
</div>
|
||||
|
||||
% endif
|
||||
|
||||
</section>
|
||||
|
||||
<aside role="complementary">
|
||||
|
||||
<%
|
||||
# allow for theming overrides on the registration sidebars, otherwise default to pre-existing ones
|
||||
sidebar_file = static.get_template_path('login-sidebar.html')
|
||||
%>
|
||||
|
||||
<%include file="${sidebar_file}" />
|
||||
|
||||
</aside>
|
||||
</section>
|
||||
@@ -1,274 +0,0 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%!
|
||||
import third_party_auth
|
||||
import six
|
||||
from third_party_auth import pipeline, provider
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
from django_countries import countries
|
||||
from student.models import UserProfile
|
||||
%>
|
||||
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }">
|
||||
|
||||
<!-- status messages -->
|
||||
<div role="alert" class="status message">
|
||||
<h3 class="message-title">${_("We're sorry, but this version of your browser is not supported. Try again using a different browser or a newer version of your browser.")}</h3>
|
||||
</div>
|
||||
|
||||
<div role="alert" class="status message submission-error" tabindex="-1">
|
||||
<h3 class="message-title">${_("The following errors occurred while processing your registration:")} </h3>
|
||||
<ul class="message-copy"> </ul>
|
||||
</div>
|
||||
|
||||
% if third_party_auth.is_enabled():
|
||||
|
||||
% if not running_pipeline:
|
||||
|
||||
<div class="form-actions form-third-party-auth">
|
||||
|
||||
% for enabled in provider.Registry.displayed_for_login():
|
||||
## Translators: provider_name is the name of an external, third-party user authentication service (like Google or LinkedIn).
|
||||
<button type="submit" class="button button-primary button-${enabled.provider_id} register-${enabled.provider_id}" onclick="thirdPartySignin(event, '${pipeline_urls[enabled.provider_id] | n, decode.utf8}');">
|
||||
% if enabled.icon_class:
|
||||
<span class="icon fa ${enabled.icon_class}" aria-hidden="true"></span>
|
||||
% else:
|
||||
<span class="icon" aria-hidden="true"><img class="icon-image" src="${enabled.icon_image.url}" alt="${enabled.name} icon" /></span>
|
||||
% endif
|
||||
${_('Sign up with {provider_name}').format(provider_name=enabled.name)}
|
||||
</button>
|
||||
% endfor
|
||||
|
||||
</div>
|
||||
|
||||
<span class="deco-divider">
|
||||
## Developers: this is a sentence fragment, which is usually frowned upon. The design of the pags uses this fragment to provide an "else" clause underneath a number of choices. It's OK to leave it.
|
||||
## Translators: this is the last choice of a number of choices of how to log in to the site.
|
||||
<span class="copy">${_('or')}</span>
|
||||
</span>
|
||||
|
||||
<p class="instructions">
|
||||
${_('Create your own {platform_name} account below').format(platform_name=platform_name)}
|
||||
<span class="note">${Text(_('Required fields are noted by {strong_start}bold text and an asterisk (*){strong_end}.')).format(
|
||||
strong_start=HTML('<strong class="indicator">'),
|
||||
strong_end=HTML('</strong>'))}</span>
|
||||
</p>
|
||||
|
||||
|
||||
% else:
|
||||
|
||||
<p class="instructions">
|
||||
## Translators: selected_provider is the name of an external, third-party user authentication service (like Google or LinkedIn).
|
||||
${Text(_("You've successfully signed in with {selected_provider}.")).format(selected_provider=HTML('<strong>{selected_provider}</strong>').format(selected_provider=selected_provider))}<br />
|
||||
${_("We just need a little more information before you start learning with {platform_name}.").format(platform_name=settings.PLATFORM_NAME)}
|
||||
</p>
|
||||
|
||||
% endif
|
||||
|
||||
% else:
|
||||
|
||||
<p class="instructions">
|
||||
${_("Please complete the following fields to register for an account. ")}<br />
|
||||
${Text(_('Required fields are noted by {strong_start}bold text and an asterisk (*){strong_end}.')).format( \
|
||||
strong_start=HTML('<strong class="indicator">'), strong_end=HTML('</strong>'))}
|
||||
</p>
|
||||
|
||||
% endif
|
||||
|
||||
<div class="group group-form group-form-requiredinformation">
|
||||
<h2 class="sr">${_('Required Information')}</h2>
|
||||
|
||||
% if has_extauth_info is UNDEFINED:
|
||||
|
||||
<ol class="list-input">
|
||||
<li class="field required text" id="field-email">
|
||||
<label for="email">${_('E-mail')}</label>
|
||||
<input class="" id="email" type="email" name="email" value="${email}" placeholder="${_('example: username@domain.com')}" required aria-required="true" />
|
||||
</li>
|
||||
|
||||
<li class="field required text" id="field-name">
|
||||
<label for="name">${_('Full Name')}</label>
|
||||
<input id="name" type="text" name="name" value="${name}" placeholder="${_('example: Jane Doe')}" required aria-required="true" aria-describedby="name-tip" />
|
||||
<span class="tip tip-input" id="name-tip">${_("Your legal name, used for any certificates you earn.")}</span>
|
||||
</li>
|
||||
<li class="field required text" id="field-username">
|
||||
<label for="username">${_('Public Username')}</label>
|
||||
<input id="username" type="text" name="username" value="${username}" placeholder="${_('example: JaneDoe')}" required aria-required="true" aria-describedby="username-tip"/>
|
||||
<span class="tip tip-input" id="username-tip">${_('Will be shown in any discussions or forums you participate in')} <strong>(${_('cannot be changed later')})</strong></span>
|
||||
</li>
|
||||
|
||||
% if third_party_auth.is_enabled() and running_pipeline:
|
||||
|
||||
<li class="is-disabled field optional password" id="field-password" hidden>
|
||||
<label for="password">${_('Password')}</label>
|
||||
<input id="password" type="password" name="password" value="" disabled required aria-required="true" />
|
||||
</li>
|
||||
|
||||
% else:
|
||||
|
||||
<li class="field required password" id="field-password">
|
||||
<label for="password">${_('Password')}</label>
|
||||
<input id="password" type="password" name="password" value="" required aria-required="true" />
|
||||
</li>
|
||||
|
||||
% endif
|
||||
</ol>
|
||||
|
||||
% else:
|
||||
|
||||
<div class="message">
|
||||
<h3 class="message-title">${_("Welcome {username}").format(username=extauth_id)}</h3>
|
||||
<p class="message-copy">${_("Enter a Public Display Name:")}</p>
|
||||
</div>
|
||||
|
||||
<ol class="list-input">
|
||||
|
||||
% if ask_for_email:
|
||||
|
||||
<li class="field required text" id="field-email">
|
||||
<label for="email">${_("E-mail")}</label>
|
||||
<input class="" id="email" type="email" name="email" value="" placeholder="${_('example: username@domain.com')}" />
|
||||
</li>
|
||||
|
||||
% endif
|
||||
|
||||
<li class="field required text" id="field-username">
|
||||
<label for="username">${_('Public Display Name')}</label>
|
||||
<input id="username" type="text" name="username" value="${extauth_username}" placeholder="${_('example: JaneDoe')}" required aria-required="true" aria-describedby="username-tip" />
|
||||
<span class="tip tip-input" id="id="username-tip>${_('Will be shown in any discussions or forums you participate in')} <strong>(${_('cannot be changed later')})</strong></span>
|
||||
</li>
|
||||
|
||||
% if ask_for_fullname:
|
||||
|
||||
<li class="field required text" id="field-name">
|
||||
<label for="name">${_('Full Name')}</label>
|
||||
<input id="name" type="text" name="name" value="" placeholder="$_('example: Jane Doe')}" aria-describedby="name-tip" />
|
||||
<span class="tip tip-input" id="name-tip">${_("Your legal name, used for any certificates you earn.")}</span>
|
||||
</li>
|
||||
|
||||
% endif
|
||||
|
||||
</ol>
|
||||
|
||||
% endif
|
||||
</div>
|
||||
|
||||
<div class="group group-form group-form-secondary group-form-personalinformation">
|
||||
<h2 class="sr">${_("Additional Personal Information")}</h2>
|
||||
|
||||
<ol class="list-input">
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['city'] != 'hidden':
|
||||
<li class="field ${settings.REGISTRATION_EXTRA_FIELDS['city']} text" id="field-city">
|
||||
<label for="city">${_('City')}</label>
|
||||
<input id="city" type="text" name="city" value="" placeholder="${_('example: New York')}" aria-describedby="city-tip" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['city'] == 'required' else ''} />
|
||||
</li>
|
||||
% endif
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['country'] != 'hidden':
|
||||
<li class="field-group">
|
||||
<div class="field ${settings.REGISTRATION_EXTRA_FIELDS['country']} select" id="field-country">
|
||||
<label for="country">${_("Country")}</label>
|
||||
<select id="country" name="country" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['country'] == 'required' else ''}>
|
||||
<option value="">--</option>
|
||||
%for code, country_name in countries:
|
||||
<option value="${code}">${ six.text_type(country_name) }</option>
|
||||
%endfor
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
% endif
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['level_of_education'] != 'hidden':
|
||||
<li class="field-group field-education-level">
|
||||
<div class="field ${settings.REGISTRATION_EXTRA_FIELDS['level_of_education']} select" id="field-education-level">
|
||||
<label for="education-level">${_("Highest Level of Education Completed")}</label>
|
||||
<select id="education-level" name="level_of_education" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['level_of_education'] == 'required' else ''}>
|
||||
<option value="">--</option>
|
||||
%for code, ed_level in UserProfile.LEVEL_OF_EDUCATION_CHOICES:
|
||||
<option value="${code}">${_(ed_level)}</option>
|
||||
%endfor
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
% endif
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['gender'] != 'hidden':
|
||||
<li class="field-group field-gender">
|
||||
<div class="field ${settings.REGISTRATION_EXTRA_FIELDS['gender']} select" id="field-gender">
|
||||
<label for="gender">${_("Gender")}</label>
|
||||
<select id="gender" name="gender" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['gender'] == 'required' else ''}>
|
||||
<option value="">--</option>
|
||||
%for code, gender in UserProfile.GENDER_CHOICES:
|
||||
<option value="${code}">${_(gender)}</option>
|
||||
%endfor
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
% endif
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['year_of_birth'] != 'hidden':
|
||||
<li class="field-group field-yob">
|
||||
<div class="field ${settings.REGISTRATION_EXTRA_FIELDS['year_of_birth']} select" id="field-yob">
|
||||
<label for="yob">${_("Year of Birth")}</label>
|
||||
<select id="yob" name="year_of_birth" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['year_of_birth'] == 'required' else ''}>
|
||||
<option value="">--</option>
|
||||
%for year in UserProfile.VALID_YEARS:
|
||||
<option value="${year}">${year}</option>
|
||||
%endfor
|
||||
</select>
|
||||
</div>
|
||||
% endif
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="group group-form group-form-personalinformation2">
|
||||
<ol class="list-input">
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['mailing_address'] != 'hidden':
|
||||
<li class="field ${settings.REGISTRATION_EXTRA_FIELDS['mailing_address']} text" id="field-address-mailing">
|
||||
<label for="address-mailing">${_("Mailing Address")}</label>
|
||||
<textarea id="address-mailing" name="mailing_address" value="" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['mailing_address'] == 'required' else ''}></textarea>
|
||||
</li>
|
||||
% endif
|
||||
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['goals'] != 'hidden':
|
||||
<li class="field ${settings.REGISTRATION_EXTRA_FIELDS['goals']} text" id="field-goals">
|
||||
<label for="goals">${_("Please share with us your reasons for registering with {platform_name}").format(platform_name=platform_name)}</label>
|
||||
<textarea id="goals" name="goals" value="" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['goals'] == 'required' else ''}></textarea>
|
||||
</li>
|
||||
% endif
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="group group-form group-form-accountacknowledgements">
|
||||
<h2 class="sr">${_("Account Acknowledgements")}</h2>
|
||||
|
||||
<ol class="list-input">
|
||||
<li class="field-group">
|
||||
|
||||
% if has_extauth_info is UNDEFINED or ask_for_tos :
|
||||
<div class="field required checkbox" id="field-tos">
|
||||
<input id="tos-yes" type="checkbox" name="terms_of_service" value="true" required aria-required="true" />
|
||||
<label for="tos-yes">${Text(_('I agree to the {link_start}Terms of Service{link_end}')).format(
|
||||
link_start=HTML('<a href="{url}" class="new-vp" tabindex="-1">').format(url=marketing_link('TOS')),
|
||||
link_end=HTML('</a>'))}</label>
|
||||
</div>
|
||||
% endif
|
||||
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['honor_code'] != 'hidden':
|
||||
## check if we have an Honor Code link in our marketing map
|
||||
% if marketing_link('HONOR') and marketing_link('HONOR') != '#':
|
||||
<div class="field ${settings.REGISTRATION_EXTRA_FIELDS['honor_code']} checkbox" id="field-honorcode">
|
||||
<input id="honorcode-yes" type="checkbox" name="honor_code" value="true" />
|
||||
<%
|
||||
honor_code_path = marketing_link('HONOR')
|
||||
%>
|
||||
<label for="honorcode-yes">${Text(_('I agree to the {link_start}Honor Code{link_end}')).format(
|
||||
link_start=HTML('<a href="{url}" class="new-vp" tabindex="-1">').format(url=honor_code_path),
|
||||
link_end=HTML('</a>'))}</label>
|
||||
</div>
|
||||
% endif
|
||||
% endif
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button name="submit" type="submit" id="submit" class="action action-primary action-update register-button">${_('Register')} <span class="orn-plus">+</span> ${Text(_('Create My Account'))}</button>
|
||||
</div>
|
||||
@@ -1,198 +0,0 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%inherit file="main.html" />
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
<%namespace file='main.html' import="login_query"/>
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
from openedx.core.djangolib.js_utils import js_escaped_string
|
||||
from django.urls import reverse
|
||||
from django.utils import html
|
||||
from django_countries import countries
|
||||
from student.models import UserProfile
|
||||
from datetime import date
|
||||
import calendar
|
||||
%>
|
||||
|
||||
<%block name="pagetitle">${_("Preferences for {platform_name}").format(platform_name=settings.PLATFORM_NAME)}</%block>
|
||||
|
||||
<%block name="bodyclass">view-register</%block>
|
||||
|
||||
<%block name="js_extra">
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
// adding js class for styling with accessibility in mind
|
||||
$('body').addClass('js');
|
||||
|
||||
// new window/tab opening
|
||||
$('a[rel="external"], a[class="new-vp"]')
|
||||
.click( function() {
|
||||
window.open( $(this).attr('href'), '', 'noopener' );
|
||||
return false;
|
||||
});
|
||||
|
||||
// form field label styling on focus
|
||||
$("form :input").focus(function() {
|
||||
$("label[for='" + this.id + "']").parent().addClass("is-focused");
|
||||
}).blur(function() {
|
||||
$("label").parent().removeClass("is-focused");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
(function() {
|
||||
toggleSubmitButton(true);
|
||||
|
||||
$('#register-form').on('submit', function() {
|
||||
toggleSubmitButton(false);
|
||||
});
|
||||
|
||||
$('#register-form').on('ajax:error', function() {
|
||||
toggleSubmitButton(true);
|
||||
});
|
||||
|
||||
$('#register-form').on('ajax:success', function(event, json, xhr) {
|
||||
var url = json.redirect_url || "${reverse('dashboard') | n, js_escaped_string}";
|
||||
location.href = url;
|
||||
});
|
||||
|
||||
$('#register-form').on('ajax:error', function(event, jqXHR, textStatus) {
|
||||
toggleSubmitButton(true);
|
||||
json = $.parseJSON(jqXHR.responseText);
|
||||
$('.status.message.submission-error').addClass('is-shown').focus();
|
||||
$('.status.message.submission-error .message-copy').text(json.value).stop().css("display", "block");
|
||||
$(".field-error").removeClass('field-error');
|
||||
$("[data-field='"+json.field+"']").addClass('field-error')
|
||||
});
|
||||
})(this);
|
||||
|
||||
function toggleSubmitButton(enable) {
|
||||
var $submitButton = $('form .form-actions #submit');
|
||||
|
||||
if(enable) {
|
||||
$submitButton.
|
||||
removeClass('is-disabled').
|
||||
attr('aria-disabled', false).
|
||||
removeProp('disabled').
|
||||
text("${_('Update my {platform_name} Account').format(platform_name=settings.PLATFORM_NAME) | n, js_escaped_string}");
|
||||
}
|
||||
else {
|
||||
$submitButton.
|
||||
addClass('is-disabled').
|
||||
attr('aria-disabled', true).
|
||||
prop('disabled', true).
|
||||
text("${_('Processing your account information') | n, js_escaped_string}");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</%block>
|
||||
|
||||
<section class="introduction">
|
||||
<header>
|
||||
<h1 class="sr">${_("Welcome {username}! Please set your preferences below").format(username=extauth_id,
|
||||
platform_name=settings.PLATFORM_NAME)}</h1>
|
||||
</header>
|
||||
</section>
|
||||
|
||||
<%block name="login_button"></%block>
|
||||
<section class="register container">
|
||||
<section role="main" class="content">
|
||||
<form role="form" id="register-form" method="post" data-remote="true" action="/create_account" novalidate>
|
||||
|
||||
<!-- status messages -->
|
||||
<div role="alert" class="status message">
|
||||
<h3 class="message-title">${_("We're sorry, but this version of your browser is not supported. Try again using a different browser or a newer version of your browser.")}</h3>
|
||||
</div>
|
||||
|
||||
<div role="alert" class="status message submission-error" tabindex="-1">
|
||||
<h3 class="message-title">${_("The following errors occurred while processing your registration:")} </h3>
|
||||
<ul class="message-copy"> </ul>
|
||||
</div>
|
||||
|
||||
<p class="instructions">
|
||||
${Text(_('Required fields are noted by {strong_start}bold text and an asterisk (*){strong_end}.')).format(
|
||||
strong_start=HTML('<strong class="indicator">'),
|
||||
strong_end=HTML('</strong>')),}
|
||||
</p>
|
||||
|
||||
<fieldset class="group group-form group-form-requiredinformation">
|
||||
<legend class="sr">${_('Required Information')}</legend>
|
||||
|
||||
<div class="message">
|
||||
<p class="message-copy">${_("Enter a public username:")}</p>
|
||||
</div>
|
||||
|
||||
<ol class="list-input">
|
||||
|
||||
<li class="field required text" id="field-username">
|
||||
<label for="username">${_('Public Username')}</label>
|
||||
<input id="username" type="text" name="username" value="${extauth_username}" placeholder="${_('example: JaneDoe')}" required aria-required="true" />
|
||||
<span class="tip tip-input">${_('Will be shown in any discussions or forums you participate in')}</span>
|
||||
</li>
|
||||
|
||||
% if ask_for_email:
|
||||
|
||||
<li class="field required text" id="field-email">
|
||||
<label for="email">${_("E-mail")}</label>
|
||||
<input class="" id="email" type="email" name="email" value="" placeholder="${_('example: username@domain.com')}" />
|
||||
</li>
|
||||
|
||||
% endif
|
||||
|
||||
|
||||
% if ask_for_fullname:
|
||||
|
||||
<li class="field required text" id="field-name">
|
||||
<label for="name">${_('Full Name')}</label>
|
||||
<input id="name" type="text" name="name" value="" placeholder="$_('example: Jane Doe')}" />
|
||||
</li>
|
||||
|
||||
% endif
|
||||
|
||||
</ol>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="group group-form group-form-accountacknowledgements">
|
||||
<legend class="sr">${_("Account Acknowledgements")}</legend>
|
||||
|
||||
<ol class="list-input">
|
||||
<li class="field-group">
|
||||
|
||||
% if ask_for_tos :
|
||||
|
||||
<div class="field required checkbox" id="field-tos">
|
||||
<input id="tos-yes" type="checkbox" name="terms_of_service" value="true" required aria-required="true" />
|
||||
<label for="tos-yes">${Text(_('I agree to the {link_start}Terms of Service{link_end}')).format(
|
||||
link_start=HTML('<a href="{url}" class="new-vp">').format(url=marketing_link('TOS')),
|
||||
link_end=HTML('</a>'))}</label>
|
||||
</div>
|
||||
|
||||
% endif
|
||||
|
||||
<div class="field required checkbox" id="field-honorcode">
|
||||
<input id="honorcode-yes" type="checkbox" name="honor_code" value="true" />
|
||||
<%
|
||||
honor_code_path = marketing_link('HONOR')
|
||||
%>
|
||||
<label for="honorcode-yes">${Text(_('I agree to the {link_start}Honor Code{link_end}')).format(
|
||||
link_start=HTML('<a href="{url}" class="new-vp">').format(url=honor_code_path),
|
||||
link_end=HTML('</a>'))}</label>
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
|
||||
% if course_id and enrollment_action:
|
||||
<input type="hidden" name="enrollment_action" value="${enrollment_action}" />
|
||||
<input type="hidden" name="course_id" value="${course_id}" />
|
||||
% endif
|
||||
|
||||
<div class="form-actions">
|
||||
<button name="submit" type="submit" id="submit" class="action action-primary action-update">${_('Submit')} <span class="orn-plus">+</span> ${_('Update My Account')}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
@@ -1,48 +0,0 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.urls import reverse
|
||||
%>
|
||||
<%namespace file='main.html' import="login_query"/>
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
|
||||
|
||||
<header>
|
||||
<h3 class="sr">${_("Registration Help")}</h3>
|
||||
</header>
|
||||
|
||||
% if has_extauth_info is UNDEFINED:
|
||||
|
||||
<div class="btn-brand btn-login">
|
||||
<h3 class="title">${_("Already registered?")}</h3>
|
||||
<p class="instructions">
|
||||
<a class="btn-login-action" href="${reverse('signin_user')}${login_query()}">
|
||||
${_("Log in")}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
% endif
|
||||
|
||||
## TODO: Use a %block tag or something to allow themes to
|
||||
## override in a more generalizable fashion.
|
||||
<div class="cta cta-welcome">
|
||||
<h3>${_("Welcome to {platform_name}").format(platform_name=platform_name)}</h3>
|
||||
<p>${_("Registering with {platform_name} gives you access to all of our current and future free courses. Not ready to take a course just yet? Registering puts you on our mailing list - we will update you as courses are added.").format(platform_name=platform_name)}</p>
|
||||
</div>
|
||||
|
||||
<div class="cta cta-nextsteps">
|
||||
<h3>${_("Next Steps")}</h3>
|
||||
<p>${_("As part of joining {platform_name}, you will receive an email message with instructions for activating your account. Don't see the email? Check your spam folder and mark {platform_name} emails as 'not spam'. At {platform_name}, we communicate mostly through email.").format(platform_name=platform_name)}</p>
|
||||
</div>
|
||||
|
||||
% if settings.MKTG_URL_LINK_MAP.get('FAQ'):
|
||||
<div class="cta cta-help">
|
||||
<h3>${_("Need Help?")}</h3>
|
||||
<p>${_("Need help registering with {platform_name}?").format(platform_name=platform_name)}
|
||||
<a href="${marketing_link('FAQ')}">
|
||||
${_("View our FAQs for answers to commonly asked questions.")}
|
||||
</a>
|
||||
${_("You can find the answers to most of your questions in our list of FAQs. After you enroll in a course, you can also find answers in the course discussions.")}</p>
|
||||
</div>
|
||||
% endif
|
||||
@@ -1,133 +0,0 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%inherit file="main.html" />
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
<%namespace file='main.html' import="login_query"/>
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.js_utils import js_escaped_string
|
||||
from django.urls import reverse
|
||||
from django.utils import html
|
||||
from django_countries import countries
|
||||
from student.models import UserProfile
|
||||
from datetime import date
|
||||
import third_party_auth
|
||||
from third_party_auth import pipeline, provider
|
||||
import calendar
|
||||
%>
|
||||
|
||||
<%block name="pagetitle">${_("Register for {platform_name}").format(platform_name=platform_name)}</%block>
|
||||
|
||||
<%block name="bodyclass">view-register</%block>
|
||||
|
||||
<%block name="js_extra">
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
// adding js class for styling with accessibility in mind
|
||||
$('body').addClass('js');
|
||||
|
||||
// new window/tab opening
|
||||
$('a[rel="external"], a[class="new-vp"]')
|
||||
.click( function() {
|
||||
window.open( $(this).attr('href'), '', 'noopener' );
|
||||
return false;
|
||||
});
|
||||
|
||||
// form field label styling on focus
|
||||
$("form :input").focus(function() {
|
||||
$("label[for='" + this.id + "']").parent().addClass("is-focused");
|
||||
}).blur(function() {
|
||||
$("label").parent().removeClass("is-focused");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
(function() {
|
||||
toggleSubmitButton(true);
|
||||
|
||||
$('#register-form').on('submit', function() {
|
||||
toggleSubmitButton(false);
|
||||
});
|
||||
|
||||
$('#register-form').on('ajax:error', function() {
|
||||
toggleSubmitButton(true);
|
||||
});
|
||||
|
||||
$('#register-form').on('ajax:success', function(event, json, xhr) {
|
||||
var nextUrl = "${login_redirect_url | n, js_escaped_string}";
|
||||
if (json.redirect_url) {
|
||||
nextUrl = json.redirect_url; // Most likely third party auth completion. This trumps 'nextUrl' above.
|
||||
}
|
||||
if (!isExternal(nextUrl)) {
|
||||
location.href=nextUrl;
|
||||
} else {
|
||||
location.href="${reverse('dashboard') | n, js_escaped_string}";
|
||||
}
|
||||
});
|
||||
|
||||
$('#register-form').on('ajax:error', function(event, jqXHR, textStatus) {
|
||||
toggleSubmitButton(true);
|
||||
json = $.parseJSON(jqXHR.responseText);
|
||||
$('.status.message.submission-error').addClass('is-shown').focus();
|
||||
$('.status.message.submission-error .message-copy').text(json.value).stop().css("display", "block");
|
||||
$(".field-error").removeClass('field-error');
|
||||
$("[data-field='"+json.field+"']").addClass('field-error')
|
||||
});
|
||||
})(this);
|
||||
|
||||
function thirdPartySignin(event, url) {
|
||||
event.preventDefault();
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
function toggleSubmitButton(enable) {
|
||||
var $submitButton = $('form .form-actions #submit');
|
||||
|
||||
if(enable) {
|
||||
$submitButton.
|
||||
removeClass('is-disabled').
|
||||
attr('aria-disabled', false).
|
||||
prop('disabled', false).
|
||||
text("${_('Create My {platform_name} Account').format(platform_name=platform_name) | n, js_escaped_string}");
|
||||
}
|
||||
else {
|
||||
$submitButton.
|
||||
addClass('is-disabled').
|
||||
prop('disabled', true).
|
||||
text("${_('Processing your account information') | n, js_escaped_string}");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</%block>
|
||||
|
||||
<section class="introduction">
|
||||
<header>
|
||||
<h1 class="title">
|
||||
<span class="title-super">${_("Welcome!")}</span>
|
||||
<span class="title-sub">${_("Register below to create your {platform_name} account").format(platform_name=platform_name)}</span>
|
||||
</h1>
|
||||
</header>
|
||||
</section>
|
||||
|
||||
<section class="register container">
|
||||
<section role="main" class="content">
|
||||
<form role="form" id="register-form" method="post" data-remote="true" action="/create_account" novalidate>
|
||||
<%
|
||||
# allow for theming override on the registration form
|
||||
registration_form = static.get_template_path('register-form.html')
|
||||
%>
|
||||
<%include file="${registration_form}" />
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<aside role="complementary">
|
||||
|
||||
<%
|
||||
# allow for theming overrides on the registration sidebars, otherwise default to pre-existing ones
|
||||
sidebar_file = static.get_template_path('register-sidebar.html')
|
||||
%>
|
||||
|
||||
<%include file="${sidebar_file}" />
|
||||
|
||||
</aside>
|
||||
</section>
|
||||
Reference in New Issue
Block a user