]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/auth/signin.html
Validation email template bugfix
[osqa.git] / forum / skins / default / templates / auth / signin.html
1 {% extends "base.html" %}
2
3 {% load i18n %}
4 {% load extra_tags %}
5
6 {% block title %}{% spaceless %}{% trans "Login" %}{% endspaceless %}{% endblock %}
7
8 {% block forejs %}
9     <link rel="stylesheet" type="text/css" media="screen" href="{% media "/media/style/auth.css" %}"/>
10     {% for provider in all_providers %}
11         {% for location in provider.extra_css %}
12             <link rel="stylesheet" type="text/css" media="screen" href="{{ location }}"/>
13         {% endfor %}
14     {% endfor %}
15 {% endblock %}
16
17 {% block content %}
18     {% for provider in all_providers %}
19         {% if provider.pre_code %}
20             {{ provider.pre_code|safe }}
21         {% endif %}
22     {% endfor %}
23     <div class="headNormal">
24         {% trans "User login" %}
25     </div>
26     {% if msg %}
27         <p class="error">{{ msg }}</p>
28     {% endif %}
29     {% for provider in top_stackitem_providers %}
30         <form class="signin_form" method="POST" action="{% url "auth_provider_signin" provider=provider.id %}" accept-charset="utf-8">
31             {% csrf_token %}
32             {% include provider.stack_item_template %}
33             <input type="hidden" class="validate_email" name="validate_email" value="yes" />
34         </form>
35     {% endfor %}
36     {% if top_stackitem_providers %}
37         <h3 class="or_label">{% trans 'Or...' %}</h3>
38     {% endif %}
39     <div style="width:600px;float:left;margin-bottom:5px;">
40     {% blocktrans %}
41         External login services use <b><a href="http://openid.net/">OpenID</a></b> technology, where your password always stays confidential between
42         you and your login provider and you don't have to remember another one.
43     {% endblocktrans %}
44     </div>
45     {% if request.user.is_anonymous %}
46         <div style="width:600px;float:left;margin-bottom:5px;">
47             <input type="checkbox" checked="checked" id="validate_email" />
48             {% trans "Validate my email after I login." %}
49         </div>
50     {% endif %}
51     <div id="bigicon_providers">
52         {% for provider in bigicon_providers %}
53             <div class="provider_logo big" name="{{ provider.id }}">
54                 <div class="inner">
55                     {% ifequal provider.type "DIRECT" %}
56                         <a class="provider_direct" href="{% url "auth_provider_signin" provider=provider.id %}">
57                             <img src="{% media provider.icon %}" />
58                         </a>
59                     {% endifequal %}
60                     {% ifequal provider.type "CUSTOM" %}
61                         {% include provider.code_template %}
62                     {% endifequal %}
63                     {% ifequal provider.type "SIMPLE_FORM" %}
64                         <img alt="{{ provider.simple_form_context.your_what }}" class="simple_form_provider" src="{% media provider.icon %}" />
65                     {% endifequal %}
66                 </div>
67             </div>
68         {% endfor %}
69     </div>
70     <div id="smallicon_providers">
71         {% for provider in smallicon_providers %}
72             <div class="provider_logo small" name="{{ provider.id }}">
73                 <div class="inner">
74                     {% ifequal provider.type "DIRECT" %}
75                         <a class="provider_direct" href="{% url "auth_provider_signin" provider=provider.id %}">
76                             <img src="{% media provider.icon %}" />
77                         </a>
78                     {% endifequal %}
79                     {% ifequal provider.type "CUSTOM" %}
80                         {% include provider.code_template %}
81                     {% endifequal %}
82                     {% ifequal provider.type "SIMPLE_FORM" %}
83                         <img alt="{{ provider.simple_form_context.your_what }}" class="simple_form_provider" src="{% media provider.icon %}" />
84                     {% endifequal %}
85                 </div>
86             </div>
87         {% endfor %}
88     </div>
89     <form name="signin_form" id="signin_form" class="signin_form" method="POST" action="">
90         {% csrf_token %}
91         <div id="signin_form_slot"></div>
92         <input type="hidden" class="validate_email" name="validate_email" value="yes" />
93     </form>
94     {% for provider in stackitem_providers %}
95         <h3 class="or_label">{% trans 'Or...' %}</h3>
96         <form class="signin_form" method="POST" action="{% url "auth_provider_signin" provider=provider.id %}" accept-charset="utf-8">
97             {% csrf_token %}
98             {% include provider.stack_item_template %}
99             <input type="hidden" class="validate_email" name="validate_email" value="yes" />
100         </form>
101     {% endfor %}
102     <h3 class="or_label">{% trans 'Or...' %}</h3>
103     <form name="signin_form" id="dummy_form_unused" class="signin_form" method="POST" action="">
104         {% csrf_token %}
105         <fieldset>
106             {% trans 'Click' %} <a href="{% url "auth_request_tempsignin" %}">{% trans 'here' %}</a> {% trans "if you're having trouble signing in." %}
107         </fieldset>
108     </form>
109     <script type="text/html" id="simple_form_template">
110         <fieldset id="slot_form">
111               <p id="provider_name_slot">{% trans 'Enter your ' %}%%YOUR_WHAT%%</p>
112               <div><p><span></span>
113                     <input id="input_field" type="text" name="input_field" /><span></span>
114                     <input id="ssignin" name="ssignin" type="submit" value="Login" />
115               </p></div>
116               <input type="hidden" class="validate_email" name="validate_email" value="yes" />
117           </fieldset>
118     </script>
119     <script type="text/javascript">
120         $(function() {
121             var signin_url = "{% url "auth_provider_signin" provider='PROVIDER' %}";
122
123             function set_validate_email() {
124                 var validate = $('#validate_email').attr('checked') ? 'yes' : 'no';
125                 $('.validate_email').attr('value', validate);
126
127                 $('.provider_direct').each(function() {
128                     var current_url = $(this).attr('href');
129                     if (!/\?validate_email\=(yes|no)$/.test(current_url)) {
130                         current_url += ('?validate_email=' + validate);
131                     } else {
132                         current_url = current_url.replace(/(yes|no)$/, validate);
133                     }
134
135                     $(this).attr('href', current_url);
136                 })
137             }
138
139             $('#validate_email').change(set_validate_email);
140
141             function set_form_action(el) {
142                 var provider = el.parents('.provider_logo').attr('name');
143                 $('#signin_form').attr('action', signin_url.replace('PROVIDER', provider));
144             }
145
146             $('.provider_logo').click(function() {
147                 $('.provider_logo').removeClass('selected');
148                 $(this).addClass('selected');
149             });
150
151             $('.simple_form_provider').click(function() {
152                 $('#signin_form_slot').html('');
153                 var new_html = $('#simple_form_template').html()
154                     .replace('%%YOUR_WHAT%%', $(this).attr('alt'));
155                 $('#signin_form_slot').html(new_html);
156                 set_form_action($(this));
157                 set_validate_email();
158             })
159
160             set_validate_email();
161         });
162     </script>
163 {% endblock %}
164
165 {% block sidebar %}
166 <div class="boxC">
167     <h3 class="subtitle">{% trans "Why use OpenID?" %}</h3>
168     <ul class="list-item">
169         <li>
170             {% trans "with openid it is easier" %}
171         </li>
172         <li>
173             {% trans "reuse openid" %}
174         </li>
175         <li>
176             {% trans "openid is widely adopted" %}
177         </li>
178         <li>
179             {% trans "openid is supported open standard" %}
180         </li>
181
182     </ul>
183     <p class="info-box-follow-up-links">
184         <a href="http://openid.net/what/" target="_blank">{% trans "Find out more" %} </a><br/>
185         <a href="http://openid.net/get/" target="_blank">{% trans "Get OpenID" %} </a>
186     </p>
187 </div>
188 {% endblock%}