Use shared form partial for admin/warning_presets
views (#30069)
This commit is contained in:
parent
b9b4db483c
commit
a9816f051d
3 changed files with 13 additions and 14 deletions
7
app/views/admin/warning_presets/_form.html.haml
Normal file
7
app/views/admin/warning_presets/_form.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
.fields-group
|
||||||
|
= form.input :title,
|
||||||
|
wrapper: :with_block_label
|
||||||
|
|
||||||
|
.fields-group
|
||||||
|
= form.input :text,
|
||||||
|
wrapper: :with_block_label
|
|
@ -1,14 +1,10 @@
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('admin.warning_presets.edit_preset')
|
= t('admin.warning_presets.edit_preset')
|
||||||
|
|
||||||
= simple_form_for @warning_preset, url: admin_warning_preset_path(@warning_preset) do |f|
|
= simple_form_for @warning_preset, url: admin_warning_preset_path(@warning_preset) do |form|
|
||||||
= render 'shared/error_messages', object: @warning_preset
|
= render 'shared/error_messages', object: @warning_preset
|
||||||
|
|
||||||
.fields-group
|
= render form
|
||||||
= f.input :title, wrapper: :with_block_label
|
|
||||||
|
|
||||||
.fields-group
|
|
||||||
= f.input :text, wrapper: :with_block_label
|
|
||||||
|
|
||||||
.actions
|
.actions
|
||||||
= f.button :button, t('generic.save_changes'), type: :submit
|
= form.button :button, t('generic.save_changes'), type: :submit
|
||||||
|
|
|
@ -2,17 +2,13 @@
|
||||||
= t('admin.warning_presets.title')
|
= t('admin.warning_presets.title')
|
||||||
|
|
||||||
- if can? :create, :account_warning_preset
|
- if can? :create, :account_warning_preset
|
||||||
= simple_form_for @warning_preset, url: admin_warning_presets_path do |f|
|
= simple_form_for @warning_preset, url: admin_warning_presets_path do |form|
|
||||||
= render 'shared/error_messages', object: @warning_preset
|
= render 'shared/error_messages', object: @warning_preset
|
||||||
|
|
||||||
.fields-group
|
= render form
|
||||||
= f.input :title, wrapper: :with_block_label
|
|
||||||
|
|
||||||
.fields-group
|
|
||||||
= f.input :text, wrapper: :with_block_label
|
|
||||||
|
|
||||||
.actions
|
.actions
|
||||||
= f.button :button, t('admin.warning_presets.add_new'), type: :submit
|
= form.button :button, t('admin.warning_presets.add_new'), type: :submit
|
||||||
|
|
||||||
%hr.spacer/
|
%hr.spacer/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue