]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tpl/default/loginform.html
Apply v0.8.2 changes, add opensearch tpl, add favicon
[github/shaarli/Shaarli.git] / tpl / default / loginform.html
index b33219b69b3751590ad65ade61d4a0fef83067d9..dcc29676c3eca43cbc3c81e353aa04e3644df6b9 100644 (file)
@@ -5,7 +5,7 @@
 </head>
 <body>
 {include="page.header"}
-{if="!ban_canLogin()"}
+{if="!ban_canLogin($conf)"}
 <div class="pure-g pure-alert pure-alert-error pure-alert-closable center">
   <div class="pure-u-2-24"></div>
   <div class="pure-u-20-24">
       <form method="post" name="loginform">
         <h2 class="window-title">{'Login'|t}</h2>
         <div>
-          <input type="text" name="login" placeholder="{'Username'|t}" tabindex="20">
+          <input type="text" name="login" placeholder="{'Username'|t}"
+             {if="!empty($username)"}value="{$username}"{/if} class="autofocus" tabindex="20">
         </div>
         <div>
           <input type="password" name="password" placeholder="{'Password'|t}" tabindex="21">
         </div>
         <div class="remember-me">
-          <input type="checkbox" name="longlastingsession" id="longlastingsessionform" tabindex="22">
+          <input type="checkbox" name="longlastingsession" id="longlastingsessionform"
+             checked="checked" tabindex="22">
           <label for="longlastingsessionform">{'Remember me'|t}</label>
         </div>
         <div>
     </div>
     <div class="pure-u-lg-1-3 pure-u-1-8"></div>
   </div>
-
 {/if}
 
-
-</div>
-
 {include="page.footer"}
 <script>
-  document.getElementsByName('login')[1].focus();
+  {if="ban_canLogin($conf) && ! empty($username)"}
+    // Focus password on load if the username is set.
+    var passwords = document.getElementsByName('password');
+    if (passwords.length == 2) {
+        passwords[1].focus();
+    }
+  {/if}
 </script>
 </body>
 </html>