From a53c7bf623f7a08706eaf73de44380fbf11b14ad Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 9 May 2010 17:03:51 +0100 Subject: [PATCH] Rework the signup page --- app/controllers/user_controller.rb | 2 +- app/helpers/user_helper.rb | 4 + app/views/user/login.html.erb | 5 +- app/views/user/new.html.erb | 103 ++++++++++++------ config/locales/en.yml | 15 ++- public/images/openid-16x16.gif | Bin 328 -> 0 bytes public/images/openid-inputicon.gif | Bin 237 -> 0 bytes public/images/openid_input.png | Bin 0 -> 293 bytes .../{openid_logo.png => openid_large.png} | Bin public/images/openid_small.png | Bin 0 -> 316 bytes public/stylesheets/common.css | 13 ++- 11 files changed, 93 insertions(+), 49 deletions(-) delete mode 100644 public/images/openid-16x16.gif delete mode 100644 public/images/openid-inputicon.gif create mode 100644 public/images/openid_input.png rename public/images/{openid_logo.png => openid_large.png} (100%) create mode 100644 public/images/openid_small.png diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 923a6cfec..b558311d2 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -326,7 +326,7 @@ class UserController < ApplicationController @openID = params['openid'] if !params['openid'].nil? - flash.now[:notice] = t 'user.new.openID association' + flash.now[:notice] = t 'user.new.openid association' end end diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index 006a3d32f..ce32e4c60 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -1,4 +1,8 @@ module UserHelper + def openid_logo + image_tag "openid_small.png", :alt => t('user.login.openid_logo_alt'), :class => "openid_logo" + end + def openid_button(name, url) link_to_function( image_tag("#{name}.png", :alt => t("user.login.openid_providers.#{name}.alt")), diff --git a/app/views/user/login.html.erb b/app/views/user/login.html.erb index 37b852a52..074031796 100644 --- a/app/views/user/login.html.erb +++ b/app/views/user/login.html.erb @@ -37,7 +37,7 @@

<%= t 'user.login.openid_heading' %>

<%= - link_to_function(image_tag("openid_logo.png", :alt => t("user.login.openid_providers.openid.title")), nil, :title => t("user.login.openid_providers.openid.title")) do |page| + link_to_function(image_tag("openid_large.png", :alt => t("user.login.openid_providers.openid.title")), nil, :title => t("user.login.openid_providers.openid.title")) do |page| page[:login_form][:user_openid_url].value = "http://" page[:openid_buttons].hide page[:openid_url].show @@ -55,8 +55,7 @@ diff --git a/app/views/user/new.html.erb b/app/views/user/new.html.erb index 7ac168eba..61bba4bbb 100644 --- a/app/views/user/new.html.erb +++ b/app/views/user/new.html.erb @@ -2,49 +2,88 @@ <% if Acl.find_by_address(request.remote_ip, :conditions => {:k => "no_account_creation"}) %> -

<%= t 'user.new.no_auto_account_create' %> -

+

<%= t 'user.new.no_auto_account_create' %>

-

<%= t 'user.new.contact_webmaster' %> -

+

<%= t 'user.new.contact_webmaster' %>

<% else %> -

<%= t 'user.new.fill_form' %> -

+

<%= t 'user.new.fill_form' %>

-

<%= t 'user.new.license_agreement' %> -

+

<%= t 'user.new.license_agreement' %>

<%= error_messages_for 'user' %> <% form_tag :action => 'save' do %> -<%= hidden_field_tag('referer', h(params[:referer])) unless params[:referer].nil? %> -
- <%= image_tag "openid-16x16.gif", :alt => t('user.login.openid_logo_alt') %> - <%= t 'user.login.openid' %> + <%= t 'user.login.openid', :logo => openid_logo %> <%= text_field(:user, :openid_url, { :size => 28, :maxlength => 255, :tabindex => 3, :class => "openid_url" }) %>
- - - - - - - - - - - <% if @openID %> - - - <% else %> - - - - - <% end %> - - -
<%= t 'user.new.email address' %><%= text_field('user', 'email',{:size => 50, :maxlength => 255, :tabindex => 1, :value => @email}) %>
<%= t 'user.new.confirm email address' %><%= text_field('user', 'email_confirmation',{:size => 50, :maxlength => 255, :tabindex => 2}) %>
<%= t 'user.new.not displayed publicly' %>
 
<%= t 'user.new.display name' %><%= text_field('user', 'display_name',{:size => 30, :maxlength => 255, :tabindex => 3, :value => @nickname}) %>
<%= t 'user.new.display name description' %>
 
<%= t 'user.new.password' %><%= password_field('user', 'pass_crypt',{:size => 30, :maxlength => 255, :tabindex => 4}) %>
<%= t 'user.new.confirm password' %><%= password_field('user', 'pass_crypt_confirmation',{:size => 30, :maxlength => 255, :tabindex => 5}) %>
 
<%= t 'user.new.openID' %><%= text_field('user', 'openid_url',{:size => 50, :maxlength => 255, :tabindex => 6, :value => @openID, :class => "openid_url"}) %>
<%= t 'user.new.openID description' %>
<%= link_to_function(t 'user.new.openID associate') { |page| page.hide 'openid-prompt'; page.show 'openid-url', 'openid-note', 'openid-note-2' } %>
 
+ <%= hidden_field_tag('referer', h(params[:referer])) unless params[:referer].nil? %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<%= t 'user.new.email address' %><%= text_field(:user, :email, { :size => 50, :maxlength => 255, :tabindex => 1, :value => @email }) %>
<%= t 'user.new.confirm email address' %><%= text_field(:user, :email_confirmation, { :size => 50, :maxlength => 255, :tabindex => 2 }) %>
<%= t 'user.new.not displayed publicly' %>
 
<%= t 'user.new.display name' %><%= text_field(:user, :display_name, { :size => 30, :maxlength => 255, :tabindex => 3, :value => @nickname }) %>
<%= t 'user.new.display name description' %>
 
<%= t 'user.new.openid', :logo => openid_logo %><%= text_field(:user, :openid_url, { :size => 50, :maxlength => 255, :tabindex => 4, :value => @openID, :class => "openid_url" }) %>
 
<%= t 'user.new.password' %><%= password_field(:user, :pass_crypt, { :size => 30, :maxlength => 255, :tabindex => 5 }) %>
<%= t 'user.new.confirm password' %><%= password_field(:user, :pass_crypt_confirmation, { :size => 30, :maxlength => 255, :tabindex => 6 }) %>
+ <%= link_to_function(t('user.new.use openid', :logo => openid_logo)) { |page| page.hide 'openid_prompt'; page.show 'openid_spacer', 'openid_url', 'openid_note' } %> + <%= t 'user.new.openid no password' %> +
 
<%= submit_tag t('user.new.signup'), :tabindex => 6 %>
<% end %> +<%= + update_page_tag do |page| + page[:openid_spacer].hide unless @openID + page[:openid_url].hide unless @openID + page[:openid_note].hide unless @openID + page[:openid_prompt].hide if @openID + end +%> + <%= javascript_include_tag 'https://ethnio.com/remotes/62786' %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 569890f9b..7e6592165 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1485,7 +1485,7 @@ en: create_account: "create an account" email or username: "Email Address or Username:" password: "Password:" - openid: "OpenID:" + openid: "{{logo}} OpenID:" username_heading: "Login with username and password:" openid_heading: "Login with OpenID:" remember: "Remember me:" @@ -1548,20 +1548,19 @@ en: not displayed publicly: 'Not displayed publicly (see privacy policy)' display name: "Display Name:" display name description: "Your publicly displayed username. You can change this later in the preferences." + openid: "{{logo}} OpenID:" password: "Password:" confirm password: "Confirm Password:" - openID associate: "Associate an OpenID with your account" - openID: "OpenID:" - openID description: '(Optional) If you have an OpenID you can associate it with this account to login' - openID nopassword: "With OpenID, you don't need to specify a password during signup, but some extra OpenStreetMap services or tools may still need one" - openID association: | - Your OpenID is not associated with a OpenStreetMap account yet. + use openid: "Alternatively, use {{logo}} OpenID to login" + openid no password: "With OpenID a password is not required, but some extra tools or server may still need one." + openid association: | +

Your OpenID is not associated with a OpenStreetMap account yet.

signup: Signup diff --git a/public/images/openid-16x16.gif b/public/images/openid-16x16.gif deleted file mode 100644 index e2d8377db023a3915cc9e8c2f1f5c7462622f0a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 328 zcmZ?wbhEHb6krfwxXQrr>({UQ_wR4qxN*;(J#*&FS-N!TvSrKGuV4S?%F;i7{_Nbj z^V6qK`}XadJ9qBs)2Dx~3p;V*#MZ4_j~qF&aN)v#|Nb2~aNyvg9 ztXT2$=g%EGcI@80`{m1*Z{NOs{rdIFl`EeF4W-ruOthu2f ztl_Mdp@*QzZPDcui{^-N`o3xq@(UMrZh5FF-w`Y#$*8QNq^Zf+5a!Y$(d{Fk$;RMZ d?jf!z+?DC8mZr!$-G@O{mX$wbm9ry*H2@d`j5z=R diff --git a/public/images/openid-inputicon.gif b/public/images/openid-inputicon.gif deleted file mode 100644 index cde836c893f64bcfec04b9c817e3371ff122fe19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 237 zcmVb{bmUKcqz}))c5uC(7v?)v4a2P)ZNa- z@$&T2)z|&~{r~^}A^8LV00000EC2ui01yBW000GQ;3tk`X`bk)Wk@<6#nZYULKH{p zEx|?+kif!I0vIL|#ZMubBmjWH2OtmxIFVa~6JQ7!1CK!f5W#StOTv&C3=E8h2vI1s n+#cd5;2fT3B_0kF0v!+!GARoV78n&7dMN`JIW(4+BOw4gP{MS* diff --git a/public/images/openid_input.png b/public/images/openid_input.png new file mode 100644 index 0000000000000000000000000000000000000000..b5aa49dfaec71d4b4e6ec803bd2d73f39f94ce1c GIT binary patch literal 293 zcmV+=0owkFP)#dXhFr3uibMHI=yUr3<{Fgwvu%*@Eh$i&3Nz`(%1zP`M? zytufy`L0&9w6vFMd^<>lYs-`UyO z*Vos}%ge#R!M(k`{M4npySur$xwW;mHoyMp0001UNkld)Gp$V{& zCLqVp01{wOlb7a{VUXq!l9bW{2?(=Fs&aENaEMDX%0jdVNN5WxFbGL9Ld{_3QBoIE zWRR3pLN!!UQW;f%Pf~&t)ml+W79~`7@JdQCF{3z)Q$>?mL>fr|1pok}q!*2v6!fA1 O0000