]> git.openstreetmap.org Git - rails.git/commitdiff
Add links to the ToU and include them in signup
authorSimon Poole <simon@poole.ch>
Sun, 21 Oct 2018 08:39:56 +0000 (10:39 +0200)
committerSimon Poole <simon@poole.ch>
Mon, 13 May 2019 14:52:18 +0000 (16:52 +0200)
- this adds links to the ToU in the Welcome box and on the About page
- adds a timestamp column to the users table to record acceptance of the ToU
- require ToU to be accepted before signup can proceed
- rearrange and change text on signup page

app/controllers/users_controller.rb
app/models/user.rb
app/views/layouts/map.html.erb
app/views/users/terms.html.erb
config/locales/en.yml
db/migrate/20181020114000_add_user_tou_agreed.rb [new file with mode: 0644]

index 9b97fa0a1f08af46d9d5657c12c75ad070acc052..e382f153144b2beaa72592a9ef08155ea6b6fcf1 100644 (file)
@@ -53,6 +53,7 @@ class UsersController < ApplicationController
     elsif current_user
       unless current_user.terms_agreed?
         current_user.consider_pd = params[:user][:consider_pd]
+        current_user.tou_agreed = Time.now.getutc
         current_user.terms_agreed = Time.now.getutc
         current_user.terms_seen = true
 
@@ -73,6 +74,7 @@ class UsersController < ApplicationController
         current_user.creation_ip = request.remote_ip
         current_user.languages = http_accept_language.user_preferred_languages
         current_user.terms_agreed = Time.now.getutc
+        current_user.tou_agreed = Time.now.getutc
         current_user.terms_seen = true
 
         if current_user.auth_uid.blank?
index 9f13108434793d9f027fe67ac7eab81c19324cd5..dbe91ab0f95997f7349b9d1e2c5c3bc4e665cb7e 100644 (file)
@@ -34,6 +34,7 @@
 #  image_content_type  :string
 #  auth_provider       :string
 #  home_tile           :integer
+#  tou_agreed          :datetime
 #
 # Indexes
 #
index 4d37cdfb8f4200a07185f99292395d5373ceffa2..b0d99893aa6bed0710c078e7f2f89862df6041b4 100644 (file)
                  :bytemark => link_to(t("layouts.partners_bytemark"), "https://www.bytemark.co.uk"),
                  :partners => link_to(t("layouts.partners_partners"), "https://hardware.openstreetmap.org/thanks/") %>
         </p>
-        <a class="button learn-more" href="<%= about_path %>"><%= t("layouts.learn_more") %></a>
-        <a class="button sign-up" href="<%= user_new_path %>"><%= t("layouts.start_mapping") %></a>
+        <p><%= t 'layouts.intro_tou_html', :tou_link => link_to(t('layouts.tou'), "https://wiki.osmfoundation.org/wiki/Terms_of_Use") %>
+        </p>      
+        <a class="button learn-more" href="<%= about_path %>"><%= t('layouts.learn_more') %></a>
+        <a class="button sign-up" href="<%= user_new_path %>"><%= t('layouts.start_mapping') %></a>
       </div>
     <% end %>
 
index a93ecb0a13a7805f34854c21a79d51a6ef4df043..18b86dd12582aa50c9415928dd9b0dfbf0ef2641 100644 (file)
@@ -9,7 +9,12 @@
 
 <%= form_tag({ :action => "save" }, { :class => " inner22 standard-form fillL" }) do %>
   <!-- legale is <%= @legale %> -->
+  <p class="deemphasize"><%= t '.read and accept' %></p>
+  <label class="standard-label">
+    <%= t '.heading_ct' %>
+  </label>
   <div class='form-row horizontal-list'>
+    <p class="deemphasize"><%= t '.contributor_terms_explain' %></p>
     <label class="standard-label">
       <%= t ".legale_select" %>
     </label>
     <%= render :partial => "terms" %>
   </div>
 
+  <div class="deemphasize">
+    <p id="contributorGuidance">
+      <%= raw t '.guidance',
+                :summary => 'https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary',
+                :translations => 'https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations' %>
+    </p>
+  </div>
+
+  <label class="standard-label">
+    <%= t 'layouts.tou' %>
+  </label>
+  <p class="deemphasize"><%= t '.tou_explain' %></p>
   <div class="form-row">
