mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Form for changing enterprise type specifies trial length
This commit is contained in:
@@ -16,6 +16,10 @@ module Admin
|
||||
|
||||
private
|
||||
|
||||
def free_use?
|
||||
Spree::Config[:account_invoices_monthly_fixed] == 0 && Spree::Config[:account_invoices_monthly_rate] == 0
|
||||
end
|
||||
|
||||
def fixed_description
|
||||
fixed_amount = Spree::Money.new(Spree::Config[:account_invoices_monthly_fixed], {currency: Spree::Config[:currency]} ).rounded
|
||||
monthly_bill_includes_fixed? ? "#{fixed_amount}" : ""
|
||||
|
||||
@@ -76,8 +76,12 @@
|
||||
%span.error{ ng: { show: "(change_type.sells.$error.required || change_type.sells.$error.pattern) && submitted" } }
|
||||
Please choose one of the options above.
|
||||
- if @enterprise.sells == 'unspecified' && @enterprise.shop_trial_start_date.nil?
|
||||
%input.button.big{ type: 'submit', value: 'Start 30 Day Trial', ng: { click: "submit(change_type)", show: "sells=='own' || sells=='any'" } }
|
||||
%input.button.big{ type: 'submit', value: 'Select and continue', ng: { click: "submit(change_type)", hide: "sells=='own' || sells=='any'" } }
|
||||
-if free_use?
|
||||
%input.button.big{ type: 'submit', value: 'Select and continue', ng: { click: "submit(change_type)" } }
|
||||
- else
|
||||
- trial_length = Spree::Config[:shop_trial_length_days]
|
||||
%input.button.big{ type: 'submit', value: "Start #{trial_length}-Day Shop Trial", ng: { click: "submit(change_type)", show: "sells=='own' || sells=='any'" } }
|
||||
%input.button.big{ type: 'submit', value: 'Select and continue', ng: { click: "submit(change_type)", hide: "sells=='own' || sells=='any'" } }
|
||||
- elsif @enterprise.sells == 'unspecified'
|
||||
%input.button.big{ type: 'submit', value: 'Select and continue', ng: { click: "submit(change_type)" } }
|
||||
- else
|
||||
|
||||
Reference in New Issue
Block a user