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