aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2015-05-13 17:51:29 -0400
committerJoey Hess <joeyh@joeyh.name>2015-05-13 17:51:29 -0400
commit7765941011a78e8062bc76ae3daba9aa56d279c8 (patch)
treeb64077c8e8bb4971863f4f6e3e0135aa1c6b9a06 /templates
parentab4d9a54677c2c17b186048ba5d86986a161bcef (diff)
downloadikiwiki-7765941011a78e8062bc76ae3daba9aa56d279c8.tar
ikiwiki-7765941011a78e8062bc76ae3daba9aa56d279c8.tar.gz
further generalization of openid selector
Now template variables can be set to control which login methods are shown
Diffstat (limited to 'templates')
-rw-r--r--templates/openid-selector.tmpl31
1 files changed, 25 insertions, 6 deletions
diff --git a/templates/openid-selector.tmpl b/templates/openid-selector.tmpl
index 03eb5d779..a055203a4 100644
--- a/templates/openid-selector.tmpl
+++ b/templates/openid-selector.tmpl
@@ -2,14 +2,18 @@
<script type="text/javascript" src="ikiwiki/openid/openid-jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
- selector.init('openid_identifier','<TMPL_IF OTHERFORM>otherform</TMPL_IF>', '<TMPL_VAR OTHERFORM_LABEL>');
+ selector.init(
+ 'openid_identifier',
+ {
+ <TMPL_IF LOGIN_SELECTOR_OPENID>'openid': 1,</TMPL_IF>
+ <TMPL_IF LOGIN_SELECTOR_EMAIL>'email': 1,</TMPL_IF>
+ },
+ '<TMPL_IF OTHERFORM>otherform</TMPL_IF>',
+ '<TMPL_VAR OTHERFORM_LABEL>'
+ );
});
</script>
-<noscript>
-<h2>Login:</h2>
-</noscript>
-
<form action="<TMPL_VAR CGIURL>" method="get" id="login_selector_form">
<div>
<script>
@@ -21,11 +25,26 @@ $(document).ready(function() {
<div id="login_choice">
<div id="login_btns"></div>
</div>
+
<div id="login_input_area">
+ <div>
+ <h3>OpenId login:</h3>
+ <TMPL_IF LOGIN_SELECTOR_OPENID>
<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"/>
+ </TMPL_IF>
</div>
+ <div>
+ <h3>Email login:</h3>
+ <TMPL_IF LOGIN_SELECTOR_EMAIL>
+ <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"/>
+ </TMPL_IF>
+ </div>
+ </div>
+
<TMPL_IF LOGIN_ERROR>
<div class="error"><TMPL_VAR LOGIN_ERROR></div>
</TMPL_IF>
@@ -36,7 +55,7 @@ $(document).ready(function() {
<TMPL_IF OTHERFORM>
<br />
<noscript>
-<h2><TMPL_VAR OTHERFORM_LABEL>:</h2>
+<h3><TMPL_VAR OTHERFORM_LABEL> login:</h3>
</noscript>
</TMPL_IF>
<TMPL_VAR OTHERFORM>