This commit is contained in:
albert
2013-04-09 18:15:04 -04:00
parent 0d864e65d2
commit c5bf7b6c47
5 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,11 @@
class StaticController < ApplicationController
def terms_of_service
end
def accept_terms_of_service
cookies.permanent[:accepted_tos] = "1"
redirect_to(params[:url] || posts_path)
end
def error
end

View File

@@ -44,7 +44,7 @@
<%= render "users/upgrade_notice" %>
<% end %>
<% if !CurrentUser.is_privileged? && CurrentUser.user.created_at > 2.weeks.ago %>
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_privileged? %>
<%= render "users/tos" %>
<% end %>

View File

@@ -50,6 +50,11 @@
<p>Danbooru will not disclose the IP address, email address, password, or DMails of any user except to the staff.</p>
<p>Danbooru is allowed to make public everything else, including but not limited to: uploaded posts, favorited posts, comments, forum posts, wiki edits, and note edits.</p>
</div>
<%= form_tag(accept_terms_of_service_path) do %>
<%= hidden_field_tag :url, params[:url] %>
<%= submit_tag "I have read and agree to these rules" %>
<% end %>
</div>
<% content_for(:page_title) do %>

View File

@@ -1,3 +1,3 @@
<div class="ui-corner-all ui-state-highlight" id="tos-notice">
<h1><%= link_to "Read the rules before proceeding!", terms_of_service_path %></h1>
<h1><%= link_to "Read the rules before proceeding!", terms_of_service_path(:url => request.fullpath) %></h1>
</div>

View File

@@ -311,6 +311,7 @@ Danbooru::Application.routes.draw do
match "/static/bookmarklet" => "static#bookmarklet", :as => "bookmarklet"
match "/static/site_map" => "static#site_map", :as => "site_map"
match "/static/terms_of_service" => "static#terms_of_service", :as => "terms_of_service"
match "/static/accept_terms_of_service" => "static#accept_terms_of_service", :as => "accept_terms_of_service"
match "/static/mrtg" => "static#mrtg", :as => "mrtg"
match "/static/contact" => "static#contact", :as => "contact"
match "/static/benchmark" => "static#benchmark"