Add checkbox for contributor terms and improve text
This commit is contained in:
parent
fa81a608f7
commit
1be8d599e8
5 changed files with 32 additions and 21 deletions
|
@ -125,7 +125,11 @@ $(document).ready(function () {
|
||||||
$("#contributorTerms").load(url);
|
$("#contributorTerms").load(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#read_ct").on("click", function () {
|
||||||
|
$("#continue").prop("disabled", !($(this).prop("checked") && $("#read_tou").prop("checked")));
|
||||||
|
});
|
||||||
|
|
||||||
$("#read_tou").on("click", function () {
|
$("#read_tou").on("click", function () {
|
||||||
$("#agree").prop("disabled", !$(this).prop("checked"));
|
$("#continue").prop("disabled", !($(this).prop("checked") && $("#read_ct").prop("checked")));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -36,7 +36,7 @@ class UsersController < ApplicationController
|
||||||
def save
|
def save
|
||||||
@title = t "users.new.title"
|
@title = t "users.new.title"
|
||||||
|
|
||||||
if params[:decline] || !params[:read_tou]
|
if params[:decline] || !(params[:read_tou] && params[:read_ct])
|
||||||
if current_user
|
if current_user
|
||||||
current_user.terms_seen = true
|
current_user.terms_seen = true
|
||||||
|
|
||||||
|
|
|
@ -33,29 +33,35 @@
|
||||||
<%= render :partial => "terms" %>
|
<%= render :partial => "terms" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="deemphasize">
|
<div>
|
||||||
<p id="contributorGuidance">
|
<p id="contributorGuidance" class="deemphasize">
|
||||||
<%= raw t '.guidance',
|
<%= raw t '.guidance',
|
||||||
:summary => 'https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary',
|
:summary => 'https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary',
|
||||||
:translations => 'https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations' %>
|
:translations => 'https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations' %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<label for="read_ct">
|
||||||
|
<%= check_box_tag 'read_ct' %>
|
||||||
|
<%= t '.read_ct' %>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<label class="standard-label">
|
<label class="standard-label">
|
||||||
<%= t 'layouts.tou' %>
|
<%= t 'layouts.tou' %>
|
||||||
</label>
|
</label>
|
||||||
<p class="deemphasize"><%= t '.tou_explain' %></p>
|
<p class="deemphasize"><%= t '.tou_explain_html', :tou_link => link_to(t('layouts.tou'), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %></p>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="read_tou">
|
<label for="read_tou">
|
||||||
<%= check_box_tag 'read_tou' %>
|
<%= check_box_tag 'read_tou' %>
|
||||||
<%= t '.read_tou_html', :tou_link => link_to(t('layouts.tou'), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %>
|
<%= t '.read_tou' %>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<%= hidden_field_tag("referer", h(params[:referer])) unless params[:referer].nil? %>
|
<%= hidden_field_tag("referer", h(params[:referer])) unless params[:referer].nil? %>
|
||||||
|
|
||||||
<div class="buttons form-row inner20 clearfix">
|
<div class="buttons form-row inner20 clearfix">
|
||||||
<%= submit_tag(t('.agree'), :name => "agree", :id => "agree", :disabled => true) %>
|
<%= submit_tag("Continue", :name => "continue", :id => "continue", :disabled => true) %>
|
||||||
<%= submit_tag(t('.decline'), :name => "decline", :id => "decline") %>
|
<%= submit_tag("Cancel", :name => "decline", :id => "decline") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label for="user_consider_pd">
|
<label for="user_consider_pd">
|
||||||
|
|
|
@ -2030,15 +2030,16 @@ en:
|
||||||
title: "Terms"
|
title: "Terms"
|
||||||
heading: "Terms"
|
heading: "Terms"
|
||||||
heading_ct: "Contributor terms"
|
heading_ct: "Contributor terms"
|
||||||
read and accept with tou: "Please read the contributor agreement and the terms of use, check the checkbox when done and then press the agree button to confirm that you accept the terms of both documents."
|
read and accept with tou: "Please read the contributor agreement and the terms of use, check both checkboxes when done and then press the continue button."
|
||||||
contributor_terms_explain: "This agreement governs the terms for your existing and future contributions."
|
contributor_terms_explain: "This agreement governs the terms for your existing and future contributions."
|
||||||
tou_explain: "These terms govern the use of the website and other infrastructure provided by the OSMF."
|
read_ct: "I have read and agree to the above contributor terms"
|
||||||
read_tou_html: "I have read and agree to the %{tou_link}"
|
tou_explain_html: "These %{tou_link} govern the use of the website and other infrastructure provided by the OSMF. Please click on the link, read and aggree to the text."
|
||||||
|
read_tou: "I have read and agree to the Terms of Use"
|
||||||
consider_pd: "In addition to the above, I consider my contributions to be in the Public Domain"
|
consider_pd: "In addition to the above, 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: https://www.osmfoundation.org/wiki/License/Why_would_I_want_my_contributions_to_be_public_domain
|
consider_pd_why_url: https://www.osmfoundation.org/wiki/License/Why_would_I_want_my_contributions_to_be_public_domain
|
||||||
guidance: 'Information to help understand these terms: a <a href="%{summary}">human readable summary</a> and some <a href="%{translations}">informal translations</a>'
|
guidance: 'Information to help understand these terms: a <a href="%{summary}">human readable summary</a> and some <a href="%{translations}">informal translations</a>'
|
||||||
agree: Agree
|
continue: Continue
|
||||||
declined: "https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined"
|
declined: "https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined"
|
||||||
decline: "Decline"
|
decline: "Decline"
|
||||||
you need to accept or decline: "Please read and then either accept or decline the new Contributor Terms to continue."
|
you need to accept or decline: "Please read and then either accept or decline the new Contributor Terms to continue."
|
||||||
|
|
|
@ -221,7 +221,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
assert_difference "User.count", 1 do
|
assert_difference "User.count", 1 do
|
||||||
assert_difference "ActionMailer::Base.deliveries.size", 1 do
|
assert_difference "ActionMailer::Base.deliveries.size", 1 do
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
post :save, :session => { :new_user => user }, :params => { :read_tou => 1 }
|
post :save, :session => { :new_user => user }, :params => { :read_ct => 1, :read_tou => 1 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -245,7 +245,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
assert_no_difference "User.count" do
|
assert_no_difference "User.count" do
|
||||||
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
post :save, :session => { :new_user => user }, :params => { :read_tou => 1 }
|
post :save, :session => { :new_user => user }, :params => { :read_ct => 1, :read_tou => 1 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -262,7 +262,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
assert_no_difference "User.count" do
|
assert_no_difference "User.count" do
|
||||||
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
post :save, :session => { :new_user => user }, :params => { :read_tou => 1 }
|
post :save, :session => { :new_user => user }, :params => { :read_ct => 1, :read_tou => 1 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -279,7 +279,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
assert_no_difference "User.count" do
|
assert_no_difference "User.count" do
|
||||||
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
post :save, :session => { :new_user => user }, :params => { :read_tou => 1 }
|
post :save, :session => { :new_user => user }, :params => { :read_ct => 1, :read_tou => 1 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -296,7 +296,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
assert_no_difference "User.count" do
|
assert_no_difference "User.count" do
|
||||||
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
post :save, :session => { :new_user => user }, :params => { :read_tou => 1 }
|
post :save, :session => { :new_user => user }, :params => { :read_ct => 1, :read_tou => 1 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -313,7 +313,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
assert_no_difference "User.count" do
|
assert_no_difference "User.count" do
|
||||||
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
assert_no_difference "ActionMailer::Base.deliveries.size" do
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
post :save, :session => { :new_user => user }, :params => { :read_tou => 1 }
|
post :save, :session => { :new_user => user }, :params => { :read_ct => 1, :read_tou => 1 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -330,7 +330,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
post :save, :session => { :new_user => user,
|
post :save, :session => { :new_user => user,
|
||||||
:referer => "/edit?editor=id#map=1/2/3" },
|
:referer => "/edit?editor=id#map=1/2/3" },
|
||||||
:params => { :read_tou => 1 }
|
:params => { :read_ct => 1, :read_tou => 1 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -638,7 +638,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template :terms
|
assert_template :terms
|
||||||
|
|
||||||
post :save, :params => { :user => { :consider_pd => true }, :read_tou => 1 }
|
post :save, :params => { :user => { :consider_pd => true }, :read_ct => 1, :read_tou => 1 }
|
||||||
assert_response :redirect
|
assert_response :redirect
|
||||||
assert_redirected_to :action => :account, :display_name => user.display_name
|
assert_redirected_to :action => :account, :display_name => user.display_name
|
||||||
assert_equal "Thanks for accepting the new contributor terms!", flash[:notice]
|
assert_equal "Thanks for accepting the new contributor terms!", flash[:notice]
|
||||||
|
@ -659,7 +659,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template :terms
|
assert_template :terms
|
||||||
|
|
||||||
post :save, :params => { :user => { :consider_pd => true }, :referer => "/test", :read_tou => 1 }
|
post :save, :params => { :user => { :consider_pd => true }, :referer => "/test", :read_ct => 1, :read_tou => 1 }
|
||||||
assert_response :redirect
|
assert_response :redirect
|
||||||
assert_redirected_to "/test"
|
assert_redirected_to "/test"
|
||||||
assert_equal "Thanks for accepting the new contributor terms!", flash[:notice]
|
assert_equal "Thanks for accepting the new contributor terms!", flash[:notice]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue