mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 02:05:57 +02:00
35 lines
1.4 KiB
Text
35 lines
1.4 KiB
Text
= form_for([:admin, @pricelist], multipart: true) do |f|
|
|
= render 'shared/errors', object: f.object
|
|
|
|
.row
|
|
.col-md-6
|
|
.form-group
|
|
= f.label :operation_category
|
|
= f.select(:operation_category, Pricelist::OPERATION_CATEGORIES, {}, { class: 'form-control' })
|
|
.form-group
|
|
= f.label :category, t(:category)
|
|
= f.select(:category, Pricelist::CATEGORIES, {}, { class: 'form-control' })
|
|
.form-group
|
|
= f.label :duration
|
|
= f.select(:duration, Pricelist::DURATIONS, {}, { class: 'form-control' })
|
|
.form-group
|
|
= f.label :price
|
|
.input-group
|
|
= f.text_field(:price, value: currency(f.object.price), class: 'form-control')
|
|
%span.input-group-addon= Money.default_currency
|
|
.form-group.input-daterange
|
|
= f.label :valid_from, t(:valid)
|
|
.input-group
|
|
= f.text_field(:valid_from, value: f.object.valid_from.try(:to_s, :dshort),
|
|
class: 'form-control js-datepicker')
|
|
%span.input-group-addon -
|
|
= f.text_field(:valid_to, value: f.object.valid_to.try(:to_s, :dshort),
|
|
class: 'form-control js-datepicker')
|
|
|
|
%hr
|
|
.row
|
|
.col-md-12.text-right
|
|
= button_tag(t(:save), class: 'btn btn-warning')
|
|
- if !f.object.new_record? && can?(:delete, f.object)
|
|
= link_to t(:delete), admin_pricelist_path(f.object),
|
|
method: :delete, data: { confirm: t(:are_you_sure_destroy) }, class: 'btn btn-danger'
|