]> git.openstreetmap.org Git - rails.git/commitdiff
Try a different style for the OpenID login page
authorKai Krueger <kai@aiputerlx.(none)>
Tue, 27 Apr 2010 19:54:07 +0000 (20:54 +0100)
committerKai Krueger <kai@aiputerlx.(none)>
Tue, 27 Apr 2010 19:54:07 +0000 (20:54 +0100)
app/views/user/login.html.erb
config/locales/en.yml
public/images/google.gif [new file with mode: 0644]
public/images/myopenid.png [new file with mode: 0644]
public/images/myspace.png [new file with mode: 0644]
public/images/openid-inputicon.gif [new file with mode: 0644]
public/images/openid_logo.png [new file with mode: 0644]
public/images/wordpress.png [new file with mode: 0644]
public/images/yahoo.gif [new file with mode: 0644]
public/stylesheets/common.css
public/stylesheets/small.css

index e394a8c27f31ca377e26f18b468b7fc9251be8c4..6cac5cecb3d3ee107ea11233d5bbc9173d145b72 100644 (file)
@@ -1,16 +1,64 @@
+<script type="text/javascript">
+function openid_signin(provider)
+{
+    if (provider == 'google') {
+        document.forms[0].user_openid_url.value="gmail.com";
+        document.forms[0].submit();
+    } else if (provider == 'yahoo') {
+        document.forms[0].user_openid_url.value="yahoo.com";
+        document.forms[0].submit();
+    } else if (provider == 'myopenid') {
+        document.forms[0].user_openid_url.value="myopenid.com";
+        document.forms[0].submit();
+    } else if (provider == 'wordpress') {
+        document.forms[0].user_openid_url.value="wordpress.com";
+        document.forms[0].submit();
+    } else if (provider == 'myspace') {
+        document.forms[0].user_openid_url.value="myspace.com";
+        document.forms[0].submit();
+    } else if (provider == 'openid') {
+        document.forms[0].user_openid_url.value="http://";
+    }
+
+}
+</script> 
+
 <h1><%= t 'user.login.heading' %></h1>
 
 <p><%= t 'user.login.please login', :create_user_link => link_to(t('user.login.create_account'), :controller => 'user', :action => 'new', :referer => params[:referer]) %></p>
 
 <% form_tag :action => 'login' do %>
-<%= hidden_field_tag('referer', h(params[:referer])) %>
-<table id="loginForm">
-  <tr><td class="fieldName"><%= t 'user.login.email or username' %></td><td><%= text_field('user', 'email',{:value => "", :size => 28, :maxlength => 255, :tabindex => 1}) %></td></tr>
-  <tr><td class="fieldName"><%= t 'user.login.password' %></td><td><%= password_field('user', 'password',{:value => "", :size => 28, :maxlength => 255, :tabindex => 2}) %></td><td> <span class="minorNote">(<%= link_to t('user.login.lost password link'), :controller => 'user', :action => 'lost_password' %>)</span></td></tr>
-  <tr><td colspan = "3"><h4><I><%= t 'user.login.alternatively' %></I></h4></td></tr>
-  <tr><td class="fieldName"><%= t 'user.login.openid' %></td><td><%= text_field('user', 'openid_url',{:size => 28, :maxlength => 255, :tabindex => 3}) %></td><td> <span class="minorNote">(<a href="<%= t 'user.account.openid.link' %>" target="_new"><%= t 'user.account.openid.link text' %></a>)</span></td></tr>
-  <tr><td colspan="3">&nbsp;<!--vertical spacer--></td></tr>
-  <tr><td colspan="3">&nbsp;<!--vertical spacer--></td></tr>
-  <tr><td class="fieldName"><label for="remember_me"><%= t 'user.login.remember' %></label></td><td><%= check_box_tag "remember_me", "yes", false, :tabindex => 3 %></td><td align=right><%= submit_tag t('user.login.login_button'), :tabindex => 3 %></td></tr>
-</table>
+    <%= hidden_field_tag('referer', h(params[:referer])) %>
+    <div style="position: relative;">
+        <div class="loginBox">
+            <h3> <%= t 'user.login.username_heading' %></h3>
+            <table id="loginForm" width="100%">
+                <tr><td class="fieldName"><%= t 'user.login.email or username' %></td><td><%= text_field('user', 'email',{:value => "", :size => 28, :maxlength => 255, :tabindex => 1}) %></td></tr>
+                <tr><td class="fieldName"><%= t 'user.login.password' %></td><td><%= password_field('user', 'password',{:value => "", :size => 28, :maxlength => 255, :tabindex => 2}) %></td></tr>
+                <tr><td></td><td> <span class="minorNote">(<%= link_to t('user.login.lost password link'), :controller => 'user', :action => 'lost_password' %>)</span></td></tr>
+            </table>
+        </div>
+        <div style="float:left; width: 40px; padding: 10px;">
+            <P><%= t 'user.login.or' %></P>
+        </div>
+
+        <div class="loginBox">
+            <h3><%= t 'user.login.openid_heading' %></h3>
+            <table id="loginForm" width="100%">
+                <tr><td class="fieldName"><%= t 'user.login.openid' %></td><td><%= text_field('user', 'openid_url',{:size => 28, :maxlength => 255, :tabindex => 3}) %></td></tr><tr><td><td> <span class="minorNote">(<a href="<%= t 'user.account.openid.link' %>" target="_new"><%= t 'user.account.openid.link text' %></a>)</span></td></tr>
+            </table>
+            <a href="javascript: openid_signin('openid');";><%= image_tag "openid_logo.png", :alt => 'foo', :style => "border: solid; border-width: 1px" %></a>
+            <a href="javascript: openid_signin('yahoo');"><%= image_tag "yahoo.gif", :alt => 'foo', :style => "border: solid; border-width: 1px"%></a>
+            <a href="javascript: openid_signin('google');"><%= image_tag "google.gif", :alt => 'foo', :style => "border: solid; border-width: 1px" %></a><b>
+            <a href="javascript: openid_signin('myopenid');";><%= image_tag "myopenid.png", :alt => 'foo', :style => "border: solid; border-width: 1px" %></a>
+            <a href="javascript: openid_signin('wordpress');"><%= image_tag "wordpress.png", :alt => 'foo', :style => "border: solid; border-width: 1px"%></a>
+            <a href="javascript: openid_signin('myspace');"><%= image_tag "myspace.png", :alt => 'foo', :style => "border: solid; border-width: 1px" %></a><b>
+
+        </div>
+        <div style="clear: both">
+            <table id="loginForm">
+                <tr><td class="fieldName"><label for="remember_me"><%= t 'user.login.remember' %></label></td><td><%= check_box_tag "remember_me", "yes", false, :tabindex => 3 %></td><td align=right><%= submit_tag t('user.login.login_button'), :tabindex => 3 %></td></tr>
+            </table>
+        </div>
+    </div>
 <% end %>
