osem-fcy/app/views/tracks/_form.html.haml
Rishabh Singh 465976bc60 Add contactable to tracks
Added social media fields to track submission form
by using a polymorphic association with the
Contact Model.
2019-07-22 10:55:47 +05:30

31 lines
2.7 KiB
Text

.container
.row
.col-md-12
.page-header
%h1
- if @track.new_record?
New
= @track.name
Track
.row
.col-md-12
= semantic_form_for(@track, url: (@track.new_record? ? conference_program_tracks_path(@conference.short_title) : conference_program_track_path(@conference.short_title, @track))) do |f|
= f.input :name
= f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }
= f.input :color, input_html: {size: 6, type: 'color'}, required: true
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly' }
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' }
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, required: true, hint: "This will be public #{markdown_hint}".html_safe
= f.input :relevance, input_html: {rows: 5, data: { provide: 'markdown-editable' } }, required: true, hint: "Please explain here how this track relates to the conference, how you are related to its content and why we should accept it. #{markdown_hint}".html_safe
= f.inputs name:'Social Media' do
= f.semantic_fields_for :contact, @track.contact do |c|
= c.input :social_tag, hint: "The hashtag you'll use on Twitter and Google+. Don't include the '#' sign!'", required: false
= c.input :facebook, hint: 'This will appear in the social media section as a link to the Facebook.', required: false
= c.input :googleplus, label: 'Google+ Url', hint: 'This will appear in the social media section as a link to the Google+ Page of your Track', required: false
= c.input :twitter, hint: 'This will appear in the social media section as a link to the Twitter Page of your Track', required: false
= c.input :instagram, hint: 'This will appear in the social media section as a link to the Instagram Page of your Track', required: false
= c.input :mastodon, hint: 'This will appear in the social media section as a link to the Mastodon Page of your Track', required: false
= c.input :youtube, hint: 'This will appear in the social media section as a link to the YouTube channel for your Track.', required: false
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }