diff --git a/app/models/conference.rb b/app/models/conference.rb index 4cdf1a45..45f01b96 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -566,18 +566,6 @@ class Conference < ActiveRecord::Base email_settings.updated_conference_registration_dates_template end - def keynotes - events.where(state: 'confirmed').select { |e| e.event_type.title == 'Keynote'} - end - - ## - # - # ====Returns - # * +Array+ -> Events with attribute 'is_highlight' - def highlights - events.where(is_highlight: true) - end - private after_create do diff --git a/app/views/conference/_program.html.haml b/app/views/conference/_program.html.haml index a67d81e1..07a602c9 100644 --- a/app/views/conference/_program.html.haml +++ b/app/views/conference/_program.html.haml @@ -27,10 +27,10 @@ %h3.text-center Don't miss out! %br - - if @conference.highlights.any? + - if @conference.events.highlights.any? .row .col-md-12 - - @conference.highlights.each_slice(2) do |slice| + - @conference.events.highlights.each_slice(2) do |slice| .row.row-centered - slice.each do |event| .col-md-6.col-centered.col-top.highlights diff --git a/app/views/proposal/_proposal_form.html.haml b/app/views/proposal/_proposal_form.html.haml index 1d46f079..f6ed5bb1 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -11,8 +11,8 @@ %section#details - if can? :update, @event or can? :create, @event = f.input :event_type_id, as: :select, - collection: @conference.event_types.map {|x| ["#{x.title} - #{show_time(x.length)}", x.id, - data: { min_words: x.minimum_abstract_length, max_words: x.maximum_abstract_length }]}, + collection: @conference.event_types.reject { |type| type.title == 'Keynote'}.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id, + data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]}, include_blank: false, label: 'Session Type' - else Event type: #{@event.event_type.title}