diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2013-04-26 18:59:42 +0200 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2013-04-26 18:59:42 +0200 |
commit | e3707c5b5326468a75ee8d983ff77fded1995d83 (patch) | |
tree | a32f5e03a0a142738f9d1d1db58a3edfcb2d9521 /hyperkitty/templates | |
parent | bf0271104e16ae44aac6d6393f98bc9f60e5ca4d (diff) | |
download | hyperkitty-e3707c5b5326468a75ee8d983ff77fded1995d83.tar.gz hyperkitty-e3707c5b5326468a75ee8d983ff77fded1995d83.tar.xz hyperkitty-e3707c5b5326468a75ee8d983ff77fded1995d83.zip |
Autodetect the enabled authentication backends
Diffstat (limited to 'hyperkitty/templates')
-rw-r--r-- | hyperkitty/templates/login.html | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/hyperkitty/templates/login.html b/hyperkitty/templates/login.html index 4a27031..fb82c44 100644 --- a/hyperkitty/templates/login.html +++ b/hyperkitty/templates/login.html @@ -15,36 +15,45 @@ <h2>Login with your email</h2> <ul class="social-login inline"> - <li class="browserid"> - <form method="post" action="{% url 'socialauth_complete' "browserid" %}?next={{ next }}"> - {% csrf_token %} - <input type="hidden" name="assertion" value="" /> - <a rel="nofollow" id="browserid" href="#" class="disabled"><img src="{{ STATIC_URL }}img/login/persona-large-disabled.png" alt="Login using Persona" /></a> - </form> - </li> - - <li><a title="Google" class="socialaccount_provider google" href="{% url 'socialauth_begin' backend='google' %}?next={{ next }}"><img src="{{ STATIC_URL }}img/login/google.png" alt="Google" /></a></li> - - <li><a title="Yahoo" class="socialaccount_provider yahoo" href="{% url 'socialauth_begin' backend='yahoo' %}?next={{ next }}"><img src="{{ STATIC_URL }}img/login/yahoo.png" alt="Yahoo" /></a></li> - - <li><a title="Fedora" class="socialaccount_provider fedora" href="{% url 'socialauth_begin' backend='fedora' %}?next={{ next }}"><img src="{{ STATIC_URL }}img/login/fedora.png" alt="Fedora" /></a></li> - - <li><a class="socialaccount_provider openid" href="#"><img src="{{ STATIC_URL }}img/login/openid.png" alt="OpenID" /></a> - <form method="post" action="{% url 'socialauth_begin' "openid" %}?next={{ next }}" class="form-inline openid"> - {% csrf_token %} - <div class="input-append"> - <input type="text" class="input-large" name="openid_identifier" placeholder="OpenID URL" /> - <button type="submit" class="btn">Login with OpenID</button> - </div> - </form> - </li> + {% for backend in backends %} + <li class="{{ backend }}"> + {% if backend == "browserid" %} + <form method="post" + action="{% url 'socialauth_complete' "browserid" %}?next={{ next }}"> + {% csrf_token %} + <input type="hidden" name="assertion" value="" /> + <a rel="nofollow" id="browserid" href="#" class="disabled"><img + src="{{ STATIC_URL }}img/login/persona-large-disabled.png" + alt="Login using Persona" /></a> + </form> + {% elif backend == "openid" %} + <a class="socialaccount_provider openid" title="OpenID" href="#"><img + src="{{ STATIC_URL }}img/login/openid.png" alt="OpenID" /></a> + <form method="post" class="form-inline openid" + action="{% url 'socialauth_begin' "openid" %}?next={{ next }}"> + {% csrf_token %} + <div class="input-append"> + <input type="text" class="input-large" name="openid_identifier" + placeholder="OpenID URL" /> + <button type="submit" class="btn">Login with OpenID</button> + </div> + </form> + {% else %} + <a title="{{ backend|title }}" class="socialaccount_provider {{ backend }}" + href="{% url 'socialauth_begin' backend=backend %}?next={{ next }}"><img + src="{{ STATIC_URL }}img/login/{{ backend }}.png" + alt="{{ backend|title }}" /></a> + {% endif %} + </li> + {% endfor %} </ul> {% if use_internal_auth %} <h2>Login with username and password</h2> -<form action="{{ request.path }}?next={{ next|urlencode }}" method="post" class="form-horizontal"> +<form action="{{ request.path }}?next={{ next|urlencode }}" + method="post" class="form-horizontal"> {% csrf_token %} {{ form|crispy }} <div class="control-group"> |