From: Matt Amos Date: Mon, 26 Apr 2010 23:36:44 +0000 (+0100) Subject: Some styling changes. Changed drop-down into radio buttons. Tried, and failed, to... X-Git-Tag: live~6322^2~14 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/972278a223ac07b7a1f4c431706972b13ee76ef0?hp=4b2ac2ea2b4f914a87537c099f699a5351f22d82 Some styling changes. Changed drop-down into radio buttons. Tried, and failed, to get the 'decline' link to look like a button. --- diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 2e2571952..603fb2a49 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -22,8 +22,8 @@ class UserController < ApplicationController @title = t 'user.new.title' @user = User.new(params[:user]) - country_code = params[:legale] || OSM.IPToCountry(request.remote_ip) - @text = OSM.legal_text_for_country(country_code) + @legale = params[:legale] || OSM.IPToCountry(request.remote_ip) || APP_CONFIG['default_legale'] + @text = OSM.legal_text_for_country(@legale) if @user.invalid? render :action => 'new' diff --git a/app/views/user/terms.html.erb b/app/views/user/terms.html.erb index 23e2ba068..daa4396ff 100644 --- a/app/views/user/terms.html.erb +++ b/app/views/user/terms.html.erb @@ -2,19 +2,21 @@

<%= t 'user.terms.press accept button' %>

-

<%= t 'user.terms.legale_select' %> + <% form_tag :action => 'terms' do %> - -<% end %>

+

<%= t 'user.terms.legale_select' %>

+ <% [['france', 'FR'], ['italy', 'IT'], ['rest_of_world', 'GB']].each do |name,legale| %> + <%= radio_button_tag 'legale', legale, @legale == legale %> + <%= label_tag "legale_#{legale}", t('user.terms.legale_names.' + name) %>
+ <% end %> + <%= hidden_field_tag('referer', h(params[:referer])) unless params[:referer].nil? %> + <%= hidden_field('user', 'email') %> + <%= hidden_field('user', 'email_confirmation') %> + <%= hidden_field('user', 'display_name') %> + <%= hidden_field('user', 'pass_crypt') %> + <%= hidden_field('user', 'pass_crypt_confirmation') %> + <%= submit_tag(t('user.terms.legale_button')) %> +<% end %>

<%= @text['intro'] %>

@@ -62,7 +64,9 @@ <%= hidden_field('user', 'display_name') %> <%= hidden_field('user', 'pass_crypt') %> <%= hidden_field('user', 'pass_crypt_confirmation') %> - <%= t 'user.terms.decline' %> - <%= submit_tag(t('user.terms.button')) %> +
+ +
<%= submit_tag(t('user.terms.button'), :class => 'float_right') %>
+

<% end %> diff --git a/config/application.yml b/config/application.yml index 363cc6398..7b2c603f0 100644 --- a/config/application.yml +++ b/config/application.yml @@ -22,6 +22,8 @@ standard_settings: &standard_settings # Quova authentication details #quova_username: "" #quova_password: "" + # Default legale (jurisdiction location) for contributor terms + default_legale: GB development: <<: *standard_settings diff --git a/config/locales/en.yml b/config/locales/en.yml index 1f0e59e0a..9b5e4e171 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1404,16 +1404,20 @@ en: continue: Continue flash create success message: "User was successfully created. Check your email for a confirmation note, and you will be mapping in no time :-)

Please note that you will not be able to login until you've received and confirmed your email address.

If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests." terms: - heading: Contributor terms + heading: "Contributor terms" press accept button: "Please read the agreement below and press the agree button to activate your account." consider_pd: "I consider my contributions to be in the Public Domain" - consider_pd_why: what's this? + 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" decline: "Decline" legale_select: "Please select your country of residence:" legale_button: "Go" + legale_names: + france: "France" + italy: "Italy" + rest_of_world: "Rest of the world" no_such_user: title: "No such user" heading: "The user {{user}} does not exist" diff --git a/lib/osm.rb b/lib/osm.rb index 50e31a7ff..b5f3cb1aa 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -510,7 +510,7 @@ module OSM def self.legal_text_for_country(country_code) file_name = File.join(RAILS_ROOT, "config", "legales", country_code.to_s + ".yml") - file_name = File.join(RAILS_ROOT, "config", "legales", "GB.yml") unless File.exist? file_name + file_name = File.join(RAILS_ROOT, "config", "legales", APP_CONFIG['default_legale'] + ".yml") unless File.exist? file_name YAML::load_file(file_name) end diff --git a/public/stylesheets/common.css b/public/stylesheets/common.css index c5b98f3b3..362e5d619 100644 --- a/public/stylesheets/common.css +++ b/public/stylesheets/common.css @@ -739,3 +739,46 @@ abbr.geo { .table1 { 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 + */ +div.left_right_line { + text-align:right; + margin:1em 0; + padding:0; + width:80%; +} +div.left_right_line div { + display:inline; + white-space:nowrap +} +div.left_right_line div.left { + float:left +} +#content>div.left_right_line { + display:table; + width:60% +} +#content>div.left_right_line div { + display:table-cell +} +#content>div.left_right_line div.left { + float:none; + text-align:left +} +#content>div.left_right_line div.right { + text-align:right +} +