forked from e621ng/e621ng
parent
e2d289baca
commit
c1aa5f95b1
@ -49,6 +49,12 @@ class StaticController < ApplicationController
|
||||
redirect_back fallback_location: posts_path
|
||||
end
|
||||
|
||||
def dont_fool_me
|
||||
cookies[:dont_fool_me] = { value: "1", expires: 1.week }
|
||||
flash[:notice] = "òwō"
|
||||
redirect_back fallback_location: posts_path
|
||||
end
|
||||
|
||||
def discord
|
||||
unless CurrentUser.can_discord?
|
||||
raise User::PrivilegeError.new("You must have an account for at least one week in order to join the Discord server.")
|
||||
|
@ -60,12 +60,13 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
def fool?
|
||||
return true if params[:fool]
|
||||
return false if Danbooru.config.app_name == "e926"
|
||||
return false if cookies[:dont_fool_me]
|
||||
|
||||
Time.use_zone(Time.find_zone("UTC")) do
|
||||
target = Date.new(2024, 4, 1)
|
||||
start = target.beginning_of_day - 12.hours
|
||||
stop = target.end_of_day + 12.hours
|
||||
stop = target.end_of_day + 6.hours
|
||||
Time.now.between?(start, stop)
|
||||
end
|
||||
end
|
||||
|
@ -7,6 +7,13 @@
|
||||
<h3 class="redtext" id="no_save_warning">Your device does not allow the site to save theme settings.</h3>
|
||||
</noscript>
|
||||
|
||||
<% if fool? %>
|
||||
<p>
|
||||
Click <%= link_to "here", dont_fool_me_static_path %> to kill the joke early.
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="simple_form">
|
||||
<div class="input">
|
||||
<label for="theme_name">Theme</label>
|
||||
|
@ -444,6 +444,7 @@ Rails.application.routes.draw do
|
||||
post "/static/discord" => "static#discord", as: "discord_post"
|
||||
get "/static/toggle_mobile_mode" => "static#disable_mobile_mode", as: "disable_mobile_mode"
|
||||
get "/static/theme" => "static#theme", as: "theme"
|
||||
get "/static/dont_fool_me" => "static#dont_fool_me", as: "dont_fool_me_static"
|
||||
get "/meta_searches/tags" => "meta_searches#tags", :as => "meta_searches_tags"
|
||||
|
||||
root :to => "static#home"
|
||||
|
Loading…
Reference in New Issue
Block a user