fixes #1241
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
class StaticController < ApplicationController
|
class StaticController < ApplicationController
|
||||||
def terms_of_service
|
def terms_of_service
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def accept_terms_of_service
|
||||||
|
cookies.permanent[:accepted_tos] = "1"
|
||||||
|
redirect_to(params[:url] || posts_path)
|
||||||
|
end
|
||||||
|
|
||||||
def error
|
def error
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<%= render "users/upgrade_notice" %>
|
<%= render "users/upgrade_notice" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !CurrentUser.is_privileged? && CurrentUser.user.created_at > 2.weeks.ago %>
|
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_privileged? %>
|
||||||
<%= render "users/tos" %>
|
<%= render "users/tos" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -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 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>
|
<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>
|
</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>
|
</div>
|
||||||
|
|
||||||
<% content_for(:page_title) do %>
|
<% content_for(:page_title) do %>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<div class="ui-corner-all ui-state-highlight" id="tos-notice">
|
<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>
|
</div>
|
||||||
|
|||||||
@@ -311,6 +311,7 @@ Danbooru::Application.routes.draw do
|
|||||||
match "/static/bookmarklet" => "static#bookmarklet", :as => "bookmarklet"
|
match "/static/bookmarklet" => "static#bookmarklet", :as => "bookmarklet"
|
||||||
match "/static/site_map" => "static#site_map", :as => "site_map"
|
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/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/mrtg" => "static#mrtg", :as => "mrtg"
|
||||||
match "/static/contact" => "static#contact", :as => "contact"
|
match "/static/contact" => "static#contact", :as => "contact"
|
||||||
match "/static/benchmark" => "static#benchmark"
|
match "/static/benchmark" => "static#benchmark"
|
||||||
|
|||||||
Reference in New Issue
Block a user