index 02eff8f5608fbc8f2f2475aa621dff9c07594596..e6e0c6c0e47bb9e0077bd7653954436f1fde840b 100644 (file)
@@ -1375,7 +1375,9 @@ en:
       password: "Password:"
       openid: "OpenID:"
       openid description: "Use your OpenID to login"
-      alternatively: "Alternatively"
+      username_heading: "Login with username and password:"
+      openid_heading: "Login with an OpenID:"
+      or: "Or"
       remember: "Remember me:"
       lost password link: "Lost your password?"
       login_button: "Login"
diff --git a/public/images/google.gif b/public/images/google.gif
new file mode 100644 (file)
index 0000000..ed6ba10
Binary files /dev/null and b/public/images/google.gif differ
diff --git a/public/images/myopenid.png b/public/images/myopenid.png
new file mode 100644 (file)
index 0000000..78e4562
Binary files /dev/null and b/public/images/myopenid.png differ
diff --git a/public/images/myspace.png b/public/images/myspace.png
new file mode 100644 (file)
index 0000000..2fefe48
Binary files /dev/null and b/public/images/myspace.png differ
diff --git a/public/images/openid-inputicon.gif b/public/images/openid-inputicon.gif
new file mode 100644 (file)
index 0000000..cde836c
Binary files /dev/null and b/public/images/openid-inputicon.gif differ
diff --git a/public/images/openid_logo.png b/public/images/openid_logo.png
new file mode 100644 (file)
index 0000000..8a8a924
Binary files /dev/null and b/public/images/openid_logo.png differ
diff --git a/public/images/wordpress.png b/public/images/wordpress.png
new file mode 100644 (file)
index 0000000..9015498
Binary files /dev/null and b/public/images/wordpress.png differ
diff --git a/public/images/yahoo.gif b/public/images/yahoo.gif
new file mode 100644 (file)
index 0000000..078f309
Binary files /dev/null and b/public/images/yahoo.gif differ
index b6ee997125b7d98e04aa810ef81b756db7b41bcd..11a0d20ea3d55f9d0f0b761ace59e9dad38441d6 100644 (file)
@@ -739,3 +739,15 @@ abbr.geo {
 .table1 { 
   background: #fff;
 }
+
+/* Rules for Login page */
+.loginBox {
+  float: left;
+  width: 400px;
+  height: 200px;
+  margin-bottom: 40px;
+  border-style: solid;
+  border-width: 1px;
+  padding-left: 10px;
+  padding-right: 10px;
+}
index b11aebf69cf0688b0e0e964be8aaa20e64371fb8..82a93544b82b2b23250313128d6f58e65c375815 100644 (file)
@@ -109,3 +109,18 @@ h1 {
   width: 100%;
   max-width: 18em;
 }
+
+#loginForm input#user_openid_url {
+  width: 100%;
+  max-width: 18em;
+}
+
+/* Rules for Login page */
+.loginBox {
+  float: left;
+  width: 90%;
+  border-style: solid;
+  border-width: 1px;
+  padding-left: 10px;
+  padding-right: 10px;
+}
\ No newline at end of file