users: disable upgrading to platinum.

Disable the ability to upgrade to Platinum. The Platinum level still
exists, but users can no longer upgrade to it. Sales of Platinum are
being disabled in preparation of increasing the tag limit for Gold
users.
This commit is contained in:
evazion
2022-04-23 22:49:24 -05:00
parent 2b387bdc41
commit 1e4c0ffe78
9 changed files with 15 additions and 52 deletions

View File

@@ -61,7 +61,7 @@ class FavoriteGroup < ApplicationRecord
def creator_can_create_favorite_groups def creator_can_create_favorite_groups
if creator.favorite_groups.count >= creator.favorite_group_limit if creator.favorite_groups.count >= creator.favorite_group_limit
error = "You can only keep up to #{creator.favorite_group_limit} favorite groups." error = "You can only keep up to #{creator.favorite_group_limit} favorite groups."
if !creator.is_platinum? if !creator.is_gold?
error += " Upgrade your account to create more." error += " Upgrade your account to create more."
end end
errors.add(:base, error) errors.add(:base, error)

View File

@@ -131,7 +131,7 @@
<span> <span>
<%= link_to "Danbooru Winter Sale", forum_topic_path(Danbooru.config.winter_sale_forum_topic_id) %> ends <%= time_ago_in_words_tagged(Danbooru.config.winter_sale_end_date) %>! <%= link_to "Danbooru Winter Sale", forum_topic_path(Danbooru.config.winter_sale_forum_topic_id) %> ends <%= time_ago_in_words_tagged(Danbooru.config.winter_sale_end_date) %>!
<br> <br>
<%= link_to "Get 25% off Gold & Platinum", new_user_upgrade_path %> <%= link_to "Get 25% off Gold", new_user_upgrade_path %>
</span> </span>
<span>(<%= link_to "hide", "#", id: "hide-promotion-notice" %>)</span> <span>(<%= link_to "hide", "#", id: "hide-promotion-notice" %>)</span>

View File

@@ -5,7 +5,7 @@
<p> <p>
<%= @message %> <%= @message %>
<% if CurrentUser.is_platinum? %> <% if CurrentUser.is_gold? %>
Try narrowing your search terms. Try narrowing your search terms.
<% else %> <% else %>
Try narrowing your search terms, or <%= link_to "upgrade your account", new_user_upgrade_path %> to go beyond page <%= CurrentUser.user.page_limit %>. Try narrowing your search terms, or <%= link_to "upgrade your account", new_user_upgrade_path %> to go beyond page <%= CurrentUser.user.page_limit %>.

View File

@@ -42,9 +42,8 @@
<p> <p>
Members are limited to searches that take up to 3 seconds long. You can Members are limited to searches that take up to 3 seconds long. You can
<%= link_to "upgrade your account", new_user_upgrade_path %> to increase <%= link_to "upgrade to Gold", new_user_upgrade_path %> to increase
your search limit. Gold users can do searches that take up to 6 seconds your search limit to 6 seconds long.
long, and Platinum users can go up to 9 seconds.
</p> </p>
<% end %> <% end %>

View File

@@ -5,7 +5,7 @@
<p> <p>
<%= @message %> <%= @message %>
<% unless CurrentUser.is_platinum? %> <% unless CurrentUser.is_gold? %>
<%= link_to "Upgrade your account", new_user_upgrade_path %> to search for more tags at once. <%= link_to "Upgrade your account", new_user_upgrade_path %> to search for more tags at once.
<% end %> <% end %>
</p> </p>

View File

@@ -1,5 +1,5 @@
<% page_title "Account Upgrade" %> <% page_title "Account Upgrade" %>
<% meta_description "Upgrade to a Gold or Platinum account." %> <% meta_description "Upgrade to a Gold account." %>
<script src="https://js.stripe.com/v3/"></script> <script src="https://js.stripe.com/v3/"></script>
<%= render "users/secondary_links" %> <%= render "users/secondary_links" %>
@@ -11,7 +11,9 @@
<h1 class="text-center mb-4">Gift Account Upgrade</h1> <h1 class="text-center mb-4">Gift Account Upgrade</h1>
<% if @user_upgrade.recipient.is_platinum? %> <% if @user_upgrade.recipient.is_platinum? %>
<p><%= link_to_user @recipient %> is already above Platinum level and can't be upgraded!</p> <p><%= link_to_user @recipient %> is already above Gold and can't be upgraded!</p>
<% elsif @user_upgrade.recipient.is_gold? %>
<p><%= link_to_user @recipient %> is already Gold and can't be upgraded!</p>
<% else %> <% else %>
<h6>You are gifting this upgrade to <%= link_to_user @user_upgrade.recipient %>.</h6> <h6>You are gifting this upgrade to <%= link_to_user @user_upgrade.recipient %>.</h6>
<% end %> <% end %>
@@ -29,7 +31,7 @@
<% if Danbooru.config.is_promotion? %> <% if Danbooru.config.is_promotion? %>
<p> <p>
<%= tag.img src: "/images/padoru.gif", width: 24, height: 24 %> <%= tag.img src: "/images/padoru.gif", width: 24, height: 24 %>
<b>Danbooru Winter Sale! Gold and Platinum upgrades are 25% off. Sale ends <%= time_ago_in_words_tagged(Danbooru.config.winter_sale_end_date) %>.</b> <b>Danbooru Winter Sale! Gold upgrades are 25% off. Sale ends <%= time_ago_in_words_tagged(Danbooru.config.winter_sale_end_date) %>.</b>
<%= tag.img src: "/images/padoru.gif", width: 24, height: 24 %> <%= tag.img src: "/images/padoru.gif", width: 24, height: 24 %>
</p> </p>
<% end %> <% end %>
@@ -40,14 +42,12 @@
<th></th> <th></th>
<th>Basic</th> <th>Basic</th>
<th>Gold</th> <th>Gold</th>
<th>Platinum</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<colgroup id="labels" class="w-1/4"></colgroup> <colgroup id="labels" class="w-1/4"></colgroup>
<colgroup id="basic" class="w-1/4"></colgroup> <colgroup id="basic" class="w-1/4"></colgroup>
<colgroup id="gold" class="w-1/4"></colgroup> <colgroup id="gold" class="w-1/4"></colgroup>
<colgroup id="platinum" class="w-1/4"></colgroup>
<tr> <tr>
<td></td> <td></td>
<td>Free</td> <td>Free</td>
@@ -58,74 +58,53 @@
<%= 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>
<% if Danbooru.config.is_promotion? %>
<s>$40</s>
<% end %>
<%= cents_to_usd(UserUpgrade.platinum_price) %>
<div class="fineprint">One time fee</div>
</td>
</tr> </tr>
<tr> <tr>
<td>Tag Limit</td> <td>Tag Limit</td>
<td>2</td> <td>2</td>
<td>6</td> <td>6</td>
<td>12</td>
</tr> </tr>
<tr> <tr>
<td>See Hidden Tags</td> <td>See Hidden Tags</td>
<td>No</td> <td>No</td>
<td>Yes</td> <td>Yes</td>
<td>Yes</td>
</tr> </tr>
<tr> <tr>
<td>Page Limit</td> <td>Page Limit</td>
<td>1,000</td> <td>1,000</td>
<td>2,000</td> <td>2,000</td>
<td>5,000</td>
</tr> </tr>
<tr> <tr>
<td>Private Favorites</td> <td>Private Favorites</td>
<td>no</td> <td>no</td>
<td>yes</td> <td>yes</td>
<td>yes</td>
</tr> </tr>
<tr> <tr>
<td>Favorite Groups</td> <td>Favorite Groups</td>
<td>3</td> <td>3</td>
<td>5</td> <td>5</td>
<td>10</td>
</tr> </tr>
<tr> <tr>
<td>Saved Searches</td> <td>Saved Searches</td>
<td>250</td> <td>250</td>
<td>250</td> <td>250</td>
<td>1,000</td>
</tr> </tr>
<tr> <tr>
<td>Search Timeout</td> <td>Search Timeout</td>
<td>3 sec</td> <td>3 sec</td>
<td>6 sec</td> <td>6 sec</td>
<td>9 sec</td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<% if @user_upgrade.purchaser.is_anonymous? %> <% if @user_upgrade.purchaser.is_anonymous? %>
<td><%= link_to "Login", login_path(url: new_user_upgrade_path), class: "login-button button-primary" %></td> <td><%= link_to "Login", login_path(url: new_user_upgrade_path), class: "login-button button-primary" %></td>
<td><%= link_to "Get #{Danbooru.config.canonical_app_name} Gold", login_path(url: new_user_upgrade_path), class: "login-button button-primary" %></td> <td><%= link_to "Get #{Danbooru.config.canonical_app_name} Gold", login_path(url: new_user_upgrade_path), class: "login-button button-primary" %></td>
<td><%= link_to "Get #{Danbooru.config.canonical_app_name} Platinum", login_path(url: new_user_upgrade_path), class: "login-button button-primary" %></td>
<% elsif @recipient.level == User::Levels::MEMBER %> <% elsif @recipient.level == User::Levels::MEMBER %>
<td></td> <td></td>
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", user_upgrades_path(user_id: @recipient.id, upgrade_type: "gold", country: params[:country], promo: params[:promo]), class: "button-primary", remote: true, disable_with: "Redirecting..." %></td> <td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", user_upgrades_path(user_id: @recipient.id, upgrade_type: "gold", country: params[:country], promo: params[:promo]), class: "button-primary", remote: true, disable_with: "Redirecting..." %></td>
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Platinum", user_upgrades_path(user_id: @recipient.id, upgrade_type: "platinum", country: params[:country], promo: params[:promo]), class: "button-primary", remote: true, disable_with: "Redirecting..." %></td>
<% elsif @recipient.level == User::Levels::GOLD %>
<td></td>
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", nil, class: "button-primary", disabled: true %></td>
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Platinum", user_upgrades_path(user_id: @recipient.id, upgrade_type: "gold_to_platinum", country: params[:country], promo: params[:promo]), class: "button-primary", remote: true, disable_with: "Redirecting..." %></td>
<% else %> <% else %>
<td></td> <td></td>
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", nil, class: "button-primary", disabled: true %></td> <td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", nil, class: "button-primary", disabled: true %></td>
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Platinum", nil, class: "button-primary", disabled: true %></td>
<% end %> <% end %>
</tr> </tr>
</tbody> </tbody>
@@ -143,13 +122,6 @@
results, and also keep more favorite groups and saved searches.</p> results, and also keep more favorite groups and saved searches.</p>
</details> </details>
<details>
<summary>What are the benefits of <%= Danbooru.config.canonical_app_name %> Platinum?</summary>
<p>Platinum is like Gold, but it lets you search even more tags at once,
and keep even more favorite groups and saved searches.</p>
</details>
<details> <details>
<summary>What payment methods do you support?</summary> <summary>What payment methods do you support?</summary>
@@ -168,14 +140,6 @@
only once and keep the upgrade forever.</p> only once and keep the upgrade forever.</p>
</details> </details>
<details>
<summary>If I upgrade to Gold first, can I upgrade to Platinum later?</summary>
<p>Yes, if you have a Gold account, you can always upgrade to a Platinum
account later. You don't have to pay full price to upgrade from Gold to
Platinum. You only have to pay the difference.</p>
</details>
<details> <details>
<summary>What is your refund policy?</summary> <summary>What is your refund policy?</summary>

