Use shared `form` partial for `admin/announcements` views (#29608)
parent
e5d5bd7ff1
commit
4837bfcc6a
|
@ -0,0 +1,28 @@
|
||||||
|
.fields-group
|
||||||
|
= form.input :starts_at,
|
||||||
|
html5: true,
|
||||||
|
include_blank: true,
|
||||||
|
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
||||||
|
wrapper: :with_block_label
|
||||||
|
= form.input :ends_at,
|
||||||
|
html5: true,
|
||||||
|
include_blank: true,
|
||||||
|
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
||||||
|
wrapper: :with_block_label
|
||||||
|
|
||||||
|
.fields-group
|
||||||
|
= form.input :all_day,
|
||||||
|
as: :boolean,
|
||||||
|
wrapper: :with_label
|
||||||
|
|
||||||
|
.fields-group
|
||||||
|
= form.input :text,
|
||||||
|
wrapper: :with_block_label
|
||||||
|
|
||||||
|
- unless form.object.published?
|
||||||
|
.fields-group
|
||||||
|
= form.input :scheduled_at,
|
||||||
|
html5: true,
|
||||||
|
include_blank: true,
|
||||||
|
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
||||||
|
wrapper: :with_block_label
|
|
@ -1,37 +1,12 @@
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('.title')
|
= t('.title')
|
||||||
|
|
||||||
= simple_form_for @announcement, url: admin_announcement_path(@announcement), html: { novalidate: false } do |f|
|
= simple_form_for @announcement, url: admin_announcement_path(@announcement), html: { novalidate: false } do |form|
|
||||||
= render 'shared/error_messages', object: @announcement
|
= render 'shared/error_messages', object: @announcement
|
||||||
|
|
||||||
.fields-group
|
= render form
|
||||||
= f.input :starts_at,
|
|
||||||
html5: true,
|
|
||||||
include_blank: true,
|
|
||||||
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
|
||||||
wrapper: :with_block_label
|
|
||||||
= f.input :ends_at,
|
|
||||||
html5: true,
|
|
||||||
include_blank: true,
|
|
||||||
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
|
||||||
wrapper: :with_block_label
|
|
||||||
|
|
||||||
.fields-group
|
|
||||||
= f.input :all_day,
|
|
||||||
as: :boolean,
|
|
||||||
wrapper: :with_label
|
|
||||||
|
|
||||||
.fields-group
|
|
||||||
= f.input :text,
|
|
||||||
wrapper: :with_block_label
|
|
||||||
|
|
||||||
- unless @announcement.published?
|
|
||||||
.fields-group
|
|
||||||
= f.input :scheduled_at,
|
|
||||||
html5: true,
|
|
||||||
include_blank: true,
|
|
||||||
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
|
||||||
wrapper: :with_block_label
|
|
||||||
|
|
||||||
.actions
|
.actions
|
||||||
= f.button :button, t('generic.save_changes'), type: :submit
|
= form.button :button,
|
||||||
|
t('generic.save_changes'),
|
||||||
|
type: :submit
|
||||||
|
|
|
@ -1,38 +1,12 @@
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('.title')
|
= t('.title')
|
||||||
|
|
||||||
= simple_form_for @announcement, url: admin_announcements_path, html: { novalidate: false } do |f|
|
= simple_form_for @announcement, url: admin_announcements_path, html: { novalidate: false } do |form|
|
||||||
= render 'shared/error_messages', object: @announcement
|
= render 'shared/error_messages', object: @announcement
|
||||||
|
|
||||||
.fields-group
|
= render form
|
||||||
= f.input :starts_at,
|
|
||||||
html5: true,
|
|
||||||
include_blank: true,
|
|
||||||
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
|
||||||
wrapper: :with_block_label
|
|
||||||
= f.input :ends_at,
|
|
||||||
html5: true,
|
|
||||||
include_blank: true,
|
|
||||||
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
|
||||||
wrapper: :with_block_label
|
|
||||||
|
|
||||||
.fields-group
|
|
||||||
= f.input :all_day,
|
|
||||||
as: :boolean,
|
|
||||||
wrapper: :with_label
|
|
||||||
|
|
||||||
.fields-group
|
|
||||||
= f.input :text,
|
|
||||||
wrapper: :with_block_label
|
|
||||||
|
|
||||||
.fields-group
|
|
||||||
= f.input :scheduled_at,
|
|
||||||
html5: true,
|
|
||||||
include_blank: true,
|
|
||||||
input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
|
|
||||||
wrapper: :with_block_label
|
|
||||||
|
|
||||||
.actions
|
.actions
|
||||||
= f.button :button,
|
= form.button :button,
|
||||||
t('.create'),
|
t('.create'),
|
||||||
type: :submit
|
type: :submit
|
||||||
|
|
Loading…
Reference in New Issue