From: Simon Poole Date: Tue, 2 Apr 2019 11:52:56 +0000 (+0200) Subject: Add checkbox for contributor terms and improve text X-Git-Tag: live~2569^2~4 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1be8d599e878c83305439a9b4d5273d72d9712d7 Add checkbox for contributor terms and improve text --- diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index 3803e180f..13941d6f3 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -125,7 +125,11 @@ $(document).ready(function () { $("#contributorTerms").load(url); }); + $("#read_ct").on("click", function () { + $("#continue").prop("disabled", !($(this).prop("checked") && $("#read_tou").prop("checked"))); + }); + $("#read_tou").on("click", function () { - $("#agree").prop("disabled", !$(this).prop("checked")); + $("#continue").prop("disabled", !($(this).prop("checked") && $("#read_ct").prop("checked"))); }); }); diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4b56dc033..e41330c4b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -36,7 +36,7 @@ class UsersController < ApplicationController def save @title = t "users.new.title" - if params[:decline] || !params[:read_tou] + if params[:decline] || !(params[:read_tou] && params[:read_ct]) if current_user current_user.terms_seen = true diff --git a/app/views/users/terms.html.erb b/app/views/users/terms.html.erb index ee74312f7..4e45671e1 100644 --- a/app/views/users/terms.html.erb +++ b/app/views/users/terms.html.erb @@ -33,29 +33,35 @@ <%= render :partial => "terms" %> -
-

+

+

<%= raw t '.guidance', :summary => 'https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary', :translations => 'https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations' %>

+
+ +
-

<%= t '.tou_explain' %>

+

<%= t '.tou_explain_html', :tou_link => link_to(t('layouts.tou'), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %>

<%= hidden_field_tag("referer", h(params[:referer])) unless params[:referer].nil? %>
- <%= submit_tag(t('.agree'), :name => "agree", :id => "agree", :disabled => true) %> - <%= submit_tag(t('.decline'), :name => "decline", :id => "decline") %> + <%= submit_tag("Continue", :name => "continue", :id => "continue", :disabled => true) %> + <%= submit_tag("Cancel", :name => "decline", :id => "decline") %>