View File

@@ -13,12 +13,12 @@
<%= subnav_link_to "Settings", settings_path %> <%= subnav_link_to "Settings", settings_path %>
<%= subnav_link_to "Messages #{unread_dmail_indicator(CurrentUser.user)}", dmails_path(search: { folder: "received" }) %> <%= subnav_link_to "Messages #{unread_dmail_indicator(CurrentUser.user)}", dmails_path(search: { folder: "received" }) %>
<% if !@user.is_platinum? %> <% if !@user.is_gold? %>
<%= subnav_link_to "Upgrade", new_user_upgrade_path %> <%= subnav_link_to "Upgrade", new_user_upgrade_path %>
<% end %> <% end %>
<% else %> <% else %>
<%= subnav_link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %> <%= subnav_link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %>
<% if !@user.is_platinum? %> <% if !@user.is_gold? %>
<%= subnav_link_to "Gift upgrade", new_user_upgrade_path(:user_id => @user.id) %> <%= subnav_link_to "Gift upgrade", new_user_upgrade_path(:user_id => @user.id) %>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -84,7 +84,7 @@
<td> <td>
<%= user.level_string %> <%= user.level_string %>
<% if !user.is_platinum? %> <% if !user.is_gold? %>
<% if CurrentUser.user == user %> <% if CurrentUser.user == user %>
(<%= link_to "Upgrade account", new_user_upgrade_path %>) (<%= link_to "Upgrade account", new_user_upgrade_path %>)
<% else %> <% else %>

View File

@@ -52,7 +52,7 @@
<% end %> <% end %>
<% end %> <% end %>
<% if !@user.is_platinum? %> <% if !@user.is_gold? %>
<% menu.item do %> <% menu.item do %>
<%= link_to new_user_upgrade_path(user_id: @user.id) do %> <%= link_to new_user_upgrade_path(user_id: @user.id) do %>
<%= gift_icon %> Gift Upgrade <%= gift_icon %> Gift Upgrade