Files
danbooru/app/views/user_upgrades/new.html.erb
evazion 8239a1b551 upgrades: fix Danbooru.config.user_upgrades_enabled? setting
* Fix it so that if upgrades are disabled, only the payment button is disabled instead of the whole page.
* Fix it so that disabling upgrades with DANBOORU_USER_UPGRADES_ENABLED="false" works.
2022-05-17 01:24:38 -05:00

218 lines
8.7 KiB
Plaintext

<% page_title "Account Upgrade" %>
<% meta_description "Upgrade to a Gold account." %>
<%= render "users/secondary_links" %>
<div id="c-user-upgrades">
<div id="a-new" class="fixed-width-container mx-auto">
<% if @user_upgrade.is_gift? %>
<h1 class="text-center mb-4">Gift Account Upgrade</h1>
<% if @user_upgrade.recipient.is_platinum? %>
<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 %>
<h6>You are gifting this upgrade to <%= link_to_user @user_upgrade.recipient %>.</h6>
<% end %>
<% else %>
<h1 class="text-center mb-4">Upgrade Account</h1>
<p>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!</p>
<p><%= Danbooru.config.canonical_app_name %> Gold is a lifetime upgrade,
not a subscription. You pay only once and keep the upgrade forever!</p>
<p><b>Notice: Gold upgrades are temporarily disabled while we change our payment system.</b></p>
<% end %>
<% if Danbooru.config.is_promotion? %>
<p>
<%= tag.img src: "/images/padoru.gif", width: 24, height: 24 %>
<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 %>
</p>
<% end %>
<table id="feature-comparison" class="w-full text-center table-md mt-8 mb-8">
<thead>
<tr>
<th></th>
<th>Basic</th>
<th>Gold</th>
</tr>
</thead>
<tbody>
<colgroup id="labels" class="w-1/4"></colgroup>
<colgroup id="basic" class="w-1/4"></colgroup>
<colgroup id="gold" class="w-1/4"></colgroup>
<tr>
<td></td>
<td>Free</td>
<td>
<% if Danbooru.config.is_promotion? %>
<s>$20</s>
<% end %>
<b><%= number_to_currency(UserUpgrade.gold_price) %></b>
<div class="fineprint">One time fee</div>
</td>
</tr>
<tr>
<td>Tag Limit</td>
<td><%= User.tag_query_limit(User::Levels::MEMBER) %></td>
<td><%= User.tag_query_limit(User::Levels::GOLD) %></td>
</tr>
<tr>
<td>Page Limit</td>
<td><%= User.page_limit(User::Levels::MEMBER) %></td>
<td><%= User.page_limit(User::Levels::GOLD) %></td>
</tr>
<tr>
<td>Private Favorites</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Favorite Groups</td>
<td><%= User.favorite_group_limit(User::Levels::MEMBER) %></td>
<td>Unlimited</td>
</tr>
<tr>
<td>Saved Searches</td>
<td><%= User.max_saved_searches(User::Levels::MEMBER) %></td>
<td><%= User.max_saved_searches(User::Levels::GOLD) %></td>
</tr>
<tr>
<td>Max Search Duration</td>
<td>3 seconds</td>
<td>6 seconds</td>
</tr>
<tr>
<td></td>
<td></td>
<td>
<%= image_pack_tag("static/mastercard-logo.svg", width: 28, class: "icon") %>
<%= image_pack_tag("static/visa-logo.svg", width: 28, class: "icon") %>
<%= image_pack_tag("static/discover-logo.svg", width: 28, class: "icon") %>
</td>
</tr>
<tr>
<td></td>
<td>
<% if @user_upgrade.purchaser.is_anonymous? %>
<%= link_to "Create free account", new_user_path(url: new_user_upgrade_path), class: "button-outline-primary" %>
<% end %>
</td>
<td>
<% if !UserUpgrade.enabled? %>
<%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", user_upgrades_path(user_id: @recipient.id), class: "button-primary", disabled: true %>
<% elsif @user_upgrade.purchaser.is_anonymous? %>
<%= link_to "Get #{Danbooru.config.canonical_app_name} Gold", new_user_path(url: new_user_upgrade_path), class: "button-primary" %>
<% elsif @user_upgrade.recipient.level <= User::Levels::MEMBER %>
<%= 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], payment_processor: "authorize_net"), class: "button-primary", remote: true, disable_with: "Redirecting..." %>
<% else %>
<%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", user_upgrades_path(user_id: @recipient.id), class: "button-primary", disabled: true %>
<% end %>
</td>
</tr>
</tbody>
</table>
<% if @user_upgrade.purchaser.is_anonymous? %>
<p class="text-center">
Already have an account? <%= link_to "Log in", login_path(url: new_user_upgrade_path) %>.
</p>
<% end %>
<h2 class="mb-4">Frequently Asked Questions</h2>
<div id="frequently-asked-questions" class="divide-y-1">
<details>
<summary>What are the benefits of <%= Danbooru.config.canonical_app_name %> Gold?</summary>
<p><%= Danbooru.config.canonical_app_name %> Gold lets you search for more tags at once, browse
deeper in search results, keep your favorites private, and keep more favorite groups and saved searches.</p>
</details>
<details>
<summary>What is the tag limit?</summary>
<p>The tag limit is how many tags you can search for at once. Normal users can only search for
<%= User.tag_query_limit(User::Levels::MEMBER) %> tags at once. Gold users can search for up
to <%= User.tag_query_limit(User::Levels::GOLD) %> tags at once.</p>
<p>See <%= link_to_wiki "help:cheatsheet" %> for more information on searches.</p>
</details>
<details>
<summary>What is the page limit?</summary>
<p>Normal users can only browse posts up to page 1000. Gold users can browse posts up to page 5000.</p>
</details>
<details>
<summary>What are private favorites?</summary>
<p>Normally your favorites are visible to everyone. Gold users can make their favorites
private in their <%= link_to "account settings", settings_path %>.</p>
</details>
<details>
<summary>What are favorite groups?</summary>
<p>Favorite groups are like personal tags or pools. They let you organize your favorites
in groups however you wish. Gold users can have an unlimited number of favorite groups. See
<%= link_to_wiki "help:favorite groups" %> for more details.</p>
</details>
<details>
<summary>What are saved searches?</summary>
<p>Saved searches let you save your favorite tags and searches. They let you easily check for
new posts under your favorite tags. Gold users can keep up to 1000 saved searches. See
<%= link_to_wiki "help:saved searches" %> for more details.</p>
</details>
<details>
<summary>What is the max search duration?</summary>
<p>Complicated tag searches may take longer to execute. Normal users can only do
searches that take up to 3 seconds long. Gold users can do searches that take up to 6
seconds long. This means Gold users can do more complicated tag searches.</p>
</details>
<details>
<summary>Can I gift an upgrade to someone else?</summary>
<p>Sure. Just go to their profile page and look for the "Gift Upgrade" link.</p>
</details>
<details>
<summary>What payment methods do you support?</summary>
<p>We support all major credit and debit cards. We don't support PayPal or Bitcoin at this time.</p>
</details>
<details>
<summary>Is this a subscription?</summary>
<p>No, this is not a subscription. This is a one-time payment only. You pay only once and keep the upgrade forever.</p>
</details>
<details>
<summary>What is your refund policy?</summary>
<p>You can request a refund for any reason within 48 hours of your purchase. To request a refund,
<%= link_to "contact us", contact_path %> or send an email to <%= mail_to Danbooru.config.contact_email %>.
Please include your username in your request.</p>
<p>Refund requests will be responded to within 1 business day. Please note that it may take up to 10 business days for refunds
to be processed by your bank or credit card company.</p>
</details>
</div>
</div>
</div>