remove keynotes
This commit is contained in:
parent
c9615f1880
commit
8b45c2a281
3 changed files with 1 additions and 19 deletions
|
|
@ -39,16 +39,6 @@ class ProposalController < ApplicationController
|
||||||
@event.event_users.new(user: current_user,
|
@event.event_users.new(user: current_user,
|
||||||
event_role: 'speaker')
|
event_role: 'speaker')
|
||||||
|
|
||||||
type_id = params[:event][:event_type_id].to_f
|
|
||||||
keynote_ids = EventType.where(title: 'Keynote').pluck(:id)
|
|
||||||
|
|
||||||
if keynote_ids.include? type_id
|
|
||||||
@event.errors.add(:event_type_id, 'You are not allowed to create a Keynote!')
|
|
||||||
flash[:error] = "Could not submit proposal: #{@event.errors.full_messages.join(', ')}"
|
|
||||||
render action: 'new'
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if !@event.save
|
if !@event.save
|
||||||
flash[:error] = "Could not submit proposal: #{@event.errors.full_messages.join(', ')}"
|
flash[:error] = "Could not submit proposal: #{@event.errors.full_messages.join(', ')}"
|
||||||
render action: 'new'
|
render action: 'new'
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,6 @@ class Conference < ActiveRecord::Base
|
||||||
where(state: :confirmed)
|
where(state: :confirmed)
|
||||||
end
|
end
|
||||||
|
|
||||||
def keynotes
|
|
||||||
where(state: :confirmed).select { |e| e.event_type.title == 'Keynote'}
|
|
||||||
end
|
|
||||||
|
|
||||||
def highlights
|
def highlights
|
||||||
where(is_highlight: true)
|
where(is_highlight: true)
|
||||||
end
|
end
|
||||||
|
|
@ -898,10 +894,6 @@ class Conference < ActiveRecord::Base
|
||||||
event_types << EventType.create(title: 'Workshop', length: 60, color: '#0000FF',
|
event_types << EventType.create(title: 'Workshop', length: 60, color: '#0000FF',
|
||||||
minimum_abstract_length: 0,
|
minimum_abstract_length: 0,
|
||||||
maximum_abstract_length: 500)
|
maximum_abstract_length: 500)
|
||||||
event_types << EventType.create(title: 'Keynote', length: 60, color: '#00FF00',
|
|
||||||
minimum_abstract_length: 0,
|
|
||||||
maximum_abstract_length: 500,
|
|
||||||
is_keynote: true)
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
%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.reject { |type| type.title == 'Keynote'}.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
|
collection: @conference.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
|
||||||
data: { min_words: type.minimum_abstract_length, max_words: type.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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue