Skip to content

Commit

Permalink
Display track description on proposal form
Browse files Browse the repository at this point in the history
Tracks are otherwise undocumented for CfP respondents.
  • Loading branch information
AndrewKvalheim committed Mar 11, 2023
1 parent cef5010 commit 5cf738f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/views/proposals/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
- if @program.tracks.confirmed.cfp_active.any?
.form-group
= f.label :track_id, 'Track'
= f.select :track_id, @program.tracks.confirmed.cfp_active.pluck(:name, :id), { include_blank: '(Please select)' }, { class: 'form-control' }
= f.select :track_id, @program.tracks.confirmed.cfp_active.pluck(:name, :id), { include_blank: '(Please select)' }, { class: 'form-control select-help-toggle' }
- @program.tracks.confirmed.cfp_active.each do |track|
%span.help-block.select-help-text.collapse.event_track_id{ id: "#{track.id}-help", class: ('in' if track.id == @event.track_id) }
= markdown(track.description)
.form-group
= f.label :event_type_id, 'Type'
= f.select :event_type_id, event_type_select_options(@conference.program.event_types), { include_blank: false }, { class: 'select-help-toggle form-control' }
Expand Down
5 changes: 5 additions & 0 deletions spec/features/proposals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@

scenario 'update a proposal', js: true do
conference = create(:conference)
create :track, program: conference.program,
name: 'Example Track',
description: 'This track is an *example*.'
create(:cfp, program: conference.program)
proposal = create(:event, program: conference.program)

Expand All @@ -113,6 +116,8 @@
visit edit_conference_program_proposal_path(proposal.program.conference.short_title, proposal)

fill_in 'event_subtitle', with: 'My event subtitle'
select 'Example Track', from: 'Track'
expect(page).to have_selector '.in', text: 'This track is an example.'
select('Easy', from: 'event[difficulty_level_id]')
expect(page).to have_selector '.in', text: 'Events are understandable for everyone without knowledge of the topic.'

Expand Down

0 comments on commit 5cf738f

Please sign in to comment.