aboutsummaryrefslogtreecommitdiff
path: root/templates/login-selector.tmpl
blob: 3e7045c63d3b770fdd12a278a5470132cb0f8d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<script type="text/javascript" src="ikiwiki/jquery.min.js"></script>
<script type="text/javascript" src="ikiwiki/login-selector/login-selector.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	selector.init(
		'openid_identifier',
		{
			<TMPL_IF LOGIN_SELECTOR_OPENID>'openid': 1,</TMPL_IF>
			<TMPL_IF LOGIN_SELECTOR_EMAILAUTH>'email': 1,</TMPL_IF>
		},
		'<TMPL_IF OTHERFORM>otherform</TMPL_IF>',
		'<TMPL_VAR OTHERFORM_LABEL>'
	);
});
</script>

<form action="<TMPL_VAR CGIURL>" method="get" id="login_selector_form">
	<div>
		<script>
		$('fieldset').append("<legend>Select login method</legend>");
		</script>
		
		<input type="hidden" name="do" value="signin" />
		<input type="hidden" name="action" value="verify" />
		<div id="login_choice">
			<div id="login_btns"></div>
		</div>

		<div id="login_input_area">
		<TMPL_IF LOGIN_SELECTOR_OPENID>
			<div>
				<h3>OpenId login:</h3>
				<label for="openid_identifier" class="block">Enter your OpenID:</label>
				<input id="openid_identifier" name="openid_identifier" type="text" value="<TMPL_VAR ESCAPE=HTML OPENID_URL>"/>
				<input id="openid_submit" type="submit" value="Login"/>
			</div>
		</TMPL_IF>
		<TMPL_IF LOGIN_SELECTOR_EMAILAUTH>
			<div>
				<h3>Email login:</h3>
				<label for="email_address" class="block">Enter your email address:</label>
				<input id="email_address" name="Email_entry" type="text" value="<TMPL_VAR ESCAPE=HTML EMAIL_ADDRESS>"/>
				<input id="email_submit" type="submit" value="Login"/>
			</div>
		</TMPL_IF>
		</div>

		<TMPL_IF LOGIN_ERROR>
		<div class="error"><TMPL_VAR LOGIN_ERROR></div>
		</TMPL_IF>
		<TMPL_IF LOGIN_INFO>
		<TMPL_VAR LOGIN_INFO>
		</TMPL_IF>
	</div>
</form>

<div id="otherform">
<TMPL_IF OTHERFORM>
<br />
<noscript>
<h3><TMPL_VAR OTHERFORM_LABEL> login:</h3>
</noscript>
</TMPL_IF>
<TMPL_VAR OTHERFORM>
</div>