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