user upgrades: factor out gold/platinum prices.

This commit is contained in:
evazion
2019-12-24 11:52:16 -06:00
parent 7694be9cb3
commit ef2eb9d0f5
6 changed files with 32 additions and 9 deletions

View File

@@ -2,10 +2,10 @@
<p>You can pay with a credit or debit card. Safebooru uses <a href="https://www.stripe.com">Stripe</a> as a payment intermediary so none of your personal information will be stored on the site.</p>
<% if user.level < User::Levels::GOLD %>
<%= stripe_button("Upgrade to Gold", 2000, user) %>
<%= stripe_button("Upgrade to Platinum", 4000, user) %>
<%= stripe_button("Upgrade to Gold", UserUpgrade.gold_price, user) %>
<%= stripe_button("Upgrade to Platinum", UserUpgrade.platinum_price, user) %>
<% elsif user.level < User::Levels::PLATINUM %>
<%= stripe_button("Upgrade Gold to Platinum", 2000, user) %>
<%= stripe_button("Upgrade Gold to Platinum", UserUpgrade.upgrade_price, user) %>
<% end %>
</div>

View File

@@ -23,8 +23,14 @@
<tr>
<td>Cost</td>
<td>Free</td>
<td>$20<div class="fineprint">One time fee</div></td>
<td>$40<div class="fineprint">One time fee</div></td>
<td>
<%= cents_to_usd(UserUpgrade.gold_price) %>
<div class="fineprint">One time fee</div>
</td>
<td>
<%= cents_to_usd(UserUpgrade.platinum_price) %>
<div class="fineprint">One time fee</div>
</td>
</tr>
<tr>
<td>Tag Limit</td>

View File

@@ -1,4 +1,4 @@
<div class="notice notice-info notice-large" id="upgrade-account-notice">
<h2><%= link_to "Upgrade your account for only $20!", new_user_upgrade_path, id: "goto-upgrade-account" %></h2>
<h2><%= link_to "Upgrade your account for only #{cents_to_usd(UserUpgrade.gold_price)}!", new_user_upgrade_path, id: "goto-upgrade-account" %></h2>
<div><%= link_to "No thanks", "#", id: "hide-upgrade-account-notice" %></div>
</div>