]> git.openstreetmap.org Git - rails.git/commitdiff
Make the decline button a real button
authorTom Hughes <tom@compton.nu>
Tue, 27 Apr 2010 09:45:49 +0000 (10:45 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 27 Apr 2010 09:45:49 +0000 (10:45 +0100)
Make the decline button on the terms page a real form submit button
and have the server redirect to the wiki as it's the only way to get
something that will actually look the same as a button on all the
different browsers.

app/controllers/user_controller.rb
app/views/user/terms.html.erb
config/locales/en.yml
public/stylesheets/common.css

index 27d124daeae3423e7bc22a4e1d50235f9b7a00d8..43a6db790bc8e25375f15bf0ef57778b31d9dc0f 100644 (file)
@@ -39,6 +39,8 @@ class UserController < ApplicationController
 
     if Acl.find_by_address(request.remote_ip, :conditions => {:k => "no_account_creation"})
       render :action => 'new'
 
     if Acl.find_by_address(request.remote_ip, :conditions => {:k => "no_account_creation"})
       render :action => 'new'
+    elsif params[:decline]
+      redirect_to t 'user.terms.declined'
     else
       @user = User.new(params[:user])
 
     else
       @user = User.new(params[:user])
 
index a370d4b48cc6a6b69383dca50c4533d30b352a86..5dac8f69284050f1ab480983594b61547b9eecd4 100644 (file)
@@ -39,8 +39,8 @@
     <%= hidden_field('user', 'pass_crypt') %>
     <%= hidden_field('user', 'pass_crypt_confirmation') %>
     <div class="left_right_line">
     <%= hidden_field('user', 'pass_crypt') %>
     <%= hidden_field('user', 'pass_crypt_confirmation') %>
     <div class="left_right_line">
-      <div class="left"><a class="looks_like_button" href="<%= t 'user.terms.exit_wiki' %>"><%= t 'user.terms.decline' %></a></div>
-      <div class="right"><%= submit_tag(t('user.terms.button'), :class => 'float_right') %></div>
+      <div class="left"><%= submit_tag(t('user.terms.decline'), :name => "decline") %></div>
+      <div class="right"><%= submit_tag(t('user.terms.agree'), :name => "agree") %></div>
     </div>
   </p>
 <% end %>
     </div>
   </p>
 <% end %>
index 420137984e02ea4a6a2bb3bcc5f9334a8d06a3cc..21931925a5f6a367d04133817bfd33b6a94751cc 100644 (file)
@@ -1409,8 +1409,8 @@ en:
       consider_pd: "I consider my contributions to be in the Public Domain"
       consider_pd_why: "what's this?"
       consider_pd_why_url: http://wiki.openstreetmap.org/wiki/Why_would_I_want_my_contributions_to_be_public_domain
       consider_pd: "I consider my contributions to be in the Public Domain"
       consider_pd_why: "what's this?"
       consider_pd_why_url: http://wiki.openstreetmap.org/wiki/Why_would_I_want_my_contributions_to_be_public_domain
-      button: Agree
-      exit_wiki: "http://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined"
+      agree: Agree
+      declined: "http://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined"
       decline: "Decline"
       legale_select: "Please select your country of residence:"
       legale_button: "Go"
       decline: "Decline"
       legale_select: "Please select your country of residence:"
       legale_button: "Go"
index 2c99cf0740b015b0c0b0ef37487192f5d0e23b26..d46013393a230ea2e3e71d5930d189fb69db0a33 100644 (file)
@@ -747,17 +747,6 @@ abbr.geo {
   background: #fff;
 }
 
   background: #fff;
 }
 
-/* rules for styling a link to look like a button to get around the difficulty 
- * of laying anything out properly in html. */
-
-a.looks_like_button {
-    color: black;
-    background: buttonface;
-    border: 1px solid black;
-    font-size: small;
-    padding: 1px;
-}
-
 /* hack to get left/right alignment on a line working. apparently still works in IE too.
  * shamelessly stolen from http://www.spartanicus.utvinternet.ie/left_and_right_alignment_using_css.htm
  */
 /* hack to get left/right alignment on a line working. apparently still works in IE too.
  * shamelessly stolen from http://www.spartanicus.utvinternet.ie/left_and_right_alignment_using_css.htm
  */