mirror of https://github.com/zulip/zulip.git
refactor: De-duplicate code in `accounts_home.html` for social auth.
This commit is contained in:
parent
3610aaece3
commit
0be410d3fe
|
@ -87,16 +87,16 @@ $(function () {
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if github_auth_enabled %}
|
||||
{% for backend in social_backends %}
|
||||
<div class="login-social">
|
||||
<form class="form-inline github-wrapper" action="{{ url('signup-social', args=('github',)) }}" method="get">
|
||||
<form class="form-inline {{ backend.name }}-wrapper" action="{{ backend.signup_url }}" method="get">
|
||||
<input type='hidden' name='multiuse_object_key' value='{{ multiuse_object_key }}' />
|
||||
<button class="login-social-button full-width">
|
||||
{{ _('Sign up with %(identity_provider)s', identity_provider="GitHub") }}
|
||||
{{ _('Sign up with %(identity_provider)s', identity_provider=backend.display_name) }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -158,6 +158,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
|
|||
'name': backend.name,
|
||||
'display_name': backend.auth_backend_name,
|
||||
'login_url': reverse('login-social', args=(backend.name,)),
|
||||
'signup_url': reverse('signup-social', args=(backend.name,)),
|
||||
'sort_order': backend.sort_order,
|
||||
})
|
||||
context['social_backends'] = sorted(social_backends, key=lambda x: x['sort_order'])
|
||||
|
|
Loading…
Reference in New Issue