Skip to content

Commit

Permalink
Terms of service and privacy policy feature.
Browse files Browse the repository at this point in the history
If enabled, terms of service link will be shown in sign up page.
  • Loading branch information
jaywink committed Aug 17, 2014
1 parent c45f84c commit e58f0b2
Show file tree
Hide file tree
Showing 12 changed files with 395 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
#trademark sillyness
app/views/home/_show.*
app/views/terms/terms.*
app/assets/images/custom/


Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -30,6 +30,7 @@
* Add scrolling thumbnail switcher in the lightbox [#5102](https://github.com/diaspora/diaspora/pull/5102)
* Add help section about keyboard shortcuts [#5100](https://github.com/diaspora/diaspora/pull/5100)
* Automatically add poll answers as needed [#5109](https://github.com/diaspora/diaspora/pull/5109)
* Add Terms of Service as an option for podmins, includes base template [#5104](https://github.com/diaspora/diaspora/pull/5104)

# 0.4.0.1

Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/new_styles/_registration.scss
Expand Up @@ -42,5 +42,10 @@
.controls {
float : right;
}

#terms > a {
color: inherit;
text-decoration: underline;
}
}
}
20 changes: 20 additions & 0 deletions app/controllers/terms_controller.rb
@@ -0,0 +1,20 @@
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

class TermsController < ApplicationController

respond_to :html, :mobile

def index
@css_framework = :bootstrap
partial_dir = Rails.root.join('app', 'views', 'terms')
if partial_dir.join('terms.haml').exist? ||
partial_dir.join('terms.erb').exist?
render :terms
else
render :default
end
end

end
7 changes: 5 additions & 2 deletions app/views/registrations/new.html.erb
Expand Up @@ -68,8 +68,11 @@
<% end %>
<%= invite_hidden_tag(invite) %>
</fieldset>


<% if AppConfig.settings.terms.enable? %>
<div id="terms" class="text-center">
<%= t('.terms', terms_link: link_to(t('.terms_link'), terms_path, target: "_blank")).html_safe %>
</div>
<% end %>
<%= f.submit t('.continue'), :class => "new-btn", :disable_with => t('.submitting') %>
<% end %>
</div>
Expand Down
3 changes: 3 additions & 0 deletions app/views/registrations/new.mobile.haml
Expand Up @@ -44,6 +44,9 @@

- if AppConfig.settings.captcha.enable?
= show_simple_captcha(:object => 'user', :code_type => 'numeric')

- if AppConfig.settings.terms.enable?
= t('registrations.new.terms', terms_link: link_to(t('registrations.new.terms_link'), terms_path, target: "_blank")).html_safe

.controls
= f.submit t('registrations.new.create_my_account'), :class => 'btn primary', :disable_with => t('registrations.new.submitting')
Expand Down
2 changes: 2 additions & 0 deletions app/views/shared/_links.haml
Expand Up @@ -3,3 +3,5 @@
%li= link_to t('layouts.application.whats_new'), changelog_url
%li= link_to(t('layouts.header.code') + " " + pod_version, "#{root_path.chomp('/')}/source.tar.gz", {:title => t('layouts.application.source_package')}) unless request.url.match(/joindiaspora.com/)
%li= link_to(t('layouts.application.toggle'), toggle_mobile_path)
- if AppConfig.settings.terms.enable?
%li= link_to(t('_terms'), terms_path)
318 changes: 318 additions & 0 deletions app/views/terms/default.haml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions config/defaults.yml
Expand Up @@ -89,6 +89,10 @@ defaults:
captcha_length: 5
image_style: 'simply_green'
distortion: 'low'
terms:
enable: false
jurisdiction: false
minimum_age: false
services:
facebook:
enable: false
Expand Down
28 changes: 28 additions & 0 deletions config/diaspora.yml.example
Expand Up @@ -302,6 +302,34 @@ configuration: ## Section
## Sets the level of image distortion used in the captcha.
## Available options are: 'low', 'medium', 'high', 'random'
#distortion: 'low'

## Terms of Service
## Show a default or customized terms of service for users.
## You can create a custom Terms of Service by placing a template
## as app/views/terms/terms.haml or app/views/terms/terms.erb
## The default terms of service that can be extended is
## at app/views/terms/default.haml
## NOTE! The default terms have not been checked over by a lawyer and
## thus are unlikely to provide full legal protection for all situations
## for a podmin using them. They are also not specific to all countries
## and jurisdictions. If you are unsure, please check with a lawyer.
## We provide these for podmins as some basic rules that podmins
## can communicate to users easily via the diaspora* server software.
## Uncomment to enable this feature.
terms: ## Section
# First enable it by uncommenting
#enable: true
## Important! If you enable the terms, you should always
## set a location under which laws any disputes are governed
## under. For example, country or state/country, depending
## on the country in question.
## If this is not set, the whole paragraph about governing
## laws *is not shown* in the terms page.
#jurisdiction: ""
## Age limit for signups
## Set a number to activate this setting. This age limit is shown
## in the default ToS document.
#minimum_age: false

## Posting from Diaspora to external services (all are disabled by default)
services: ## Section
Expand Down
3 changes: 3 additions & 0 deletions config/locales/diaspora/en.yml
Expand Up @@ -46,6 +46,7 @@ en:
no_results: "No Results Found"
_contacts: "Contacts"
welcome: "Welcome!"
_terms: "terms"

#for reference translation, the real activerecord english transations are actually
#in en-US, en-GB, and en-AU yml files
Expand Down Expand Up @@ -976,6 +977,8 @@ en:
password_confirmation: "PASSWORD CONFIRMATION"
continue: "Continue"
submitting: "Submitting..."
terms: "By creating an account you accept the %{terms_link}."
terms_link: "terms of service"
create:
success: "You've joined diaspora*!"
edit:
Expand Down
5 changes: 5 additions & 0 deletions config/routes.rb
Expand Up @@ -219,6 +219,11 @@

#Statistics
get :statistics, controller: :statistics

# Terms
if AppConfig.settings.terms.enable?
get 'terms' => 'terms#index'
end

# Startpage
root :to => 'home#show'
Expand Down

0 comments on commit e58f0b2

Please sign in to comment.