summaryrefslogtreecommitdiffstats
path: root/forum/skins/default/templates/auth/signin.html
blob: 78e6c76df8c2112a8ca20c6909649a5f6b383a31 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{% extends "base.html" %}

{% load i18n %}
{% load extra_tags %}

{% block forejs %}
    <link rel="stylesheet" type="text/css" media="screen" href="{% media "/media/style/auth.css" %}"/>
    {% for provider in all_providers %}
        {% for location in provider.extra_css %}
            <link rel="stylesheet" type="text/css" media="screen" href="{{ location }}"/>
        {% endfor %}
    {% endfor %}
{% endblock %}

{% block content %}
    {% for provider in all_providers %}
        {% if provider.pre_code %}
            {{ provider.pre_code|safe }}
        {% endif %}
    {% endfor %}
    <div class="headNormal">
	    {% trans "User login" %}
    </div>
    {% if msg %}
        <p class="warning">{{ msg }}</p>
    {% endif %}

    <div style="width:600px;float:left;margin-bottom:5px;">
        {% trans "Click to sign in through any of these services." %}
    </div>
    {% if request.user.is_anonymous %}
        <div style="width:600px;float:left;margin-bottom:5px;">
            <input type="checkbox" checked="checked" id="validate_email" />
            {% trans "Take the oppurtunity to validate my email next to the external provider I choose." %}
        </div>
    {% endif %}
    <div id="bigicon_providers">
        {% for provider in bigicon_providers %}
            <div class="provider_logo big" name="{{ provider.id }}">
                {% ifequal provider.type "DIRECT" %}
                    <a class="provider_direct" href="{% url auth_provider_signin provider=provider.id %}">
                        <img src="{% media provider.icon %}" />
                    </a>
                {% endifequal %}
                {% ifequal provider.type "CUSTOM" %}
                    {% include provider.code_template %}
                {% endifequal %}
                {% ifequal provider.type "SIMPLE_FORM" %}
                    <img alt="{{ provider.simple_form_context.your_what }}" class="simple_form_provider" src="{% media provider.icon %}" />
                {% endifequal %}
            </div>
        {% endfor %}
    </div>
    <div id="smallicon_providers">
        {% for provider in smallicon_providers %}
            <div class="provider_logo small" name="{{ provider.id }}">
                {% ifequal provider.type "DIRECT" %}
                    <a class="provider_direct" href="{% url auth_provider_signin provider=provider.id %}">
                        <img src="{% media provider.icon %}" />
                    </a>
                {% endifequal %}
                {% ifequal provider.type "CUSTOM" %}
                    {% include provider.code_template %}
                {% endifequal %}
                {% ifequal provider.type "SIMPLE_FORM" %}
                    <img alt="{{ provider.simple_form_context.your_what }}" class="simple_form_provider" src="{% media provider.icon %}" />
                {% endifequal %}
            </div>
        {% endfor %}
    </div>
    <form name="signin_form" id="signin_form" class="signin_form" method="POST" action="">
        <div id="signin_form_slot"></div>
        <input type="hidden" class="validate_email" name="validate_email" value="yes" />
    </form>
    {% for provider in stackitem_providers %}
        <h3 class="or_label">{% trans 'Or...' %}</h3>
        <form class="signin_form" method="POST" action="{% url auth_provider_signin provider=provider.id %}">
            {% include provider.stack_item_template %}
            <input type="hidden" class="validate_email" name="validate_email" value="yes" />
        </form>
    {% endfor %}
    <h3 class="or_label">{% trans 'Or...' %}</h3>
    <fieldset>
        {% trans 'Click' %} <a href="{% url auth_request_tempsignin %}">here</a> {% trans "if you're having troubles signing in." %}
    </fieldset>
    <script type="text/html" id="simple_form_template">
        <fieldset id="slot_form">
              <p id="provider_name_slot">{% trans 'Enter your ' %}%%YOUR_WHAT%%</p>
              <div><p><span></span>
                    <input id="input_field" type="text" name="input_field" /><span></span>
                    <input id="ssignin" name="ssignin" type="submit" value="Login" />
              </p></div>
              <input type="hidden" class="validate_email" name="validate_email" value="yes" />
          </fieldset>
    </script>
    <script type="text/javascript">
        $(function() {
            var signin_url = "{% url auth_provider_signin provider='PROVIDER' %}";

            function set_validate_email() {
                var validate = $('#validate_email').attr('checked') ? 'yes' : 'no';
                $('.validate_email').attr('value', validate);

                $('.provider_direct').each(function() {
                    var current_url = $(this).attr('href');
                    if (!/\?validate_email\=(yes|no)$/.test(current_url)) {
                        current_url += ('?validate_email=' + validate);
                    } else {
                        current_url = current_url.replace(/(yes|no)$/, validate);
                    }

                    $(this).attr('href', current_url);
                })
            }

            $('#validate_email').change(set_validate_email);

            function set_form_action(el) {
                var provider = el.parents('.provider_logo').attr('name');
                $('#signin_form').attr('action', signin_url.replace('PROVIDER', provider));
            }

            $('.provider_logo').click(function() {
                $('.provider_logo').removeClass('selected');
                $(this).addClass('selected');
            });

            $('.simple_form_provider').click(function() {
                $('#signin_form_slot').html('');
                var new_html = $('#simple_form_template').html()
                    .replace('%%YOUR_WHAT%%', $(this).attr('alt'));
                $('#signin_form_slot').html(new_html);
                set_form_action($(this));
                set_validate_email();
            })

            set_validate_email();
        });
    </script>
{% endblock %}

{% block sidebar %}
<div class="boxC">
    <h3 class="subtitle">{% trans "Why use OpenID?" %}</h3>
    <ul class="list-item">
        <li>
		{% trans "with openid it is easier" %}
        </li>
        <li>
		{% trans "reuse openid" %}
        </li>
        <li>
		{% trans "openid is widely adopted" %}
        </li>
        <li>
		{% trans "openid is supported open standard" %}
        </li>

    </ul>
    <p class="info-box-follow-up-links">
        <a href="http://openid.net/what/" target="_blank">{% trans "Find out more" %} </a><br/>
        <a href="http://openid.net/get/" target="_blank">{% trans "Get OpenID" %} </a>
    </p>
</div>
{% endblock%}