]> git.openstreetmap.org Git - rails.git/commitdiff
Tweak the OpenID login page
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 27 Apr 2010 20:32:43 +0000 (20:32 +0000)
committerÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 27 Apr 2010 20:32:43 +0000 (20:32 +0000)
  * Replace 'foo' alt text with a real alt text and add title="" text
    too

  * Don't display an "Or" between the two, it's obvious from context
    that it's either-or

  * Display a small OpenID logo next to the login form (from
    http://openid.net/foundation/news/logos/)

  * Fix some indenting / HTML errors in the login table

  * Don't add border: 1px style to the OpenID provider logos. Prettier
    this way and doesn't include inline CSS

app/views/user/login.html.erb
config/locales/en.yml
public/images/openid-16x16.gif [new file with mode: 0644]

index 6cac5cecb3d3ee107ea11233d5bbc9173d145b72..c8cbdbaf28caeff1354ae3bf3bf1c5f29139de53 100644 (file)
@@ -38,23 +38,48 @@ function openid_signin(provider)
                 <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 style="float:left; width: 20px; padding: 10px;">
         </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>
+                <tr>
+                    <td class="fieldName">
+                        <%= image_tag "openid-16x16.gif", :alt => t('user.login.openid_logo_alt') %>
+                        <%= t 'user.login.openid' %>
+                    </td>
+                    <td><%= text_field('user', 'openid_url',{:size => 28, :maxlength => 255, :tabindex => 3}) %></td>
+                </tr>
+                <tr>
+                    <td></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>
-
+            <a href="javascript: openid_signin('openid');" title="<%= h(t 'user.login.openid_providers.openid.title') %>">
+                <%= image_tag "openid_logo.png", :alt => t('user.login.openid_providers.openid.title') %>
+            </a>
+            <a href="javascript: openid_signin('yahoo');" title="<%= h(t 'user.login.openid_providers.yahoo.title') %>">
+                <%= image_tag "yahoo.gif", :alt => t('user.login.openid_providers.yahoo.alt') %>
+            </a>
+            <a href="javascript: openid_signin('google');" title="<%= h(t 'user.login.openid_providers.google.title') %>">
+                <%= image_tag "google.gif", :alt => t('user.login.openid_providers.google.alt') %>
+            </a><b>
+            <a href="javascript: openid_signin('myopenid');" title="<%= h(t 'user.login.openid_providers.myopenid.title') %>">
+                <%= image_tag "myopenid.png", :alt => t('user.login.openid_providers.myopenid.alt') %>
+            </a>
+            <a href="javascript: openid_signin('wordpress');" title="<%= h(t 'user.login.openid_providers.wordpress.title') %>">
+                <%= image_tag "wordpress.png", :alt => t('user.login.openid_providers.wordpress.alt') %>
+            </a>
+            <a href="javascript: openid_signin('myspace');" title="<%= h(t 'user.login.openid_providers.myspace.title') %>">
+                <%= image_tag "myspace.png", :alt => t('user.login.openid_providers.myspace.alt') %>
+            </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>
index 8053e710ed00e1eaadc967095d958e6aec79c48f..8a8d3cdaa2e0c7fba147f3d7dac2a681a35b07dd 100644 (file)
@@ -1512,7 +1512,6 @@ en:
       openid description: "Use your OpenID to login"
       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"
@@ -1520,6 +1519,26 @@ en:
       auth failure: "Sorry, could not log in with those details."
       openid missing provider: "Sorry, could not contact your OpenID provider"
       openid invalid: "Sorry, your OpenID seems misformed"
+      openid_logo_alt: "Log in with an OpenID"
+      openid_providers:
+        openid:
+          title: Login with an OpenID URL
+          alt: Login with an OpenID URL
+        yahoo:
+          title: Login with a Yahoo! OpenID
+          alt: Login with a Yahoo! OpenID
+        google:
+          title: Login with a Google OpenID
+          alt: Login with a Google OpenID
+        myopenid:
+          title: Login with a myOpenID OpenID
+          alt: Login with a myOpenID OpenID
+        wordpress:
+          title: Login with a Wordpress.com OpenID
+          alt: Login with a Wordpress.com OpenID
+        myspace:
+          title: Login with a MySpace OpenID
+          alt: Login with a MySpace OpenID
     logout:
       title: "Logout"
       heading: "Logout from OpenStreetMap"
diff --git a/public/images/openid-16x16.gif b/public/images/openid-16x16.gif
new file mode 100644 (file)
index 0000000..e2d8377
Binary files /dev/null and b/public/images/openid-16x16.gif differ