From c079c1f5746211fc543ffe8f57a076a1fdc5ad2a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 1 May 2010 19:18:06 +0100 Subject: [PATCH] Improve hiding of openid field on signup screen --- app/views/user/new.html.erb | 19 ++++++++----------- public/javascripts/openID.js | 5 ----- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/app/views/user/new.html.erb b/app/views/user/new.html.erb index ba068b6c3..8f4c6d603 100644 --- a/app/views/user/new.html.erb +++ b/app/views/user/new.html.erb @@ -1,5 +1,3 @@ -<%= javascript_include_tag 'openID.js' %> -

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

<% if Acl.find_by_address(request.remote_ip, :conditions => {:k => "no_account_creation"}) %> @@ -33,20 +31,19 @@ <%= 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}) %>   - Associate an OpenID with your account - <%= 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' %> + <% if @openID %> + <%= 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' %> + <% else %> + <%= link_to_function('Associate an OpenID with your account') { |page| page.hide 'openid-prompt'; page.show 'openid-url', 'openid-note' } %> + <%= 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' %> + <% end %>   <% end %> -<% if @openID %> - -<% end %> - <%= javascript_include_tag 'https://ethnio.com/remotes/62786' %> <% end %> diff --git a/public/javascripts/openID.js b/public/javascripts/openID.js index bc887666f..007ea0209 100644 --- a/public/javascripts/openID.js +++ b/public/javascripts/openID.js @@ -20,8 +20,3 @@ function openid_signin(provider) } } - -function unhideopenID() { - document.getElementById("openID_row-1").style.display = ""; - document.getElementById("openID_row-2").style.display = ""; -} -- 2.39.5