Retrospring/app/views/announcement/new.haml

38 lines
1.4 KiB
Plaintext
Raw Normal View History

2020-05-10 05:29:10 -07:00
- provide(:title, generate_title('Add new announcement'))
.container-lg.container--main
2020-05-10 05:29:10 -07:00
.card
.card-body
= bootstrap_form_for(@announcement, url: { action: 'create' }) do |f|
- if @announcement.errors.any?
.row
.col-md-12
.alert.alert-danger
%strong
= pluralize(@announcement.errors.count, 'error')
prohibited this announcement from being saved:
%ul
- @announcement.errors.full_messages.each do |err|
%li= err
.row
.col-md-12
= f.text_area :content, label: 'Content'
.row
.col-md-6
= f.url_field :link_href, label: 'Link URL'
.col-md-6
= f.text_field :link_text, label: 'Link text'
.row
.col-md-6
= f.datetime_field :starts_at,
label: 'Start time',
class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_starts_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.col-md-6
= f.datetime_field :ends_at,
label: 'End time',
class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_ends_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.row
.col-md-12.text-right
= f.submit class: 'btn btn-primary'