blob: 6c708bf12cdb6e0d8a7afad1ecb66e9b948b607c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
{% extends "base.html" %}
{% load i18n %}
{% block title %}
{% trans 'Login' %} - {{ app_name|title }}
{% endblock %}
{% block content %}
<div class="center">
<div id="loginform">
<h2>Login with username and password</h2>
<form action="" method="post" class="login mm_clear">
{% csrf_token %}
{{ form.as_p }}
<input type="hidden" name="next" value="{{ next }}" />
<div class="field">
<button class="btn btn-primary" type="submit">
{% trans "Login" %}
</button>
</div>
</form>
<ul class="socialLogin">
<li><a title="Google" class="socialaccount_provider google" href="{% url socialauth_begin backend='google' %}"><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' %}"><img src="{{ STATIC_URL }}img/login/yahoo.png" alt="Yahoo"></a></li>
<li>
<form method="post" action="{% url socialauth_complete "browserid" %}?{{redirect_querystring}}">
{% csrf_token %}
<input type="hidden" name="assertion" value="" />
<a rel="nofollow" id="browserid" href="#"><img src="{{ STATIC_URL }}img/login/browserid.png" alt="Login using BrowserID" /></a>
</form>
</li>
</ul>
</div>
</div>
{% endblock %}
{% block additionaljs %}
<!-- Include BrowserID JavaScript -->
<script src="https://browserid.org/include.js" type="text/javascript"></script>
<!-- Setup click handler that receives BrowserID assertion code and sends POST data -->
<script type="text/javascript">
$(function() {
$('#browserid').click(function(e) {
e.preventDefault();
var self = $(this);
navigator.id.get(function(assertion) {
if (assertion) {
self.parent('form').find('input[type=hidden]').attr('value', assertion).end().submit();
} else {
alert('Some error occurred');
}
});
});
});
</script>
<!-- end browserid stuff -->
{% endblock additionaljs %}
{# vim: set noet: #}
|