Custom icons for third party auth login buttons

- Icon images can be uploaded from the django admin
- Test coverage improved
This commit is contained in:
Omar Khan
2016-03-22 16:19:26 +07:00
parent d426931e40
commit 793bb0f1e9
29 changed files with 302 additions and 41 deletions

View File

@@ -26,7 +26,14 @@ from student.models import UserProfile
% for enabled in provider.Registry.accepting_logins():
## 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]}');"><span class="icon fa ${enabled.icon_class}"></span>${_('Sign up with {provider_name}').format(provider_name=enabled.name)}</button>
<button type="submit" class="button button-primary button-${enabled.provider_id} register-${enabled.provider_id}" onclick="thirdPartySignin(event, '${pipeline_urls[enabled.provider_id]}');">
% 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>