Refactor the new/edit submission forms
This commit is contained in:
parent
c55eff4eec
commit
ed20ff3b51
5 changed files with 101 additions and 115 deletions
|
|
@ -60,6 +60,19 @@ module EventsHelper
|
|||
"#{event.average_rating}/#{max_rating}, #{pluralize(event.voters.length, 'vote')}"
|
||||
end
|
||||
|
||||
def event_type_options(event_types)
|
||||
event_types.map do |type|
|
||||
[
|
||||
"#{type.title} - #{show_time(type.length)}",
|
||||
type.id,
|
||||
data: {
|
||||
min_words: type.minimum_abstract_length,
|
||||
max_words: type.maximum_abstract_length,
|
||||
help: type.submission_instructions
|
||||
}
|
||||
]
|
||||
end
|
||||
end
|
||||
def event_type_dropdown(event, event_types, conference_id)
|
||||
selection = event.event_type.try(:title) || 'Event Type'
|
||||
options = event_types.collect do |event_type|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue