]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/auth/signin.html
798faeba267c4b95bfbae260149d4453f9867675
[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="warning">{{ 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 %}">\r
31             {% include provider.stack_item_template %}\r
32             <input type="hidden" class="validate_email" name="validate_email" value="yes" />\r
33         </form>\r
34     {% endfor %}\r
35     {% if top_stackitem_providers %}\r
36         <h3 class="or_label">{% trans 'Or...' %}</h3>\r
37     {% endif %}\r
38     <div style="width:600px;float:left;margin-bottom:5px;">\r
39         {% trans "Click to sign in through any of these services." %}\r
40     </div>\r
41     {% if request.user.is_anonymous %}\r
42         <div style="width:600px;float:left;margin-bottom:5px;">\r
43             <input type="checkbox" checked="checked" id="validate_email" />\r
44             {% trans "Validate my email after I login." %}\r
45         </div>\r
46     {% endif %}\r
47     <div id="bigicon_providers">\r
48         {% for provider in bigicon_providers %}\r
49             <div class="provider_logo big" name="{{ provider.id }}">\r
50                 {% ifequal provider.type "DIRECT" %}\r
51                     <a class="provider_direct" href="{% url auth_provider_signin provider=provider.id %}">\r
52                         <img src="{% media provider.icon %}" />\r
53                     </a>\r
54                 {% endifequal %}\r
55                 {% ifequal provider.type "CUSTOM" %}\r
56                     {% include provider.code_template %}\r
57                 {% endifequal %}\r
58                 {% ifequal provider.type "SIMPLE_FORM" %}\r
59                     <img alt="{{ provider.simple_form_context.your_what }}" class="simple_form_provider" src="{% media provider.icon %}" />\r
60                 {% endifequal %}\r
61             </div>\r
62         {% endfor %}\r
63     </div>\r
64     <div id="smallicon_providers">\r
65         {% for provider in smallicon_providers %}\r
66             <div class="provider_logo small" name="{{ provider.id }}">\r
67                 {% ifequal provider.type "DIRECT" %}\r
68                     <a class="provider_direct" href="{% url auth_provider_signin provider=provider.id %}">\r
69                         <img src="{% media provider.icon %}" />\r
70                     </a>\r
71                 {% endifequal %}\r
72                 {% ifequal provider.type "CUSTOM" %}\r
73                     {% include provider.code_template %}\r
74                 {% endifequal %}\r
75                 {% ifequal provider.type "SIMPLE_FORM" %}\r
76                     <img alt="{{ provider.simple_form_context.your_what }}" class="simple_form_provider" src="{% media provider.icon %}" />\r
77                 {% endifequal %}\r
78             </div>\r
79         {% endfor %}\r
80     </div>\r
81     <form name="signin_form" id="signin_form" class="signin_form" method="POST" action="">\r
82         <div id="signin_form_slot"></div>\r
83         <input type="hidden" class="validate_email" name="validate_email" value="yes" />\r
84     </form>\r
85     {% for provider in stackitem_providers %}\r
86         <h3 class="or_label">{% trans 'Or...' %}</h3>\r
87         <form class="signin_form" method="POST" action="{% url auth_provider_signin provider=provider.id %}">\r
88             {% include provider.stack_item_template %}\r
89             <input type="hidden" class="validate_email" name="validate_email" value="yes" />\r
90         </form>\r
91     {% endfor %}\r
92     <h3 class="or_label">{% trans 'Or...' %}</h3>\r
93     <fieldset>\r
94         {% trans 'Click' %} <a href="{% url auth_request_tempsignin %}">here</a> {% trans "if you're having troubles signing in." %}\r
95     </fieldset>\r
96     <script type="text/html" id="simple_form_template">\r
97         <fieldset id="slot_form">\r
98               <p id="provider_name_slot">{% trans 'Enter your ' %}%%YOUR_WHAT%%</p>\r
99               <div><p><span></span>\r
100                     <input id="input_field" type="text" name="input_field" /><span></span>\r
101                     <input id="ssignin" name="ssignin" type="submit" value="Login" />\r
102               </p></div>\r
103               <input type="hidden" class="validate_email" name="validate_email" value="yes" />\r
104           </fieldset>\r
105     </script>\r
106     <script type="text/javascript">\r
107         $(function() {\r
108             var signin_url = "{% url auth_provider_signin provider='PROVIDER' %}";\r
109 \r
110             function set_validate_email() {\r
111                 var validate = $('#validate_email').attr('checked') ? 'yes' : 'no';\r
112                 $('.validate_email').attr('value', validate);\r
113 \r
114                 $('.provider_direct').each(function() {\r
115                     var current_url = $(this).attr('href');\r
116                     if (!/\?validate_email\=(yes|no)$/.test(current_url)) {\r
117                         current_url += ('?validate_email=' + validate);\r
118                     } else {\r
119                         current_url = current_url.replace(/(yes|no)$/, validate);\r
120                     }\r
121 \r
122                     $(this).attr('href', current_url);\r
123                 })\r
124             }\r
125 \r
126             $('#validate_email').change(set_validate_email);\r
127 \r
128             function set_form_action(el) {\r
129                 var provider = el.parents('.provider_logo').attr('name');\r
130                 $('#signin_form').attr('action', signin_url.replace('PROVIDER', provider));\r
131             }\r
132 \r
133             $('.provider_logo').click(function() {\r
134                 $('.provider_logo').removeClass('selected');\r
135                 $(this).addClass('selected');\r
136             });\r
137 \r
138             $('.simple_form_provider').click(function() {\r
139                 $('#signin_form_slot').html('');\r
140                 var new_html = $('#simple_form_template').html()\r
141                     .replace('%%YOUR_WHAT%%', $(this).attr('alt'));\r
142                 $('#signin_form_slot').html(new_html);\r
143                 set_form_action($(this));\r
144                 set_validate_email();\r
145             })\r
146 \r
147             set_validate_email();\r
148         });\r
149     </script>\r
150 {% endblock %}\r
151 \r
152 {% block sidebar %}\r
153 <div class="boxC">\r
154     <h3 class="subtitle">{% trans "Why use OpenID?" %}</h3>\r
155     <ul class="list-item">\r
156         <li>\r
157                 {% trans "with openid it is easier" %}\r
158         </li>\r
159         <li>\r
160                 {% trans "reuse openid" %}\r
161         </li>\r
162         <li>\r
163                 {% trans "openid is widely adopted" %}\r
164         </li>\r
165         <li>\r
166                 {% trans "openid is supported open standard" %}\r
167         </li>\r
168 \r
169     </ul>\r
170     <p class="info-box-follow-up-links">\r
171         <a href="http://openid.net/what/" target="_blank">{% trans "Find out more" %} </a><br/>\r
172         <a href="http://openid.net/get/" target="_blank">{% trans "Get OpenID" %} </a>\r
173     </p>\r
174 </div>\r
175 {% endblock%}