Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #410 from zendesk/sxie/privacy-policy
Browse files Browse the repository at this point in the history
add page with link to privacy policy
  • Loading branch information
samzx authored Aug 12, 2020
2 parents cd9c348 + 1b35e89 commit 63b8499
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
"description": "Google tag manager ID. Create an account to add analytics etc.",
"required": false
},
"PRIVACY_POLICY_LINK": {
"description": "The portal privacy policy page will have a link to this link. Required for google oauth.",
"required": false
},
"IP_BLOCK_ALL": {
"description": "If enabled (IP_BLOCK_ALL='true') then all IP addresses will be blocked. Add IPs to the safe list to allow access.",
"required": false
Expand Down
9 changes: 9 additions & 0 deletions app/controllers/legal_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# rubocop:disable Rails/ApplicationController
class LegalController < ActionController::Base
protect_from_forgery with: :exception

def index
render "privacy.html.erb"
end
end
# rubocop:enable Rails/ApplicationController
9 changes: 9 additions & 0 deletions app/views/legal/privacy.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="root">
<div style="margin:0 auto;text-align:center;">
<h3>Privacy Policy</h3>
<% if ENV['PRIVACY_POLICY_LINK'] %>
<p>Please read our <a href="<%= ENV['PRIVACY_POLICY_LINK'] %>" target="_blank">privacy policy</a>.</p>
<% else %>
<p>Sorry, no policy has been crafted yet.</p>
<% end %>
</div>
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

root 'standalone#portal'

get 'legal', to: 'legal#index'

get 'volunteer/ping', to: 'ping#index'
get 'z/ping', to: 'ping#index'

Expand Down
1 change: 1 addition & 0 deletions test/integration/cleanliness_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
app/controllers/application_controller.rb
app/controllers/gauth_controller.rb
app/controllers/graphql_controller.rb
app/controllers/legal_controller.rb
app/controllers/omniauth_callbacks_controller.rb
app/controllers/ping_controller.rb
app/controllers/standalone_controller.rb
Expand Down

0 comments on commit 63b8499

Please sign in to comment.