Use shared form partial for admin/announcements views (#29608)

This commit is contained in:
Matt Jankowski 2024-04-19 09:57:32 -04:00 committed by GitHub
commit 4837bfcc6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 61 deletions

View file

@ -1,38 +1,12 @@
- content_for :page_title do
= 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
.fields-group
= 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
= render form
.actions
= f.button :button,
t('.create'),
type: :submit
= form.button :button,
t('.create'),
type: :submit