u'Login failed - user with username {username} has no social auth with backend_name {backend_name}'.format(
username=username,backend_name=backend_name))
returnJsonResponse({
"success":False,
# Translators: provider_name is the name of an external, third-party user authentication service (like
# Google or LinkedIn).
"value":_('There is no {platform_name} account associated with your {provider_name} account. Please use your {platform_name} credentials or pick another provider.').format(
## Translators: this message is displayed when a user tries to link their account with a third-party authentication provider (for example, Google or LinkedIn) with a given edX account, but their third-party account is already associated with another edX account. provider_name is the name of the third-party authentication provider, and platform_name is the name of the edX deployment.
${_('The selected {provider_name} account is already linked to another {platform_name} account. Please {link_start}log out{link_end}, then log in with your {provider_name} account.').format(link_end='</a>', link_start='<ahref="%s">' % logout_url, provider_name='<strong>%s</strong>' % duplicate_provider.NAME, platform_name=platform_name)}
% if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH'):
<liclass="controls--account">
<spanclass="title">
<divclass="icon icon-gears"></div>
## Translators: this section lists all the third-party authentication providers (for example, Google and LinkedIn) the user can link with or unlink from their edX account.
## Translators: clicking on this removes the link between a user's edX account and their account with an external authentication provider (like Google or LinkedIn).
## Translators: clicking on this creates a link between a user's edX account and their account with an external authentication provider (like Google or LinkedIn).
${_("link")}
</a>
% endif
</span>
</div>
% endfor
</span>
</li>
% endif
% if external_auth_map is None or 'shib' not in external_auth_map.external_domain:
% if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH'):
<hr/>
<pclass="instructions">
## 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.
${_('or, if you have connected one of these providers, log in below.')}
</p>
<divclass="form-actions form-third-party-auth">
% for enabled in provider.Registry.enabled():
## Translators: provider_name is the name of an external, third-party user authentication provider (like Google or LinkedIn).
<buttontype="submit"class="button button-primary"onclick="thirdPartySignin(event, '${pipeline.get_login_url(enabled.NAME, pipeline.AUTH_ENTRY_LOGIN)}');"><spanclass="icon ${enabled.ICON_CLASS}"></span>${_('Sign in with {provider_name}').format(provider_name=enabled.NAME)}</button>
<%blockname="pagetitle">${_("Register for {platform_name}").format(platform_name=platform_name)}</%block>
...
...
@@ -67,6 +68,11 @@
});
})(this);
functionthirdPartySignin(event,url){
event.preventDefault();
window.location.href=url;
}
functiontoggleSubmitButton(enable){
var$submitButton=$('form .form-actions #submit');
...
...
@@ -110,11 +116,46 @@
<ulclass="message-copy"></ul>
</div>
% if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH'):
% if not running_pipeline:
<pclass="instructions">
${_("Register to start learning today!")}
</p>
<divclass="form-actions form-third-party-auth">
% for enabled in provider.Registry.enabled():
## Translators: provider_name is the name of an external, third-party user authentication service (like Google or LinkedIn).
<buttontype="submit"class="button button-primary"onclick="thirdPartySignin(event, '${pipeline.get_login_url(enabled.NAME, pipeline.AUTH_ENTRY_REGISTER)}');"><spanclass="icon ${enabled.ICON_CLASS}"></span>${_('Sign in with {provider_name}').format(provider_name=enabled.NAME)}</button>
% endfor
</div>
<pclass="instructions">
${_('or create your own {platform_name} account by completing all <strong>required*</strong> fields below.').format(platform_name=platform_name)}
</p>
% else:
<pclass="instructions">
## Translators: selected_provider is the name of an external, third-party user authentication service (like Google or LinkedIn).
${_("You've successfully signed in with {selected_provider}.").format(selected_provider='<strong>%s</strong>' % selected_provider)}<br/>
${_("Finish your account registration below to start learning.")}
</p>
% endif
% else:
<pclass="instructions">
${_("Please complete the following fields to register for an account. ")}<br/>
${_('Required fields are noted by <strongclass="indicator">bold text and an asterisk (*)</strong>.')}
<spanclass="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>
<liclass="field required text"id="field-name">
<labelfor="name">${_('Full Name')}</label>
<inputid="name"type="text"name="name"value=""placeholder="${_('example: Jane Doe')}"requiredaria-required="true"aria-describedby="name-tip"/>
<inputid="name"type="text"name="name"value="${name}"placeholder="${_('example: Jane Doe')}"requiredaria-required="true"aria-describedby="name-tip"/>
<spanclass="tip tip-input"id="name-tip">${_("Needed for any certificates you may earn")}</span>