Revert "Add Danbooru Winter Sale."

This reverts commit 963f1f7991.
This commit is contained in:
evazion
2020-01-02 01:14:16 -06:00
parent 44140c6ec8
commit c251d145e4
6 changed files with 5 additions and 56 deletions

View File

@@ -8,13 +8,6 @@ $(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();

View File

@@ -1,25 +1,13 @@
class UserUpgrade class UserUpgrade
def self.gold_price def self.gold_price
if Danbooru.config.is_promotion? 2000
1500
else
2000
end
end end
def self.platinum_price def self.platinum_price
if Danbooru.config.is_promotion? 4000
3000
else
4000
end
end end
def self.upgrade_price def self.upgrade_price
if Danbooru.config.is_promotion? 2000
1500
else
2000
end
end end
end end

View File

@@ -505,8 +505,6 @@ 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

View File

@@ -97,15 +97,7 @@
</header> </header>
<div id="page"> <div id="page">
<% if Danbooru.config.is_promotion? && cookies[:hide_promotion_notice].blank? %> <% if !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
<div class="notice notice-info notice-large" id="promotion-notice">
<%= link_to "Danbooru Winter Sale!", forum_topic_path(16501) %> 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 %>

View File

@@ -3,17 +3,7 @@
<h1>Upgrade Account</h1> <h1>Upgrade Account</h1>
<% unless params[:user_id] %> <% unless params[:user_id] %>
<p class="copy"> <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>
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>
@@ -34,16 +24,10 @@
<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>

View File

@@ -638,12 +638,6 @@ 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