diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a288ee64f..57f4819c0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -108,17 +108,13 @@ module ApplicationHelper tag.time content || datetime, datetime: datetime, title: time.to_formatted_s, **options end - def humanized_duration(from, to, compact: false) + def humanized_duration(from, to) if to - from > 10.years duration = "forever" else duration = distance_of_time_in_words(from, to) end - if compact - duration = duration.gsub(/almost|about|over/, "").gsub(/less than a/, "<1").strip - end - datetime = from.iso8601 + "/" + to.iso8601 title = "#{from.strftime("%Y-%m-%d %H:%M")} to #{to.strftime("%Y-%m-%d %H:%M")}" diff --git a/app/javascript/src/javascripts/common.js b/app/javascript/src/javascripts/common.js index cc04ab125..90fc89347 100644 --- a/app/javascript/src/javascripts/common.js +++ b/app/javascript/src/javascripts/common.js @@ -7,13 +7,6 @@ $(function() { e.preventDefault(); }); - $("#hide-promotion-notice").on("click.danbooru", function(e) { - $("#promotion-notice").hide(); - Cookie.put("hide_final_promotion_notice", "1", 3 * 60 * 60); - Cookie.put("hide_upgrade_account_notice", "1", 7 * 24 * 60 * 60); - e.preventDefault(); - }); - $("#hide-dmail-notice").on("click.danbooru", function(e) { var $dmail_notice = $("#dmail-notice"); $dmail_notice.hide(); diff --git a/app/models/user.rb b/app/models/user.rb index 732bf3079..01730294c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -404,9 +404,7 @@ class User < ApplicationRecord end def tag_query_limit - if is_member? && Danbooru.config.is_promotion? - 1_000_000 - elsif is_platinum? + if is_platinum? Danbooru.config.base_tag_query_limit * 2 elsif is_gold? Danbooru.config.base_tag_query_limit diff --git a/app/models/user_upgrade.rb b/app/models/user_upgrade.rb index 69f580f5c..48083c6d4 100644 --- a/app/models/user_upgrade.rb +++ b/app/models/user_upgrade.rb @@ -35,11 +35,7 @@ class UserUpgrade < ApplicationRecord end def self.gold_price - if Danbooru.config.is_promotion? - 1500 - else - 2000 - end + 2000 end def self.platinum_price @@ -168,9 +164,6 @@ class UserUpgrade < ApplicationRecord price: price_id, quantity: 1, }], - discounts: [{ - coupon: promotion_discount_id, - }], metadata: { user_upgrade_id: id, purchaser_id: purchaser.id, @@ -228,12 +221,6 @@ class UserUpgrade < ApplicationRecord !pending? end - def promotion_discount_id - if Danbooru.config.is_promotion? - Danbooru.config.stripe_promotion_discount_id - end - end - def upgrade_price_id(currency) case [upgrade_type, currency] when ["gold", "usd"] diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index 7c6606f56..c79fa8acb 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -70,18 +70,6 @@
<%= render "users/verification_notice" %> - <% if Danbooru.config.is_promotion? && cookies[:hide_final_promotion_notice].blank? %> -
- <% file = %w[provgift.png kemogift.png padoru.gif ablobgift.gif].sample %> - <%= tag.img src: "/images/#{file}", width: 24, height: 24 %> - - <%= link_to "Danbooru Winter Sale", forum_topic_path(17832) %> ends in - <%= Time.use_zone("UTC") { humanized_duration(Time.zone.parse("2021-01-01"), Time.zone.now, compact: true) } %>! - Get 25% off Gold & Platinum - (<%= link_to "hide", "#", id: "hide-promotion-notice" %>) -
- <% end %> - <% if !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %> <%= render "users/upgrade_notice" %> <% end %> diff --git a/app/views/user_upgrades/new.html.erb b/app/views/user_upgrades/new.html.erb index ed3647fe1..8766dfc83 100644 --- a/app/views/user_upgrades/new.html.erb +++ b/app/views/user_upgrades/new.html.erb @@ -18,14 +18,6 @@ <% else %>

Upgrade Account

- <% if Danbooru.config.is_promotion? %> -

- <%= tag.img src: "/images/padoru.gif", width: 24, height: 24 %> - Danbooru Winter Sale! Gold and Platinum upgrades are 25% off. Sale ends in <%= Time.use_zone("UTC") { humanized_duration(Time.zone.parse("2021-01-01"), Time.zone.now, compact: true) } %>. - <%= tag.img src: "/images/padoru.gif", width: 24, height: 24 %> -

- <% end %> -

Upgrading your account gives you exclusive benefits and helps support <%= Danbooru.config.canonical_app_name %>. Your support helps keep the site ad-free for everyone!

@@ -52,16 +44,10 @@ Free - <% if Danbooru.config.is_promotion? %> - $20 - <% end %> <%= cents_to_usd(UserUpgrade.gold_price) %>
One time fee
- <% if Danbooru.config.is_promotion? %> - $40 - <% end %> <%= cents_to_usd(UserUpgrade.platinum_price) %>
One time fee
diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index 3467e4dcc..b9525a381 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -528,12 +528,6 @@ module Danbooru def redis_url "redis://localhost:6379" end - - def is_promotion? - Time.use_zone("UTC") do - Time.zone.now < Time.zone.parse("2021-01-01") - end - end end EnvironmentConfiguration = Struct.new(:config) do diff --git a/public/images/blobgift.png b/public/images/blobgift.png deleted file mode 100644 index bfcb3aa64..000000000 Binary files a/public/images/blobgift.png and /dev/null differ diff --git a/public/images/kemogift.png b/public/images/kemogift.png deleted file mode 100644 index 300da66fb..000000000 Binary files a/public/images/kemogift.png and /dev/null differ diff --git a/public/images/padoru.gif b/public/images/padoru.gif deleted file mode 100644 index 454968b16..000000000 Binary files a/public/images/padoru.gif and /dev/null differ diff --git a/public/images/provgift.png b/public/images/provgift.png deleted file mode 100644 index 2dac5a97f..000000000 Binary files a/public/images/provgift.png and /dev/null differ