Skip to content

Commit c04c033

Browse files
committed
Inline standalone_track_select that is used only once
1 parent 0696f77 commit c04c033

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

app/decorators/proposal_decorator.rb

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -166,27 +166,6 @@ def speaker_input(form)
166166
form.input :speaker
167167
end
168168

169-
def standalone_track_select(tooltip)
170-
h.simple_form_for :proposal, html: {data: {controller: 'proposal-select'}} do |f|
171-
f.input :track,
172-
required: false,
173-
label_html: { class: 'info-item-heading' },
174-
collection: track_options,
175-
include_blank: Track::NO_TRACK,
176-
selected: object.track_id,
177-
id: 'track',
178-
input_html: {
179-
class: 'proposal-track-select form-control select',
180-
data: {
181-
target_path: h.event_staff_program_proposal_update_track_path(object.event, object),
182-
select_type: 'track',
183-
action: 'change->proposal-select#change'
184-
},
185-
},
186-
popover_icon: { content: tooltip }
187-
end
188-
end
189-
190169
def standalone_format_select(tooltip)
191170
h.simple_form_for :proposal, html: {data: {controller: 'proposal-select'}} do |f|
192171
f.input :format,
@@ -247,5 +226,4 @@ def state_class(state)
247226
'label-default'
248227
end
249228
end
250-
251229
end
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
- if proposal.event.multiple_tracks?
2-
= proposal.standalone_track_select(track_tooltip)
2+
= simple_form_for :proposal, html: {data: {controller: 'proposal-select'}} do |f|
3+
= f.input :track,
4+
required: false,
5+
label_html: {class: 'info-item-heading'},
6+
collection: proposal.track_options,
7+
include_blank: Track::NO_TRACK,
8+
selected: proposal.track_id,
9+
id: 'track',
10+
popover_icon: {content: track_tooltip},
11+
input_html: {class: 'proposal-track-select form-control select', data: {target_path: event_staff_program_proposal_update_track_path(proposal.event, proposal), select_type: 'track', action: 'change->proposal-select#change'}}
312
- else
413
= proposal.track_name

0 commit comments

Comments
 (0)