- values = @lifetimes.map { |i| i.value }.uniq.sort() - @lifetimes.group_by { |l| l.value }.each do |value, items| - title = discount_lifetime_title(items) - notes = discount_lifetime_notes(items, value) .life_time_item .life_time_description span => raw title p = raw notes .life_time_procent span = t :offer_html, scope: [:account, :discounts, :text], offer: pretty_number(value.to_f) / strong / => "#{value.to_i}%" / | off .life_time_use - if (@active_lifetime || 0) < value.to_f span.button.button_disabled[ tooltip-ster="{contentAsHTML: 'true', theme: 'tooltipster-cabinet'}" title="#{discount_progress_title(finance, lifetimes, value)}" ] = t :use_lifetime, scope: [:account, :discounts, :button] - elsif (@active_lifetime || 0) > value.to_f span.button.button_disabled[ tooltip-ster="{contentAsHTML: 'true', theme: 'tooltipster-cabinet'}" title="Offer already achieved" ] = t :use_lifetime, scope: [:account, :discounts, :button] - else = link_to new_order_path(discount: @customer_lifetime.public_token), class: 'button' = t :use_lifetime, scope: [:account, :discounts, :button] .life_time_code span = t :code, scope: [:account, :discounts, :text] strong = @customer_lifetime.public_token