From: Tom Hughes Date: Fri, 26 Mar 2010 18:55:17 +0000 (+0000) Subject: Present the contributor terms as part of the initial signup instead of X-Git-Tag: live~6842^2~17 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/898c47e647fbffcd0543b78033945b04f1b9aeae Present the contributor terms as part of the initial signup instead of during the account confirmation step. --- diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 83c414ef2..94a3e1142 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -18,6 +18,15 @@ class UserController < ApplicationController cache_sweeper :user_sweeper, :only => [:account, :hide, :unhide, :delete] + def terms + @title = t 'user.new.title' + @user = User.new(params[:user]) + + if @user.invalid? + render :action => 'new' + end + end + def save @title = t 'user.new.title' @@ -31,6 +40,7 @@ class UserController < ApplicationController @user.description = "" if @user.description.nil? @user.creation_ip = request.remote_ip @user.languages = request.user_preferred_languages + @user.terms_agreed = Time.now.getutc if @user.save flash[:notice] = t 'user.new.flash create success message' @@ -209,8 +219,6 @@ class UserController < ApplicationController @user = token.user @user.active = true @user.email_valid = true - @user.terms_agreed = Time.now.getutc - @user.consider_pd = true if params[:consider_pd] @user.save! referer = token.referer token.destroy diff --git a/app/views/user/confirm.html.erb b/app/views/user/confirm.html.erb index 068e6eeee..5a4106ee3 100644 --- a/app/views/user/confirm.html.erb +++ b/app/views/user/confirm.html.erb @@ -2,47 +2,9 @@

<%= t 'user.confirm.press confirm button' %>

-
-

<%= t 'legal.contributor_terms.intro' %>

-
    -
  1. -

    <%= t 'legal.contributor_terms.section_1' %>

    -
  2. -
  3. -

    <%= t 'legal.contributor_terms.section_2' %>

    -
  4. -
  5. -

    <%= t 'legal.contributor_terms.section_3' %>

    -

    <%= t 'legal.contributor_terms.active_defn_1' %>

    -

    <%= t 'legal.contributor_terms.active_defn_2' %>

    -
  6. -
  7. -

    <%= t 'legal.contributor_terms.section_4' %>

    -
  8. -
  9. -

    <%= t 'legal.contributor_terms.section_5' %>

    -
  10. -
  11. -

    <%= t 'legal.contributor_terms.section_6' %>

    -
      -
    1. <%= t 'legal.contributor_terms.section_6_1' %>

    2. -
    3. <%= t 'legal.contributor_terms.section_6_2' %>

    4. -
    -
  12. -
  13. -

    <%= t 'legal.contributor_terms.section_7' %>

    -
  14. -
-
-
-

- - - (<%= link_to(t('user.confirm.consider_pd_why'), t('user.confirm.consider_pd_why_url'), :target => :new)%>) -

-

- - -

+ +
+ + diff --git a/app/views/user/new.html.erb b/app/views/user/new.html.erb index bd85664c0..b086eabf3 100644 --- a/app/views/user/new.html.erb +++ b/app/views/user/new.html.erb @@ -18,7 +18,7 @@ <%= error_messages_for 'user' %> -<% form_tag :action => 'save' do %> +<% form_tag :action => 'terms' do %> <%= hidden_field_tag('referer', h(params[:referer])) unless params[:referer].nil? %> diff --git a/app/views/user/terms.html.erb b/app/views/user/terms.html.erb new file mode 100644 index 000000000..258b6e0b3 --- /dev/null +++ b/app/views/user/terms.html.erb @@ -0,0 +1,53 @@ +

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

+ +

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

+ +
+

<%= t 'legal.contributor_terms.intro' %>

+
    +
  1. +

    <%= t 'legal.contributor_terms.section_1' %>

    +
  2. +
  3. +

    <%= t 'legal.contributor_terms.section_2' %>

    +
  4. +
  5. +

    <%= t 'legal.contributor_terms.section_3' %>

    +

    <%= t 'legal.contributor_terms.active_defn_1' %>

    +

    <%= t 'legal.contributor_terms.active_defn_2' %>

    +
  6. +
  7. +

    <%= t 'legal.contributor_terms.section_4' %>

    +
  8. +
  9. +

    <%= t 'legal.contributor_terms.section_5' %>

    +
  10. +
  11. +

    <%= t 'legal.contributor_terms.section_6' %>

    +
      +
    1. <%= t 'legal.contributor_terms.section_6_1' %>

    2. +
    3. <%= t 'legal.contributor_terms.section_6_2' %>

    4. +
    +
  12. +
  13. +

    <%= t 'legal.contributor_terms.section_7' %>

    +
  14. +
+
+ +<% form_tag :action => 'save' do %> +

+ + <%= check_box('user', 'consider_pd') %> + (<%= link_to(t('user.terms.consider_pd_why'), t('user.terms.consider_pd_why_url'), :target => :new)%>) +

+

+ <%= 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.button')) %> +

+<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index c141dbe6e..9a5d0c792 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1403,6 +1403,13 @@ en: confirm password: "Confirm Password:" signup: Signup 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 + 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_url: http://wiki.openstreetmap.org/wiki/Why_would_I_want_my_contributions_to_be_public_domain + button: Agree no_such_user: title: "No such user" heading: "The user {{user}} does not exist" @@ -1494,11 +1501,8 @@ en: flash update success: "User information updated successfully." confirm: heading: Confirm a user account - press confirm 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_url: http://wiki.openstreetmap.org/wiki/Why_would_I_want_my_contributions_to_be_public_domain - button: Agree + press confirm button: "Press the confirm button below to activate your account." + button: Confirm success: "Confirmed your account, thanks for signing up!" failure: "A user account with this token has already been confirmed." confirm_email: diff --git a/config/routes.rb b/config/routes.rb index 0c0e62849..e2f95f7d7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -96,6 +96,7 @@ ActionController::Routing::Routes.draw do |map| map.connect '/offline', :controller => 'site', :action => 'offline' map.connect '/key', :controller => 'site', :action => 'key' map.connect '/user/new', :controller => 'user', :action => 'new' + map.connect '/user/terms', :controller => 'user', :action => 'terms' map.connect '/user/save', :controller => 'user', :action => 'save' map.connect '/user/confirm', :controller => 'user', :action => 'confirm' map.connect '/user/confirm-email', :controller => 'user', :action => 'confirm_email'
<%= t 'user.new.email address' %><%= text_field('user', 'email',{:size => 50, :maxlength => 255, :tabindex => 1}) %>