keynote type available only to admins. Able to mark as highlight. Highlights and Keynotes scoped.
This commit is contained in:
parent
6a62e9f8b9
commit
8ac11821fa
3 changed files with 4 additions and 16 deletions
|
|
@ -566,18 +566,6 @@ class Conference < ActiveRecord::Base
|
||||||
email_settings.updated_conference_registration_dates_template
|
email_settings.updated_conference_registration_dates_template
|
||||||
end
|
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
|
private
|
||||||
|
|
||||||
after_create do
|
after_create do
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,10 @@
|
||||||
%h3.text-center
|
%h3.text-center
|
||||||
Don't miss out!
|
Don't miss out!
|
||||||
%br
|
%br
|
||||||
- if @conference.highlights.any?
|
- if @conference.events.highlights.any?
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
- @conference.highlights.each_slice(2) do |slice|
|
- @conference.events.highlights.each_slice(2) do |slice|
|
||||||
.row.row-centered
|
.row.row-centered
|
||||||
- slice.each do |event|
|
- slice.each do |event|
|
||||||
.col-md-6.col-centered.col-top.highlights
|
.col-md-6.col-centered.col-top.highlights
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
%section#details
|
%section#details
|
||||||
- if can? :update, @event or can? :create, @event
|
- if can? :update, @event or can? :create, @event
|
||||||
= f.input :event_type_id, as: :select,
|
= f.input :event_type_id, as: :select,
|
||||||
collection: @conference.event_types.map {|x| ["#{x.title} - #{show_time(x.length)}", x.id,
|
collection: @conference.event_types.reject { |type| type.title == 'Keynote'}.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
|
||||||
data: { min_words: x.minimum_abstract_length, max_words: x.maximum_abstract_length }]},
|
data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]},
|
||||||
include_blank: false, label: 'Session Type'
|
include_blank: false, label: 'Session Type'
|
||||||
- else
|
- else
|
||||||
Event type: #{@event.event_type.title}
|
Event type: #{@event.event_type.title}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue