suggested changes
This commit is contained in:
parent
949f5cb591
commit
b29856a122
2 changed files with 3 additions and 8 deletions
|
|
@ -79,12 +79,9 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
conference_params_copy = conference_params
|
org = Organization.find_or_create_by(name: 'organization')
|
||||||
if ENV['ORGANIZATIONS_ENABLED'] != 'true'
|
@conference = Conference.new(conference_params)
|
||||||
org = Organization.exists?(name: 'default') ? Organization.find_by(name: 'default') : Organization.create(name: 'default')
|
@conference.organization = org
|
||||||
conference_params_copy[:organization_id] = org.id
|
|
||||||
end
|
|
||||||
@conference = Conference.new(conference_params_copy)
|
|
||||||
if @conference.save
|
if @conference.save
|
||||||
# user that creates the conference becomes organizer of that conference
|
# user that creates the conference becomes organizer of that conference
|
||||||
current_user.add_role :organizer, @conference
|
current_user.add_role :organizer, @conference
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,6 @@
|
||||||
input_html: { required: 'required' }
|
input_html: { required: 'required' }
|
||||||
= f.input :short_title, hint: "A short and unique handle for your conference, using only letters, numbers, underscores, and dashes. This will be used to identify your conference in URLs etc. Example: 'froscon2011'",
|
= f.input :short_title, hint: "A short and unique handle for your conference, using only letters, numbers, underscores, and dashes. This will be used to identify your conference in URLs etc. Example: 'froscon2011'",
|
||||||
input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }, prepend: conferences_url + '/'
|
input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }, prepend: conferences_url + '/'
|
||||||
- if ENV['ORGANIZATIONS_ENABLED'] == 'true'
|
|
||||||
= f.input :organization, as: :select, collection: @organizations
|
|
||||||
= f.inputs 'Scheduling' do
|
= f.inputs 'Scheduling' do
|
||||||
= f.input :timezone, as: :time_zone, default: Time.zone.name, hint: 'Please select in what time zone your conference will take place.'
|
= f.input :timezone, as: :time_zone, default: Time.zone.name, hint: 'Please select in what time zone your conference will take place.'
|
||||||
= f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', required: 'required' }
|
= f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', required: 'required' }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue