[geeklog-cvs] geeklog: newpro: Styled user login form

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Mar 22 18:29:48 EDT 2012


changeset 8543:bcb520dc928a
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/bcb520dc928a
user: Rouslan Placella <rouslan at placella.com>
date: Thu Mar 22 21:58:16 2012 +0000
description:
newpro: Styled user login form

diffstat:

 language/english_utf-8.php                      |   4 +-
 public_html/layout/newpro/css/form.css          |   1 +
 public_html/layout/newpro/css/users/users.css   |  68 ++++++++++++++++++++++--
 public_html/layout/newpro/users/loginform.thtml |  64 +++++++++++++---------
 public_html/layout/newpro/users/services.thtml  |   4 +-
 system/lib-security.php                         |   9 +++
 6 files changed, 113 insertions(+), 37 deletions(-)

diffs (256 lines):

diff -r b8f2df9ad0a7 -r bcb520dc928a language/english_utf-8.php
--- a/language/english_utf-8.php	Thu Mar 15 00:14:36 2012 +0000
+++ b/language/english_utf-8.php	Thu Mar 22 21:58:16 2012 +0000
@@ -401,7 +401,9 @@
     163 => 'Re-Authentication Failed',
     164 => 'You have exceeded the number of allowed attempts for re-authentication. The operation has been aborted and your recent changes were lost, sorry.',
     165 => 'Use Advanced Editor', 
-    166 => 'Re-synch Remote Account'
+    166 => 'Re-synch Remote Account',
+    167 => 'Remote login',
+    168 => 'You may also login with one on of the below remote authentication services'
 );
 
 ###############################################################################
diff -r b8f2df9ad0a7 -r bcb520dc928a public_html/layout/newpro/css/form.css
--- a/public_html/layout/newpro/css/form.css	Thu Mar 15 00:14:36 2012 +0000
+++ b/public_html/layout/newpro/css/form.css	Thu Mar 22 21:58:16 2012 +0000
@@ -70,6 +70,7 @@
 
 /* Input sizing */
 form#loginform input,
+form#loginform select,
 form.third-party-login input {
   width: 100%;
   -webkit-box-sizing: border-box;
diff -r b8f2df9ad0a7 -r bcb520dc928a public_html/layout/newpro/css/users/users.css
--- a/public_html/layout/newpro/css/users/users.css	Thu Mar 15 00:14:36 2012 +0000
+++ b/public_html/layout/newpro/css/users/users.css	Thu Mar 22 21:58:16 2012 +0000
@@ -1,6 +1,7 @@
 /*==============================================================================
   Title       : Account Information Page Templates
-  Author      : Fumito Arakawa as Phize (http://phize.net/) and Geeklog Japanese
+  Authors     : Fumito Arakawa as Phize (http://phize.net/) and Geeklog Japanese
+                Rouslan Placella rouslan at placella.com
   Description : Account information page style.
   Apply       : users/profile.thtml, users/commentrow.thtml, users/storyrow.thtml,
                 users/loginform.thtml, users/registrationform.thtml,
@@ -11,24 +12,77 @@
 
 
 /*--------------------------------------
-  User Login Form 
+  User Login Form
 --------------------------------------*/
 
-form#userloginform ul.submit {
-  margin-bottom: 1em;
+div.login-wrapper {
+  width: 50%;
+  margin: auto;
+}
+
+div.login-wrapper.remote-login-enabled {
+  width: 95%;
+  margin: auto;
+}
+
+div.standard-login-panel {
+  width: 100%;
+}
+
+div.remote-login-panel {
+  display: none;
+}
+
+div.standard-login-panel.remote-login-enabled,
+div.remote-login-panel.remote-login-enabled {
+  display: block;
+  width: 47%;
+  margin-left:2%;
+  float: left;
+}
+
+div.remote-login-panel p.message {
+  margin: 0 0 1em;
+}
+
+div.remote-login-panel div.wrapper{
+  width: 164px;
+  margin: auto;
+}
+
+div.standard-login-panel label {
+  margin-right: 1em;
+  float: right;
+  line-height: 1.8em;
+}
+
+div.standard-login-panel input,
+div.standard-login-panel select {
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+  width: 50%;
+  float: right;
+  height: 1.8em;
+}
+
+div.standard-login-panel input.submit {
+  height: 28px;
+  font-size: 12px;
 }
 
 /* Form Option Menu */
-form#userloginform ul.navi {
+div.standard-login-panel ul.navi {
   list-style-position: outside;
   list-style-type: none;
-  margin: 0;
+  margin: 1em 0 0;
   padding: 0;
 }
 
-form#userloginform ul.navi li {
+div.standard-login-panel ul.navi li {
   margin: 0;
   padding: 0;
+  text-align: center;
 }
 
 
diff -r b8f2df9ad0a7 -r bcb520dc928a public_html/layout/newpro/users/loginform.thtml
--- a/public_html/layout/newpro/users/loginform.thtml	Thu Mar 15 00:14:36 2012 +0000
+++ b/public_html/layout/newpro/users/loginform.thtml	Thu Mar 22 21:58:16 2012 +0000
@@ -2,34 +2,44 @@
 <!-- users/loginform.thtml { -->
 
 {start_block_loginagain}
-  <form action="{site_url}/users.php" method="post" id="userloginform" class="compact">
+<div class="login-wrapper {remote_login_class}">
+  <div class="standard-login-panel {remote_login_class}">
+    <form action="{site_url}/users.php" method="post" id="userloginform" class="compact">
+      <fieldset>
+        <legend>{lang_login}</legend>
+
+        <p class="message">{lang_message}</p>
+
+          <input type="text" size="16" name="loginname" id="loginform-loginname" class="text"{xhtml}>        
+          <label for="loginform-loginname">{lang_username}</label>
+          <div style="clear:both"></div>
+          {services}
+          <div style="clear:both"></div>
+          <input type="password" size="16" name="passwd" id="loginform-passwd" class="text"{xhtml}>
+          <label for="loginform-passwd">{lang_password}</label>
+          <div style="clear:both"></div>
+          <input type="submit" value="{lang_login}" class="submit"{xhtml}>
+          <div style="clear:both"></div>
+
+        <ul class="navi">
+          <li>{lang_newreglink}</li>
+          <li><a href="{site_url}/users.php?mode=getpassword" rel="nofollow">{lang_forgetpassword}</a></li>
+        </ul>
+     </fieldset>
+    </form>
+  </div>
+  <div class="remote-login-panel {remote_login_class}">
     <fieldset>
-      <legend>{lang_login}</legend>
-
-      <p class="message">{lang_message}</p>
-
-      <dl>
-        <dt><label for="loginform-loginname">{lang_username}</label></dt>
-        <dd><input type="text" size="16" name="loginname" id="loginform-loginname" class="text"{xhtml}></dd>
- 
-        {services}
- 
-        <dt><label for="loginform-passwd">{lang_password}</label></dt>
-        <dd><input type="password" size="16" name="passwd" id="loginform-passwd" class="text"{xhtml}></dd>
-      </dl>
- 
-      <ul class="submit">
-        <li><input type="submit" value="{lang_login}" class="submit"{xhtml}></li>
-      </ul>
- 
-      <ul class="navi">
-        <li>{lang_newreglink}</li>
-        <li><a href="{site_url}/users.php?mode=getpassword" rel="nofollow">{lang_forgetpassword}</a></li>
-      </ul>
-   </fieldset>
-  </form>
-  {openid_login}
-  {oauth_login}
+      <legend>{lang_remote_login}</legend>
+      <p class="message">{lang_remote_login_desc}</p>
+        <div class="wrapper">
+          {oauth_login}
+          {openid_login}
+        </div>
+     </fieldset>
+  </div>
+  <div style="clear:both"></div>
+</div>
 {end_block}
 
 <!-- } users/loginform.thtml -->
diff -r b8f2df9ad0a7 -r bcb520dc928a public_html/layout/newpro/users/services.thtml
--- a/public_html/layout/newpro/users/services.thtml	Thu Mar 15 00:14:36 2012 +0000
+++ b/public_html/layout/newpro/users/services.thtml	Thu Mar 22 21:58:16 2012 +0000
@@ -1,7 +1,7 @@
 
 <!-- users/services.thtml { -->
 
-<dt><label for="service">{lang_service}</label></dt>
-<dd>{select_service}</dd>
+{select_service}
+<label for="service">{lang_service}</label>
 
 <!-- } users/services.thtml -->
diff -r b8f2df9ad0a7 -r bcb520dc928a system/lib-security.php
--- a/system/lib-security.php	Thu Mar 15 00:14:36 2012 +0000
+++ b/system/lib-security.php	Thu Mar 22 21:58:16 2012 +0000
@@ -1805,6 +1805,7 @@
 
     $retval = '';
 
+    $have_remote_login = false;
     $default_config = array(
         // display options
         'hide_forgotpw_link' => false,
@@ -1852,6 +1853,8 @@
         $loginform->set_var('forgetpassword_link', $forget);
     }
     $loginform->set_var('lang_login', $config['button_text']);
+    $loginform->set_var('lang_remote_login', $LANG04[167]);
+    $loginform->set_var('lang_remote_login_desc', $LANG04[168]);
     $loginform->set_var('end_block', COM_endBlock());
 
     // 3rd party remote authentification.
@@ -1896,6 +1899,7 @@
     if (!$config['no_openid_login'] && $_CONF['user_login_method']['openid'] &&
             ($_CONF['usersubmission'] == 0) &&
             !$_CONF['disable_new_user_registration']) {
+        $have_remote_login = true;
         $_SCRIPTS->setJavascriptFile('login', '/javascript/login.js');
         $loginform->set_file('openid_login', '../loginform_openid.thtml');
         $loginform->set_var('lang_openid_login', $LANG01[128]);
@@ -1918,6 +1922,7 @@
     if (!$config['no_oauth_login'] && $_CONF['user_login_method']['oauth'] && 
             ($_CONF['usersubmission'] == 0) &&
             !$_CONF['disable_new_user_registration']) {
+        $have_remote_login = true;
         $_SCRIPTS->setJavascriptFile('login', '/javascript/login.js');
         $modules = SEC_collectRemoteOAuthModules();
         if (count($modules) == 0) {
@@ -1939,6 +1944,10 @@
         $loginform->set_var('oauth_login', '');
     }
 
+    if ($have_remote_login) {
+        $loginform->set_var('remote_login_class', 'remote-login-enabled');
+    }
+
     if (! $config['no_plugin_vars']) {
         PLG_templateSetVars('loginform', $loginform);
     }



More information about the geeklog-cvs mailing list