Add Danbooru Winter Sale.
* 25% off Gold and Platinum accounts. * Free 6 tag searches for Member-level users. * Runs from midnight Dec. 25th to 28th (UTC time).
This commit is contained in:
@@ -8,6 +8,13 @@ $(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#hide-promotion-notice").on("click.danbooru", function(e) {
|
||||||
|
$("#promotion-notice").hide();
|
||||||
|
Cookie.put('hide_promotion_notice', '1', 7);
|
||||||
|
Cookie.put('hide_upgrade_account_notice', '1', 7);
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
$("#hide-dmail-notice").on("click.danbooru", function(e) {
|
$("#hide-dmail-notice").on("click.danbooru", function(e) {
|
||||||
var $dmail_notice = $("#dmail-notice");
|
var $dmail_notice = $("#dmail-notice");
|
||||||
$dmail_notice.hide();
|
$dmail_notice.hide();
|
||||||
|
|||||||
@@ -1,13 +1,25 @@
|
|||||||
class UserUpgrade
|
class UserUpgrade
|
||||||
def self.gold_price
|
def self.gold_price
|
||||||
2000
|
if Danbooru.config.is_promotion?
|
||||||
|
1500
|
||||||
|
else
|
||||||
|
2000
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.platinum_price
|
def self.platinum_price
|
||||||
4000
|
if Danbooru.config.is_promotion?
|
||||||
|
3000
|
||||||
|
else
|
||||||
|
4000
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.upgrade_price
|
def self.upgrade_price
|
||||||
2000
|
if Danbooru.config.is_promotion?
|
||||||
|
1500
|
||||||
|
else
|
||||||
|
2000
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -505,6 +505,8 @@ class User < ApplicationRecord
|
|||||||
Danbooru.config.base_tag_query_limit * 2
|
Danbooru.config.base_tag_query_limit * 2
|
||||||
elsif is_gold?
|
elsif is_gold?
|
||||||
Danbooru.config.base_tag_query_limit
|
Danbooru.config.base_tag_query_limit
|
||||||
|
elsif is_member? && Danbooru.config.is_promotion?
|
||||||
|
Danbooru.config.base_tag_query_limit
|
||||||
else
|
else
|
||||||
2
|
2
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -97,7 +97,15 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="page">
|
<div id="page">
|
||||||
<% if !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
|
<% if Danbooru.config.is_promotion? && cookies[:hide_promotion_notice].blank? %>
|
||||||
|
<div class="notice notice-info notice-large" id="promotion-notice">
|
||||||
|
Danbooru Winter Sale! 25% off Gold and free 6-tag searches for Members!
|
||||||
|
|
||||||
|
(<%= link_to "close", "#", id: "hide-promotion-notice" %>)
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if !Danbooru.config.is_promotion? && !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
|
||||||
<%= render "users/upgrade_notice" %>
|
<%= render "users/upgrade_notice" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,17 @@
|
|||||||
<h1>Upgrade Account</h1>
|
<h1>Upgrade Account</h1>
|
||||||
|
|
||||||
<% unless params[:user_id] %>
|
<% unless params[:user_id] %>
|
||||||
<p class="copy">Want more searching power? Upgrade your account and become a power user of the best database of anime artwork on the internet.</p>
|
<p class="copy">
|
||||||
|
Want more searching power? Upgrade your account and
|
||||||
|
become a power user of the best database of anime artwork on the
|
||||||
|
internet.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<% if Danbooru.config.is_promotion? %>
|
||||||
|
<p>
|
||||||
|
<h6>Danbooru Winter Sale! Gold and Platinum upgrades are 25% off from now until December 28th.</h6>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div id="feature-comparison">
|
<div id="feature-comparison">
|
||||||
<table>
|
<table>
|
||||||
@@ -24,10 +34,16 @@
|
|||||||
<td>Cost</td>
|
<td>Cost</td>
|
||||||
<td>Free</td>
|
<td>Free</td>
|
||||||
<td>
|
<td>
|
||||||
|
<% if Danbooru.config.is_promotion? %>
|
||||||
|
<s>$20</s>
|
||||||
|
<% end %>
|
||||||
<%= cents_to_usd(UserUpgrade.gold_price) %>
|
<%= cents_to_usd(UserUpgrade.gold_price) %>
|
||||||
<div class="fineprint">One time fee</div>
|
<div class="fineprint">One time fee</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<% if Danbooru.config.is_promotion? %>
|
||||||
|
<s>$40</s>
|
||||||
|
<% end %>
|
||||||
<%= cents_to_usd(UserUpgrade.platinum_price) %>
|
<%= cents_to_usd(UserUpgrade.platinum_price) %>
|
||||||
<div class="fineprint">One time fee</div>
|
<div class="fineprint">One time fee</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -638,6 +638,12 @@ module Danbooru
|
|||||||
def redis_url
|
def redis_url
|
||||||
"redis://localhost:6379"
|
"redis://localhost:6379"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_promotion?
|
||||||
|
Time.use_zone("UTC") do
|
||||||
|
Time.zone.now.in?(Time.zone.parse("2019-12-25")..Time.zone.parse("2019-12-28"))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class EnvironmentConfiguration
|
class EnvironmentConfiguration
|
||||||
|
|||||||
Reference in New Issue
Block a user