diff --git a/app/assets/stylesheets/newflow.scss b/app/assets/stylesheets/newflow.scss index 4b4878919..38179c150 100644 --- a/app/assets/stylesheets/newflow.scss +++ b/app/assets/stylesheets/newflow.scss @@ -290,6 +290,18 @@ input.has-error { color: var(--input-error-message-color); } +.center { + text-align: center; + margin: 0 auto; +} + +.policy { + max-width: 800px; + margin: 20px auto; + padding: 40px; + background-color: #f5f5f5; +} + // per-page styles .cs-form-complete-profile { header.page-header { diff --git a/app/controllers/newflow/login_controller.rb b/app/controllers/newflow/login_controller.rb index 918bd6738..bc70b9ff1 100644 --- a/app/controllers/newflow/login_controller.rb +++ b/app/controllers/newflow/login_controller.rb @@ -12,6 +12,7 @@ class LoginController < BaseController before_action :known_signup_role_redirect, only: :login_form before_action :cache_alternate_signup_url, only: :login_form before_action :redirect_to_signup_if_go_param_present, only: :login_form + before_action :did_sign_privacy_notice, if: -> { signed_in? }, only: :login_form before_action :redirect_back, if: -> { signed_in? }, only: :login_form def login @@ -86,5 +87,12 @@ def should_redirect_to_signup_welcome? def cache_alternate_signup_url set_alternate_signup_url(params[:signup_at]) end + + def did_sign_privacy_notice + contract = FinePrint.get_contract(:privacy_policy) + unless contract.signed_by?(current_user) + redirect_to pose_term_url(name: contract.name, params: request.params) + end + end end end diff --git a/app/controllers/terms_controller.rb b/app/controllers/terms_controller.rb index 49cea19c4..8a5da87d1 100644 --- a/app/controllers/terms_controller.rb +++ b/app/controllers/terms_controller.rb @@ -1,4 +1,6 @@ class TermsController < ApplicationController + layout 'newflow_layout' + # Allow us to sign terms in an iframe # Unlikely that attackers would want to trick our browsers into signing terms skip_forgery_protection only: :agree diff --git a/app/views/terms/index.html.erb b/app/views/terms/index.html.erb index 500f6e374..9e0334e7a 100644 --- a/app/views/terms/index.html.erb +++ b/app/views/terms/index.html.erb @@ -1,10 +1,10 @@ <%# Copyright 2011-2016 Rice University. Licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file for details. %> -<%= ox_card(heading: (t :".page_heading")) do %> +<%= ox_card(heading: (t :".page_heading"), classes: "center") do %> <% contract_links = @contracts.collect do |contract| - link_to contract.title, term_path(contract), remote: true + link_to contract.title, term_path(contract) end %>
<%= t :".notice_html", site_name: SITE_NAME, terms_of_use: contract_links[0], privacy_policy: contract_links[1] %>
diff --git a/app/views/terms/pose.html.erb b/app/views/terms/pose.html.erb index 4009f104b..da5d095ed 100644 --- a/app/views/terms/pose.html.erb +++ b/app/views/terms/pose.html.erb @@ -1,4 +1,4 @@ -<%= ox_card(heading: @contract.title, classes: "wide") do %> +<%= ox_card(classes: "wide") do %> <% if FinePrint.signed_any_version_of_contract?(current_user, @contract) %><%= t :".contracts_changed_notice", contract_title: @contract.title %>
@@ -6,7 +6,7 @@<%= t :".contract_acceptance_required" %>
<% end %> -