Move presentation method to a regular view helper
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
module SubscriptionsHelper
|
||||
def plan_storage_limit(plan)
|
||||
number_to_human_size(plan.storage_limit).delete(" ")
|
||||
end
|
||||
|
||||
def subscription_period_end_action(subscription)
|
||||
if subscription.to_be_canceled?
|
||||
"Your Fizzy subscription ends on"
|
||||
|
||||
@@ -47,8 +47,4 @@ class Plan
|
||||
def limit_cards?
|
||||
card_limit != Float::INFINITY
|
||||
end
|
||||
|
||||
def formatted_storage_limit
|
||||
ActionController::Base.helpers.number_to_human_size(storage_limit).delete(" ")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,18 +9,18 @@
|
||||
<h3 class="margin-block-start margin-block-end-half txt-large font-weight-black">You’ve used <u><%= Current.account.billed_cards_count %></u> free cards out of <%= Plan.free.card_limit %></h3>
|
||||
<% end %>
|
||||
|
||||
<p class="margin-none-block-start">If you’d like to keep using Fizzy past <%= Plan.free.card_limit %> cards, it’s only <strong>$<%= Plan.paid.price %>/month</strong> for <strong>unlimited cards</strong> + <strong>unlimited users</strong>. You’ll also get <strong><%= number_to_human_size(Plan.paid.formatted_storage_limit) %></strong> of storage. </p>
|
||||
<p class="margin-none-block-start">If you’d like to keep using Fizzy past <%= Plan.free.card_limit %> cards, it’s only <strong>$<%= Plan.paid.price %>/month</strong> for <strong>unlimited cards</strong> + <strong>unlimited users</strong>. You'll also get <strong><%= plan_storage_limit(Plan.paid) %></strong> of storage. </p>
|
||||
|
||||
<%= button_to "Upgrade to #{Plan.paid.name} for $#{ Plan.paid.price }/month", account_subscription_path, class: "btn settings-subscription__button txt-medium", form: { data: { turbo: false } } %>
|
||||
|
||||
<p>Cancel anytime, no contracts, take your data with you whenever.</p>
|
||||
<p class="settings-subscription__footer txt-small margin-none-block-end">Right now you’re on the <strong><%= Current.account.plan.name %></strong> plan which includes <%= Plan.free.card_limit %> cards, unlimited users, and <%= number_to_human_size(Plan.free.formatted_storage_limit) %> of storage.</p>
|
||||
<p class="settings-subscription__footer txt-small margin-none-block-end">Right now you’re on the <strong><%= Current.account.plan.name %></strong> plan which includes <%= Plan.free.card_limit %> cards, unlimited users, and <%= plan_storage_limit(Plan.free) %> of storage.</p>
|
||||
<% else %>
|
||||
<h3 class="margin-block-start margin-block-end-half txt-x-large font-weight-black">Thank you for buying Fizzy</h3>
|
||||
|
||||
<% if Current.account.subscription %>
|
||||
<%= render "account/settings/subscription", subscription: Current.account.subscription %>
|
||||
<p class="settings-subscription__footer txt-small">Right now you’re on the <strong><%= Current.account.plan.name %></strong> plan which includes unlimited cards, unlimited users, and <%= number_to_human_size(Plan.paid.formatted_storage_limit) %> of storage.</p>
|
||||
<p class="settings-subscription__footer txt-small">Right now you’re on the <strong><%= Current.account.plan.name %></strong> plan which includes unlimited cards, unlimited users, and <%= plan_storage_limit(Plan.paid) %> of storage.</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user