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