mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add form on the new voucher page
This commit is contained in:
@@ -5,6 +5,7 @@ module Admin
|
||||
|
||||
def new
|
||||
@enterprise = Enterprise.find_by permalink: params[:enterprise_id]
|
||||
@voucher = Voucher.new
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
.row
|
||||
.sixteen.columns.alpha
|
||||
.four.columns.alpha.text-right
|
||||
%a.button{ href: "#{edit_admin_enterprise_path(@enterprise)}#!#vouchers_panel"}
|
||||
= t('.back')
|
||||
.twelve.columns.omega
|
||||
.row
|
||||
.eight.columns.text-center
|
||||
%legend= t(".legend")
|
||||
.four.columns.text-right
|
||||
%input.red{ type: "button", value: t('.save') }
|
||||
.row
|
||||
.alpha.four.columns
|
||||
= label :voucher, :code, t('.voucher_code')
|
||||
.omega.eight.columns
|
||||
%textarea.fullwidth{ id: 'voucher_code', name: 'voucher_code', rows: 6 }
|
||||
.row
|
||||
.alpha.four.columns
|
||||
= label :voucher, :amount, t('.voucher_amount')
|
||||
.omega.eight.columns
|
||||
$
|
||||
%input{ type: 'text', id: 'voucher_amount', name: 'voucher_amount', value: 10, disabled: true }
|
||||
= form_with model: @voucher, url: admin_enterprise_vouchers_path(@enterprise), html: { name: "voucher_form" } do |f|
|
||||
.row
|
||||
.sixteen.columns.alpha
|
||||
.four.columns.alpha.text-right
|
||||
%a.button{ href: "#{edit_admin_enterprise_path(@enterprise)}#!#vouchers_panel"}
|
||||
= t('.back')
|
||||
.twelve.columns.omega
|
||||
.row
|
||||
.eight.columns.text-center
|
||||
%legend= t(".legend")
|
||||
.four.columns.text-right
|
||||
= f.submit t('.save'), class: 'red'
|
||||
.row
|
||||
.alpha.four.columns
|
||||
= f.label :code, t('.voucher_code')
|
||||
.omega.eight.columns
|
||||
= f.text_area :code, rows: 6, class: 'fullwidth'
|
||||
.row
|
||||
.alpha.four.columns
|
||||
= f.label :amount, t('.voucher_amount')
|
||||
.omega.eight.columns
|
||||
$
|
||||
= f.text_field :amount, value: 10, disabled: true
|
||||
|
||||
Reference in New Issue
Block a user