Retire semantic_form_for

Also a buttload of form cleanups...
This commit is contained in:
Henne Vogelsang 2022-02-23 17:52:16 +01:00
parent 350b1ebbbe
commit 81853d1ef9
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
136 changed files with 1825 additions and 1441 deletions

View file

@ -1,18 +1,25 @@
.row
.col-md-12
.page-header
%h1
- if @ticket.new_record?
New
= @ticket.title
Ticket
.row
.col-md-8
= semantic_form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f|
= f.input :title, input_html: { autofocus: true }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } }
= f.input :price
= f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false
= f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.'
%p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
= form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f|
.form-group
= f.label :title
%abbr{title: 'This field is required'} *
= f.text_field :title, required: true, autofocus: true, class: 'form-control'
.form-group
= f.text_area :description, rows: 5, data: { provide: 'markdown' }, class: 'form-control'
.form-group
= f.label :price
= f.number_field :price, class: 'form-control'
- if Ticket.where(conference: @conference).empty?
.form-group
= f.label :price_currency, 'Currency'
= f.select :price_currency, ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], { include_blank: false }, { class: 'form-control' }
- else
= hidden_field_tag "ticket[price_currency]", f.object.conference.tickets.first.price_currency
%span.help-block
Your conference tickets are in
= f.object.conference.tickets.first.price_currency
.checkbox
%label
= f.check_box :registration_ticket
A registration ticket is with which user register for the conference.
%p.text-right
= f.submit nil, class: 'btn btn-primary'