-    <label for="user_consider_pd">
-      <%= check_box("user", "consider_pd") %>
-      <%= t ".consider_pd" %>
+    <label for="read_tou">
+      <%= check_box_tag 'read_tou',1,false,:onclick=>"agreebtn = document.getElementById('agree');agreebtn.disabled=!this.checked;"%>
+      <%= t '.read_tou_html', :tou_link => link_to(t('layouts.tou'), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %>
     </label>
-    <span class="minorNote">(<%= link_to(t(".consider_pd_why"), t(".consider_pd_why_url"), :target => :new) %>)</span>
 
     <%= hidden_field_tag("referer", h(params[:referer])) unless params[:referer].nil? %>
 
     <div class="buttons form-row inner20 clearfix">
-      <p class="deemphasize"><%= t ".read and accept" %></p>
-      <%= submit_tag(t(".agree"), :name => "agree", :id => "agree") %>
-      <%= submit_tag(t(".decline"), :name => "decline", :id => "decline") %>
+      <%= submit_tag(t('.agree'), :name => "agree", :id => "agree", disabled: true)  %>
+      <%= submit_tag(t('.decline'), :name => "decline", :id => "decline") %>
     </div>
 
-    <div class="deemphasize">
-      <p id="contributorGuidance">
-        <%= raw t ".guidance",
-                  :summary => "https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary",
-                  :translations => "https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations" %>
-      </p>
-    </div>
+    <label for="user_consider_pd">
+      <%= check_box('user', 'consider_pd') %>
+      <%= t '.consider_pd' %>
+    </label>
+    <span class="minorNote">(<%= link_to(t('.consider_pd_why'), t('.consider_pd_why_url'), :target => :new)%>)</span>
+
   </div>
 <% end %>
index 569992599994aa4d0e0141c87dae25f68d92b517..37053cb44a567561aa0d267bc109b13368e5fd76 100644 (file)
@@ -1089,6 +1089,8 @@ en:
     partners_ucl: "UCL"
     partners_bytemark: "Bytemark Hosting"
     partners_partners: "partners"
+    intro_tou_html: "Use of this site is subject to our %{tou_link}." 
+    tou: "Terms of Use"
     osm_offline: "The OpenStreetMap database is currently offline while essential database maintenance work is carried out."
     osm_read_only: "The OpenStreetMap database is currently in read-only mode while essential database maintenance work is carried out."
     donate: "Support OpenStreetMap by %{link} to the Hardware Upgrade Fund."
@@ -1299,7 +1301,7 @@ en:
         This site and many other related services are formally operated by the
         <a href='https://osmfoundation.org/'>OpenStreetMap Foundation</a> (OSMF)
         on behalf of the community. Use of all OSMF operated services is subject
-        to our <a href="https://wiki.openstreetmap.org/wiki/Acceptable_Use_Policy">
+        to our <a href="https://wiki.osmfoundation.org/wiki/Terms_of_Use">Terms of Use</a>, <a href="https://wiki.openstreetmap.org/wiki/Acceptable_Use_Policy">
         Acceptable Use Policies</a> and our <a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy">Privacy Policy</a>
         <br>
         Please <a href='https://osmfoundation.org/Contact'>contact the OSMF</a>
@@ -2025,10 +2027,14 @@ en:
       terms declined: "We are sorry that you have decided to not accept the new Contributor Terms. For more information, please see <a href=\"%{url}\">this wiki page</a>."
       terms declined url: https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined
     terms:
-      title: "Contributor terms"
-      heading: "Contributor terms"
-      read and accept: "Please read the agreement and press the agree button to confirm that you accept the terms of this agreement for your existing and future contributions."
-      consider_pd: "In addition to the above agreement, I consider my contributions to be in the Public Domain"
+      title: "Terms"
+      heading: "Terms"
+      heading_ct: "Contributor terms"
+      read and accept: "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." 
+      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_tou_html: "I have read and agree to the %{tou_link}"
+      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_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>'
diff --git a/db/migrate/20181020114000_add_user_tou_agreed.rb b/db/migrate/20181020114000_add_user_tou_agreed.rb
new file mode 100644 (file)
index 0000000..ea89c6c
--- /dev/null
@@ -0,0 +1,5 @@
+class AddUserTouAgreed < ActiveRecord::Migration[5.1]
+  def change
+    add_column :users, :tou_agreed, :datetime
+  end
+end