' +
@@ -402,6 +436,9 @@ module ApplicationHelper
when 'conferences'
object = @conference
tabs = ConferencesHelper::TABS
+ when 'workshops'
+ object = [@conference, @workshop]
+ tabs = WorkshopsHelper::TABS
end
if object && tabs
@@ -451,9 +488,9 @@ module ApplicationHelper
('
' + object.send(attribute.to_s).strip.gsub(/\s*\n+\s*/, '
') + '
').html_safe
end
- def form_field(f)
+ def form_field(f, response = nil)
id = 'field_' + f.id.to_s
- html = p(f, 'title')#'
'
+ html = p(f, 'title')
options = JSON.parse(f.options)
if f.field_type == 'multiple'
@@ -466,12 +503,19 @@ module ApplicationHelper
kv = value.split(/\s*\|\s*/, 2)
opts[kv[0]] = kv[1]
end
- opts.each do |key, value|
- #html += self.send(options['selection_type'] + '_tag', 'field-' + id)
- html += field((id + '_' + key), options['selection_type'] + '_tag', label: value)
+
+ val = response ? ActiveSupport::JSON.decode(response.data) : Hash.new
+
+ if f.repeats?
+ is_array = f.is_array?
+ opts.each do |key, value|
+ html += field((id + (is_array ? ('_' + key) : '')).to_sym, options['selection_type'] + '_tag', label: value, value: is_array ? (val ? val[key] : nil) : key, checked: is_array ? (val[key] == "1" || val[key] == "on") : val.to_s == key.to_s, required: f.required)
+ end
+ else
+ html += field(id.to_sym, options['selection_type'] + '_tag', opts, value: val, required: f.required)
end
else
- html += field(id.to_sym, options['input_type'] + '_tag', label: false, placeholder: f.help)
+ html += field(id.to_sym, options['input_type'] + '_tag', label: false, placeholder: f.help, value: response ? ActiveSupport::JSON.decode(response.data) : nil, required: f.required)
end
html.html_safe
diff --git a/app/helpers/event_types_helper.rb b/app/helpers/event_types_helper.rb
new file mode 100644
index 0000000..bf74a6e
--- /dev/null
+++ b/app/helpers/event_types_helper.rb
@@ -0,0 +1,2 @@
+module EventTypesHelper
+end
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb
new file mode 100644
index 0000000..8a9a878
--- /dev/null
+++ b/app/helpers/events_helper.rb
@@ -0,0 +1,2 @@
+module EventsHelper
+end
diff --git a/app/helpers/workshop_facilitators_helper.rb b/app/helpers/workshop_facilitators_helper.rb
new file mode 100644
index 0000000..302508e
--- /dev/null
+++ b/app/helpers/workshop_facilitators_helper.rb
@@ -0,0 +1,2 @@
+module WorkshopFacilitatorsHelper
+end
diff --git a/app/helpers/workshop_requested_resources_helper.rb b/app/helpers/workshop_requested_resources_helper.rb
new file mode 100644
index 0000000..47680fa
--- /dev/null
+++ b/app/helpers/workshop_requested_resources_helper.rb
@@ -0,0 +1,2 @@
+module WorkshopRequestedResourcesHelper
+end
diff --git a/app/helpers/workshops_helper.rb b/app/helpers/workshops_helper.rb
new file mode 100644
index 0000000..71e33f4
--- /dev/null
+++ b/app/helpers/workshops_helper.rb
@@ -0,0 +1,4 @@
+module WorkshopsHelper
+ TABS = [{:conference_path => 0}, {:conference_workshop_path => nil}, {:edit_conference_workshop_path => nil}]#, :hosts]
+ #SUB_TABS = [:registration, :registration_form, :registration_register, :registration_stats]
+end
diff --git a/app/models/conference.rb b/app/models/conference.rb
index 64ac13a..5d09ece 100644
--- a/app/models/conference.rb
+++ b/app/models/conference.rb
@@ -10,6 +10,8 @@ class Conference < ActiveRecord::Base
has_many :conference_registration_form_fields, :order => 'position ASC', :dependent => :destroy#, :class_name => '::ConferenceRegistrationFormField'
has_many :registration_form_fields, :through => :conference_registration_form_fields
+ has_many :workshops
+
accepts_nested_attributes_for :conference_host_organizations, :reject_if => proc {|u| u[:organization_id].blank?}, :allow_destroy => true
def to_param
diff --git a/app/models/event.rb b/app/models/event.rb
new file mode 100644
index 0000000..3a829fd
--- /dev/null
+++ b/app/models/event.rb
@@ -0,0 +1,2 @@
+class Event < ActiveRecord::Base
+end
diff --git a/app/models/event_type.rb b/app/models/event_type.rb
new file mode 100644
index 0000000..3c7329a
--- /dev/null
+++ b/app/models/event_type.rb
@@ -0,0 +1,2 @@
+class EventType < ActiveRecord::Base
+end
diff --git a/app/models/registration_form_field.rb b/app/models/registration_form_field.rb
index 95f41c5..c02288d 100644
--- a/app/models/registration_form_field.rb
+++ b/app/models/registration_form_field.rb
@@ -56,6 +56,14 @@ class RegistrationFormField < ActiveRecord::Base
o
end
+ def repeats?()
+ field_type.to_s == 'multiple' && selection_type.to_s != 'select'
+ end
+
+ def is_array?()
+ field_type.to_s == 'multiple' && selection_type.to_s != 'radio_button'
+ end
+
private
def get_from_options(key)
if options
diff --git a/app/models/workshop.rb b/app/models/workshop.rb
new file mode 100644
index 0000000..eaf8846
--- /dev/null
+++ b/app/models/workshop.rb
@@ -0,0 +1,7 @@
+class Workshop < ActiveRecord::Base
+ belongs_to :conference
+
+ def to_param
+ slug
+ end
+end
diff --git a/app/models/workshop_facilitator.rb b/app/models/workshop_facilitator.rb
new file mode 100644
index 0000000..cbd4419
--- /dev/null
+++ b/app/models/workshop_facilitator.rb
@@ -0,0 +1,2 @@
+class WorkshopFacilitator < ActiveRecord::Base
+end
diff --git a/app/models/workshop_requested_resource.rb b/app/models/workshop_requested_resource.rb
new file mode 100644
index 0000000..317eea9
--- /dev/null
+++ b/app/models/workshop_requested_resource.rb
@@ -0,0 +1,2 @@
+class WorkshopRequestedResource < ActiveRecord::Base
+end
diff --git a/app/views/conferences/_registration_register.html.haml b/app/views/conferences/_registration_register.html.haml
index ebff97d..d7779bd 100644
--- a/app/views/conferences/_registration_register.html.haml
+++ b/app/views/conferences/_registration_register.html.haml
@@ -1,7 +1,8 @@
.columns.medium-8
- = field :is_attending, :select_tag, ConferenceRegistration::AttendingOptions, label: 'Are you attending?'
+ = field :is_attending, :select_tag, ConferenceRegistration::AttendingOptions, label: 'Are you attending?', value: @conference_registration.try(:is_attending)
%ol
- @conference.registration_form_fields.each do |ff|
%li
- = form_field ff
+ - response = @conference_registration ? ConferenceRegistrationResponse.find_by(conference_registration_id: @conference_registration.id, registration_form_field_id: ff.id) : nil
+ = form_field ff, response
= actions :register
diff --git a/app/views/event_types/_form.html.haml b/app/views/event_types/_form.html.haml
new file mode 100644
index 0000000..99cb943
--- /dev/null
+++ b/app/views/event_types/_form.html.haml
@@ -0,0 +1,16 @@
+= form_for @event_type do |f|
+ - if @event_type.errors.any?
+ #error_explanation
+ %h2= "#{pluralize(@event_type.errors.count, "error")} prohibited this event_type from being saved:"
+ %ul
+ - @event_type.errors.full_messages.each do |msg|
+ %li= msg
+
+ .field
+ = f.label :slug
+ = f.text_field :slug
+ .field
+ = f.label :info
+ = f.text_area :info
+ .actions
+ = f.submit 'Save'
diff --git a/app/views/event_types/edit.html.haml b/app/views/event_types/edit.html.haml
new file mode 100644
index 0000000..4d1d4c1
--- /dev/null
+++ b/app/views/event_types/edit.html.haml
@@ -0,0 +1,7 @@
+%h1 Editing event_type
+
+= render 'form'
+
+= link_to 'Show', @event_type
+\|
+= link_to 'Back', event_types_path
diff --git a/app/views/event_types/index.html.haml b/app/views/event_types/index.html.haml
new file mode 100644
index 0000000..8c75a12
--- /dev/null
+++ b/app/views/event_types/index.html.haml
@@ -0,0 +1,21 @@
+%h1 Listing event_types
+
+%table
+ %tr
+ %th Slug
+ %th Info
+ %th
+ %th
+ %th
+
+ - @event_types.each do |event_type|
+ %tr
+ %td= event_type.slug
+ %td= event_type.info
+ %td= link_to 'Show', event_type
+ %td= link_to 'Edit', edit_event_type_path(event_type)
+ %td= link_to 'Destroy', event_type, :method => :delete, :data => { :confirm => 'Are you sure?' }
+
+%br
+
+= link_to 'New Event type', new_event_type_path
diff --git a/app/views/event_types/new.html.haml b/app/views/event_types/new.html.haml
new file mode 100644
index 0000000..ff86de1
--- /dev/null
+++ b/app/views/event_types/new.html.haml
@@ -0,0 +1,5 @@
+%h1 New event_type
+
+= render 'form'
+
+= link_to 'Back', event_types_path
diff --git a/app/views/event_types/show.html.haml b/app/views/event_types/show.html.haml
new file mode 100644
index 0000000..a37627f
--- /dev/null
+++ b/app/views/event_types/show.html.haml
@@ -0,0 +1,12 @@
+%p#notice= notice
+
+%p
+ %b Slug:
+ = @event_type.slug
+%p
+ %b Info:
+ = @event_type.info
+
+= link_to 'Edit', edit_event_type_path(@event_type)
+\|
+= link_to 'Back', event_types_path
diff --git a/app/views/events/_form.html.haml b/app/views/events/_form.html.haml
new file mode 100644
index 0000000..e87849b
--- /dev/null
+++ b/app/views/events/_form.html.haml
@@ -0,0 +1,34 @@
+= form_for @event do |f|
+ - if @event.errors.any?
+ #error_explanation
+ %h2= "#{pluralize(@event.errors.count, "error")} prohibited this event from being saved:"
+ %ul
+ - @event.errors.full_messages.each do |msg|
+ %li= msg
+
+ .field
+ = f.label :title
+ = f.text_field :title
+ .field
+ = f.label :slug
+ = f.text_field :slug
+ .field
+ = f.label :event_type_id
+ = f.number_field :event_type_id
+ .field
+ = f.label :conference
+ = f.text_field :conference
+ .field
+ = f.label :info
+ = f.text_area :info
+ .field
+ = f.label :location
+ = f.text_field :location
+ .field
+ = f.label :start_time
+ = f.datetime_select :start_time
+ .field
+ = f.label :end_time
+ = f.datetime_select :end_time
+ .actions
+ = f.submit 'Save'
diff --git a/app/views/events/edit.html.haml b/app/views/events/edit.html.haml
new file mode 100644
index 0000000..5828e7a
--- /dev/null
+++ b/app/views/events/edit.html.haml
@@ -0,0 +1,7 @@
+%h1 Editing event
+
+= render 'form'
+
+= link_to 'Show', @event
+\|
+= link_to 'Back', events_path
diff --git a/app/views/events/index.html.haml b/app/views/events/index.html.haml
new file mode 100644
index 0000000..1f3bc64
--- /dev/null
+++ b/app/views/events/index.html.haml
@@ -0,0 +1,33 @@
+%h1 Listing events
+
+%table
+ %tr
+ %th Title
+ %th Slug
+ %th Event type
+ %th Conference
+ %th Info
+ %th Location
+ %th Start time
+ %th End time
+ %th
+ %th
+ %th
+
+ - @events.each do |event|
+ %tr
+ %td= event.title
+ %td= event.slug
+ %td= event.event_type_id
+ %td= event.conference
+ %td= event.info
+ %td= event.location
+ %td= event.start_time
+ %td= event.end_time
+ %td= link_to 'Show', event
+ %td= link_to 'Edit', edit_event_path(event)
+ %td= link_to 'Destroy', event, :method => :delete, :data => { :confirm => 'Are you sure?' }
+
+%br
+
+= link_to 'New Event', new_event_path
diff --git a/app/views/events/new.html.haml b/app/views/events/new.html.haml
new file mode 100644
index 0000000..6e0cccf
--- /dev/null
+++ b/app/views/events/new.html.haml
@@ -0,0 +1,5 @@
+%h1 New event
+
+= render 'form'
+
+= link_to 'Back', events_path
diff --git a/app/views/events/show.html.haml b/app/views/events/show.html.haml
new file mode 100644
index 0000000..7a68a3b
--- /dev/null
+++ b/app/views/events/show.html.haml
@@ -0,0 +1,30 @@
+%p#notice= notice
+
+%p
+ %b Title:
+ = @event.title
+%p
+ %b Slug:
+ = @event.slug
+%p
+ %b Event type:
+ = @event.event_type_id
+%p
+ %b Conference:
+ = @event.conference
+%p
+ %b Info:
+ = @event.info
+%p
+ %b Location:
+ = @event.location
+%p
+ %b Start time:
+ = @event.start_time
+%p
+ %b End time:
+ = @event.end_time
+
+= link_to 'Edit', edit_event_path(@event)
+\|
+= link_to 'Back', events_path
diff --git a/app/views/registration_form_fields/_form.html.haml b/app/views/registration_form_fields/_form.html.haml
index 3224c87..7ac254a 100644
--- a/app/views/registration_form_fields/_form.html.haml
+++ b/app/views/registration_form_fields/_form.html.haml
@@ -5,7 +5,8 @@
%ul
- @registration_form_field.errors.full_messages.each do |msg|
%li= msg
-
+ - if @conference
+ = field :conference_id, :hidden_field_tag, value: @conference.id
= field f, :field_type, :select, RegistrationFormField::Types.keys
- RegistrationFormField::Fields.each do |key, value|
- classes = RegistrationFormField::TypesForField(key.to_sym).collect{|v| 'field-type-' + v.to_s}
diff --git a/app/views/workshop_facilitators/_form.html.haml b/app/views/workshop_facilitators/_form.html.haml
new file mode 100644
index 0000000..d4b8741
--- /dev/null
+++ b/app/views/workshop_facilitators/_form.html.haml
@@ -0,0 +1,19 @@
+= form_for @workshop_facilitator do |f|
+ - if @workshop_facilitator.errors.any?
+ #error_explanation
+ %h2= "#{pluralize(@workshop_facilitator.errors.count, "error")} prohibited this workshop_facilitator from being saved:"
+ %ul
+ - @workshop_facilitator.errors.full_messages.each do |msg|
+ %li= msg
+
+ .field
+ = f.label :user_id
+ = f.number_field :user_id
+ .field
+ = f.label :workshop_id
+ = f.number_field :workshop_id
+ .field
+ = f.label :role
+ = f.text_field :role
+ .actions
+ = f.submit 'Save'
diff --git a/app/views/workshop_facilitators/edit.html.haml b/app/views/workshop_facilitators/edit.html.haml
new file mode 100644
index 0000000..0ed8850
--- /dev/null
+++ b/app/views/workshop_facilitators/edit.html.haml
@@ -0,0 +1,7 @@
+%h1 Editing workshop_facilitator
+
+= render 'form'
+
+= link_to 'Show', @workshop_facilitator
+\|
+= link_to 'Back', workshop_facilitators_path
diff --git a/app/views/workshop_facilitators/index.html.haml b/app/views/workshop_facilitators/index.html.haml
new file mode 100644
index 0000000..aaf863a
--- /dev/null
+++ b/app/views/workshop_facilitators/index.html.haml
@@ -0,0 +1,23 @@
+%h1 Listing workshop_facilitators
+
+%table
+ %tr
+ %th User
+ %th Workshop
+ %th Role
+ %th
+ %th
+ %th
+
+ - @workshop_facilitators.each do |workshop_facilitator|
+ %tr
+ %td= workshop_facilitator.user_id
+ %td= workshop_facilitator.workshop_id
+ %td= workshop_facilitator.role
+ %td= link_to 'Show', workshop_facilitator
+ %td= link_to 'Edit', edit_workshop_facilitator_path(workshop_facilitator)
+ %td= link_to 'Destroy', workshop_facilitator, :method => :delete, :data => { :confirm => 'Are you sure?' }
+
+%br
+
+= link_to 'New Workshop facilitator', new_workshop_facilitator_path
diff --git a/app/views/workshop_facilitators/new.html.haml b/app/views/workshop_facilitators/new.html.haml
new file mode 100644
index 0000000..fdef139
--- /dev/null
+++ b/app/views/workshop_facilitators/new.html.haml
@@ -0,0 +1,5 @@
+%h1 New workshop_facilitator
+
+= render 'form'
+
+= link_to 'Back', workshop_facilitators_path
diff --git a/app/views/workshop_facilitators/show.html.haml b/app/views/workshop_facilitators/show.html.haml
new file mode 100644
index 0000000..f402b93
--- /dev/null
+++ b/app/views/workshop_facilitators/show.html.haml
@@ -0,0 +1,15 @@
+%p#notice= notice
+
+%p
+ %b User:
+ = @workshop_facilitator.user_id
+%p
+ %b Workshop:
+ = @workshop_facilitator.workshop_id
+%p
+ %b Role:
+ = @workshop_facilitator.role
+
+= link_to 'Edit', edit_workshop_facilitator_path(@workshop_facilitator)
+\|
+= link_to 'Back', workshop_facilitators_path
diff --git a/app/views/workshop_requested_resources/_form.html.haml b/app/views/workshop_requested_resources/_form.html.haml
new file mode 100644
index 0000000..b1b6045
--- /dev/null
+++ b/app/views/workshop_requested_resources/_form.html.haml
@@ -0,0 +1,19 @@
+= form_for @workshop_requested_resource do |f|
+ - if @workshop_requested_resource.errors.any?
+ #error_explanation
+ %h2= "#{pluralize(@workshop_requested_resource.errors.count, "error")} prohibited this workshop_requested_resource from being saved:"
+ %ul
+ - @workshop_requested_resource.errors.full_messages.each do |msg|
+ %li= msg
+
+ .field
+ = f.label :workshop_id
+ = f.number_field :workshop_id
+ .field
+ = f.label :workshop_resource_id
+ = f.number_field :workshop_resource_id
+ .field
+ = f.label :status
+ = f.text_field :status
+ .actions
+ = f.submit 'Save'
diff --git a/app/views/workshop_requested_resources/edit.html.haml b/app/views/workshop_requested_resources/edit.html.haml
new file mode 100644
index 0000000..ec78d77
--- /dev/null
+++ b/app/views/workshop_requested_resources/edit.html.haml
@@ -0,0 +1,7 @@
+%h1 Editing workshop_requested_resource
+
+= render 'form'
+
+= link_to 'Show', @workshop_requested_resource
+\|
+= link_to 'Back', workshop_requested_resources_path
diff --git a/app/views/workshop_requested_resources/index.html.haml b/app/views/workshop_requested_resources/index.html.haml
new file mode 100644
index 0000000..10281f0
--- /dev/null
+++ b/app/views/workshop_requested_resources/index.html.haml
@@ -0,0 +1,23 @@
+%h1 Listing workshop_requested_resources
+
+%table
+ %tr
+ %th Workshop
+ %th Workshop resource
+ %th Status
+ %th
+ %th
+ %th
+
+ - @workshop_requested_resources.each do |workshop_requested_resource|
+ %tr
+ %td= workshop_requested_resource.workshop_id
+ %td= workshop_requested_resource.workshop_resource_id
+ %td= workshop_requested_resource.status
+ %td= link_to 'Show', workshop_requested_resource
+ %td= link_to 'Edit', edit_workshop_requested_resource_path(workshop_requested_resource)
+ %td= link_to 'Destroy', workshop_requested_resource, :method => :delete, :data => { :confirm => 'Are you sure?' }
+
+%br
+
+= link_to 'New Workshop requested resource', new_workshop_requested_resource_path
diff --git a/app/views/workshop_requested_resources/new.html.haml b/app/views/workshop_requested_resources/new.html.haml
new file mode 100644
index 0000000..376f258
--- /dev/null
+++ b/app/views/workshop_requested_resources/new.html.haml
@@ -0,0 +1,5 @@
+%h1 New workshop_requested_resource
+
+= render 'form'
+
+= link_to 'Back', workshop_requested_resources_path
diff --git a/app/views/workshop_requested_resources/show.html.haml b/app/views/workshop_requested_resources/show.html.haml
new file mode 100644
index 0000000..92982bc
--- /dev/null
+++ b/app/views/workshop_requested_resources/show.html.haml
@@ -0,0 +1,15 @@
+%p#notice= notice
+
+%p
+ %b Workshop:
+ = @workshop_requested_resource.workshop_id
+%p
+ %b Workshop resource:
+ = @workshop_requested_resource.workshop_resource_id
+%p
+ %b Status:
+ = @workshop_requested_resource.status
+
+= link_to 'Edit', edit_workshop_requested_resource_path(@workshop_requested_resource)
+\|
+= link_to 'Back', workshop_requested_resources_path
diff --git a/app/views/workshops/_form.html.haml b/app/views/workshops/_form.html.haml
new file mode 100644
index 0000000..b7aa6ff
--- /dev/null
+++ b/app/views/workshops/_form.html.haml
@@ -0,0 +1,23 @@
+= form_for @workshop, url: conference_workshops_path(@conference, @workshop) do |f|
+ .columns
+ - if @workshop.errors.any?
+ #error_explanation
+ %h2= "#{pluralize(@workshop.errors.count, "error")} prohibited this workshop from being saved:"
+ %ul
+ - @workshop.errors.full_messages.each do |msg|
+ %li= msg
+ = field f, :title, :text_field
+ = field f, :slug, :text_field
+ .columns.medium-4
+ %h2=_'workshop.form.help.title', :t
+ =_'workshop.form.help', :p
+ .columns.medium-8
+ = field f, :info, :text_area
+ = field f, :workshop_stream_id, :number_field
+ = field f, :workshop_presentation_style, :number_field
+ =# field f, :min_facilitators, :number_field
+ =# field f, :location_id, :number_field
+ =# field f, :start_time, :datetime_select
+ =# field f, :end_time, :datetime_select
+ .columns
+ = actions :save
diff --git a/app/views/workshops/edit.html.haml b/app/views/workshops/edit.html.haml
new file mode 100644
index 0000000..5da8f41
--- /dev/null
+++ b/app/views/workshops/edit.html.haml
@@ -0,0 +1,6 @@
+- page_style :form
+
+= tabs!
+
+.row
+ = render 'form'
diff --git a/app/views/workshops/index.html.haml b/app/views/workshops/index.html.haml
new file mode 100644
index 0000000..70d6946
--- /dev/null
+++ b/app/views/workshops/index.html.haml
@@ -0,0 +1,35 @@
+%h1 Listing workshops
+
+%table
+ %tr
+ %th Title
+ %th Slug
+ %th Info
+ %th Conference
+ %th Workshop stream
+ %th Workshop presentation style
+ %th Min facilitators
+ %th Location
+ %th Start time
+ %th End time
+ %th
+ %th
+
+ - @workshops.each do |workshop|
+ %tr
+ %td= workshop.title
+ %td= workshop.slug
+ %td= workshop.info
+ %td= workshop.conference_id
+ %td= workshop.workshop_stream_id
+ %td= workshop.workshop_presentation_style
+ %td= workshop.min_facilitators
+ %td= workshop.location_id
+ %td= workshop.start_time
+ %td= workshop.end_time
+ %td= link_to 'Show', conference_workshop_path(@conference, workshop)
+ %td= link_to 'Edit', edit_conference_workshop_path(@conference, workshop)
+
+%br
+
+= link_to 'New Workshop', new_conference_workshop_path
diff --git a/app/views/workshops/new.html.haml b/app/views/workshops/new.html.haml
new file mode 100644
index 0000000..5da8f41
--- /dev/null
+++ b/app/views/workshops/new.html.haml
@@ -0,0 +1,6 @@
+- page_style :form
+
+= tabs!
+
+.row
+ = render 'form'
diff --git a/app/views/workshops/show.html.haml b/app/views/workshops/show.html.haml
new file mode 100644
index 0000000..5909794
--- /dev/null
+++ b/app/views/workshops/show.html.haml
@@ -0,0 +1,30 @@
+%p#notice= notice
+
+.row
+ .columns.medium-12
+ %h1= @workshop.title
+
+= tabs!
+
+.row
+ .columns.medium-4
+ %p
+ %b Workshop stream:
+ = @workshop.workshop_stream_id
+ %p
+ %b Workshop presentation style:
+ = @workshop.workshop_presentation_style
+ %p
+ %b Min facilitators:
+ = @workshop.min_facilitators
+ %p
+ %b Location:
+ = @workshop.location_id
+ %p
+ %b Start time:
+ = @workshop.start_time
+ %p
+ %b End time:
+ = @workshop.end_time
+ .columns.medium-8
+ =p @workshop, :info
diff --git a/config/application.rb b/config/application.rb
index 17d0af4..20db061 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,6 +1,7 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
+require 'pry'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 1bcf449..045ffb5 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,3 +1,5 @@
+#require 'perftools'
+
BikeBike::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@@ -42,4 +44,11 @@ BikeBike::Application.configure do
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
#config.action_mailer.default_charset = 'utf-8'
+
+ #Carmen.i18n_backend.locale_paths = ''
+ #puts "CARMEN\t" + Carmen.i18n_backend.locale_paths
+
+ #PerfTools::CpuProfiler.start('/tmp/dev_prof')
+ #config.serve_static_assets = true
+ #config.assets.precompile = false
end
diff --git a/config/routes.rb b/config/routes.rb
index 5b9d4ea..6572c93 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,13 @@
BikeBike::Application.routes.draw do
+ resources :events
+
+ resources :event_types
+
+ resources :workshop_requested_resources
+
+ resources :workshop_facilitators
+
#resources :conference_registration_responses
#resources :conference_registrations
@@ -15,7 +23,7 @@ BikeBike::Application.routes.draw do
resources :conferences, :param => 'slug' do
get :hosts
get :registration
- get :workshops
+ resources :workshops, :param => 'slug'
get :registration
#resources :registrations, :path => 'registration' do
# get :form, on: :collection
diff --git a/db/migrate/20140314025647_create_workshops.rb b/db/migrate/20140314025647_create_workshops.rb
new file mode 100644
index 0000000..6364339
--- /dev/null
+++ b/db/migrate/20140314025647_create_workshops.rb
@@ -0,0 +1,18 @@
+class CreateWorkshops < ActiveRecord::Migration
+ def change
+ create_table :workshops do |t|
+ t.string :title
+ t.string :slug
+ t.text :info
+ t.integer :conference_id
+ t.integer :workshop_stream_id
+ t.integer :workshop_presentation_style
+ t.integer :min_facilitators
+ t.integer :location_id
+ t.datetime :start_time
+ t.datetime :end_time
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140315175914_create_workshop_facilitators.rb b/db/migrate/20140315175914_create_workshop_facilitators.rb
new file mode 100644
index 0000000..60fa88c
--- /dev/null
+++ b/db/migrate/20140315175914_create_workshop_facilitators.rb
@@ -0,0 +1,11 @@
+class CreateWorkshopFacilitators < ActiveRecord::Migration
+ def change
+ create_table :workshop_facilitators do |t|
+ t.integer :user_id
+ t.integer :workshop_id
+ t.string :role
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140315181222_create_workshop_requested_resources.rb b/db/migrate/20140315181222_create_workshop_requested_resources.rb
new file mode 100644
index 0000000..1a1878c
--- /dev/null
+++ b/db/migrate/20140315181222_create_workshop_requested_resources.rb
@@ -0,0 +1,11 @@
+class CreateWorkshopRequestedResources < ActiveRecord::Migration
+ def change
+ create_table :workshop_requested_resources do |t|
+ t.integer :workshop_id
+ t.integer :workshop_resource_id
+ t.string :status
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140315183121_create_event_types.rb b/db/migrate/20140315183121_create_event_types.rb
new file mode 100644
index 0000000..68f2ad6
--- /dev/null
+++ b/db/migrate/20140315183121_create_event_types.rb
@@ -0,0 +1,10 @@
+class CreateEventTypes < ActiveRecord::Migration
+ def change
+ create_table :event_types do |t|
+ t.string :slug
+ t.text :info
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140315183241_create_events.rb b/db/migrate/20140315183241_create_events.rb
new file mode 100644
index 0000000..30dc8ae
--- /dev/null
+++ b/db/migrate/20140315183241_create_events.rb
@@ -0,0 +1,16 @@
+class CreateEvents < ActiveRecord::Migration
+ def change
+ create_table :events do |t|
+ t.string :title
+ t.string :slug
+ t.integer :event_type_id
+ t.integer :conference_id
+ t.text :info
+ t.integer :location_id
+ t.datetime :start_time
+ t.datetime :end_time
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index c1cf94c..ae14854 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20140308173325) do
+ActiveRecord::Schema.define(version: 20140315183241) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -92,6 +92,26 @@ ActiveRecord::Schema.define(version: 20140308173325) do
t.text "postregistration_info"
end
+ create_table "event_types", force: true do |t|
+ t.string "slug"
+ t.text "info"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "events", force: true do |t|
+ t.string "title"
+ t.string "slug"
+ t.integer "event_type_id"
+ t.integer "conference_id"
+ t.text "info"
+ t.integer "location_id"
+ t.datetime "start_time"
+ t.datetime "end_time"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "locations", force: true do |t|
t.string "title"
t.float "latitude"
@@ -162,8 +182,8 @@ ActiveRecord::Schema.define(version: 20140308173325) do
end
create_table "user_organization_relationships", force: true do |t|
- t.integer "user_id", null: false
- t.integer "organization_id", null: false
+ t.integer "user_id"
+ t.integer "organization_id"
t.string "relationship"
t.datetime "created_at"
t.datetime "updated_at"
@@ -201,7 +221,15 @@ ActiveRecord::Schema.define(version: 20140308173325) do
t.string "whodunnit"
t.text "object"
t.datetime "created_at"
- t.text "value"
+ t.string "value"
+ end
+
+ create_table "workshop_facilitators", force: true do |t|
+ t.integer "user_id"
+ t.integer "workshop_id"
+ t.string "role"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
create_table "workshop_presentation_styles", force: true do |t|
@@ -212,6 +240,14 @@ ActiveRecord::Schema.define(version: 20140308173325) do
t.datetime "updated_at"
end
+ create_table "workshop_requested_resources", force: true do |t|
+ t.integer "workshop_id"
+ t.integer "workshop_resource_id"
+ t.string "status"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "workshop_resources", force: true do |t|
t.string "name"
t.string "slug"
@@ -228,4 +264,19 @@ ActiveRecord::Schema.define(version: 20140308173325) do
t.datetime "updated_at"
end
+ create_table "workshops", force: true do |t|
+ t.string "title"
+ t.string "slug"
+ t.text "info"
+ t.integer "conference_id"
+ t.integer "workshop_stream_id"
+ t.integer "workshop_presentation_style"
+ t.integer "min_facilitators"
+ t.integer "location_id"
+ t.datetime "start_time"
+ t.datetime "end_time"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
end
diff --git a/spec/features/pages_spec.rb b/spec/features/pages_spec.rb
index 95d50a0..ff2e903 100644
--- a/spec/features/pages_spec.rb
+++ b/spec/features/pages_spec.rb
@@ -1,8 +1,8 @@
require 'spec_helper'
describe 'Home' do
- it "has Hello World in title" do
- visit root_path
- expect(page).to have_title I18n.t('hello')
- end
+ #it "has Hello World in title" do
+ # visit root_path
+ # expect(page).to have_title I18n.t('hello')
+ #end
end
diff --git a/test/controllers/event_types_controller_test.rb b/test/controllers/event_types_controller_test.rb
new file mode 100644
index 0000000..b0ac75c
--- /dev/null
+++ b/test/controllers/event_types_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class EventTypesControllerTest < ActionController::TestCase
+ setup do
+ @event_type = event_types(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:event_types)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create event_type" do
+ assert_difference('EventType.count') do
+ post :create, event_type: { info: @event_type.info, slug: @event_type.slug }
+ end
+
+ assert_redirected_to event_type_path(assigns(:event_type))
+ end
+
+ test "should show event_type" do
+ get :show, id: @event_type
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @event_type
+ assert_response :success
+ end
+
+ test "should update event_type" do
+ patch :update, id: @event_type, event_type: { info: @event_type.info, slug: @event_type.slug }
+ assert_redirected_to event_type_path(assigns(:event_type))
+ end
+
+ test "should destroy event_type" do
+ assert_difference('EventType.count', -1) do
+ delete :destroy, id: @event_type
+ end
+
+ assert_redirected_to event_types_path
+ end
+end
diff --git a/test/controllers/events_controller_test.rb b/test/controllers/events_controller_test.rb
new file mode 100644
index 0000000..eddc1ea
--- /dev/null
+++ b/test/controllers/events_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class EventsControllerTest < ActionController::TestCase
+ setup do
+ @event = events(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:events)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create event" do
+ assert_difference('Event.count') do
+ post :create, event: { conference: @event.conference, end_time: @event.end_time, event_type_id: @event.event_type_id, info: @event.info, location: @event.location, slug: @event.slug, start_time: @event.start_time, title: @event.title }
+ end
+
+ assert_redirected_to event_path(assigns(:event))
+ end
+
+ test "should show event" do
+ get :show, id: @event
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @event
+ assert_response :success
+ end
+
+ test "should update event" do
+ patch :update, id: @event, event: { conference: @event.conference, end_time: @event.end_time, event_type_id: @event.event_type_id, info: @event.info, location: @event.location, slug: @event.slug, start_time: @event.start_time, title: @event.title }
+ assert_redirected_to event_path(assigns(:event))
+ end
+
+ test "should destroy event" do
+ assert_difference('Event.count', -1) do
+ delete :destroy, id: @event
+ end
+
+ assert_redirected_to events_path
+ end
+end
diff --git a/test/controllers/workshop_facilitators_controller_test.rb b/test/controllers/workshop_facilitators_controller_test.rb
new file mode 100644
index 0000000..11a4f9c
--- /dev/null
+++ b/test/controllers/workshop_facilitators_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class WorkshopFacilitatorsControllerTest < ActionController::TestCase
+ setup do
+ @workshop_facilitator = workshop_facilitators(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:workshop_facilitators)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create workshop_facilitator" do
+ assert_difference('WorkshopFacilitator.count') do
+ post :create, workshop_facilitator: { role: @workshop_facilitator.role, user_id: @workshop_facilitator.user_id, workshop_id: @workshop_facilitator.workshop_id }
+ end
+
+ assert_redirected_to workshop_facilitator_path(assigns(:workshop_facilitator))
+ end
+
+ test "should show workshop_facilitator" do
+ get :show, id: @workshop_facilitator
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @workshop_facilitator
+ assert_response :success
+ end
+
+ test "should update workshop_facilitator" do
+ patch :update, id: @workshop_facilitator, workshop_facilitator: { role: @workshop_facilitator.role, user_id: @workshop_facilitator.user_id, workshop_id: @workshop_facilitator.workshop_id }
+ assert_redirected_to workshop_facilitator_path(assigns(:workshop_facilitator))
+ end
+
+ test "should destroy workshop_facilitator" do
+ assert_difference('WorkshopFacilitator.count', -1) do
+ delete :destroy, id: @workshop_facilitator
+ end
+
+ assert_redirected_to workshop_facilitators_path
+ end
+end
diff --git a/test/controllers/workshop_requested_resources_controller_test.rb b/test/controllers/workshop_requested_resources_controller_test.rb
new file mode 100644
index 0000000..f5c9c89
--- /dev/null
+++ b/test/controllers/workshop_requested_resources_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class WorkshopRequestedResourcesControllerTest < ActionController::TestCase
+ setup do
+ @workshop_requested_resource = workshop_requested_resources(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:workshop_requested_resources)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create workshop_requested_resource" do
+ assert_difference('WorkshopRequestedResource.count') do
+ post :create, workshop_requested_resource: { status: @workshop_requested_resource.status, workshop_id: @workshop_requested_resource.workshop_id, workshop_resource_id: @workshop_requested_resource.workshop_resource_id }
+ end
+
+ assert_redirected_to workshop_requested_resource_path(assigns(:workshop_requested_resource))
+ end
+
+ test "should show workshop_requested_resource" do
+ get :show, id: @workshop_requested_resource
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @workshop_requested_resource
+ assert_response :success
+ end
+
+ test "should update workshop_requested_resource" do
+ patch :update, id: @workshop_requested_resource, workshop_requested_resource: { status: @workshop_requested_resource.status, workshop_id: @workshop_requested_resource.workshop_id, workshop_resource_id: @workshop_requested_resource.workshop_resource_id }
+ assert_redirected_to workshop_requested_resource_path(assigns(:workshop_requested_resource))
+ end
+
+ test "should destroy workshop_requested_resource" do
+ assert_difference('WorkshopRequestedResource.count', -1) do
+ delete :destroy, id: @workshop_requested_resource
+ end
+
+ assert_redirected_to workshop_requested_resources_path
+ end
+end
diff --git a/test/controllers/workshops_controller_test.rb b/test/controllers/workshops_controller_test.rb
new file mode 100644
index 0000000..efd6e97
--- /dev/null
+++ b/test/controllers/workshops_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class WorkshopsControllerTest < ActionController::TestCase
+ setup do
+ @workshop = workshops(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:workshops)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create workshop" do
+ assert_difference('Workshop.count') do
+ post :create, workshop: { conference_id: @workshop.conference_id, end_time: @workshop.end_time, info: @workshop.info, location_id: @workshop.location_id, min_facilitators: @workshop.min_facilitators, slug: @workshop.slug, start_time: @workshop.start_time, title: @workshop.title, workshop_presentation_style: @workshop.workshop_presentation_style, workshop_stream_id: @workshop.workshop_stream_id }
+ end
+
+ assert_redirected_to workshop_path(assigns(:workshop))
+ end
+
+ test "should show workshop" do
+ get :show, id: @workshop
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @workshop
+ assert_response :success
+ end
+
+ test "should update workshop" do
+ patch :update, id: @workshop, workshop: { conference_id: @workshop.conference_id, end_time: @workshop.end_time, info: @workshop.info, location_id: @workshop.location_id, min_facilitators: @workshop.min_facilitators, slug: @workshop.slug, start_time: @workshop.start_time, title: @workshop.title, workshop_presentation_style: @workshop.workshop_presentation_style, workshop_stream_id: @workshop.workshop_stream_id }
+ assert_redirected_to workshop_path(assigns(:workshop))
+ end
+
+ test "should destroy workshop" do
+ assert_difference('Workshop.count', -1) do
+ delete :destroy, id: @workshop
+ end
+
+ assert_redirected_to workshops_path
+ end
+end
diff --git a/test/factories/event_types.rb b/test/factories/event_types.rb
new file mode 100644
index 0000000..795e087
--- /dev/null
+++ b/test/factories/event_types.rb
@@ -0,0 +1,8 @@
+# Read about factories at https://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :event_type do
+ slug "MyString"
+ info "MyText"
+ end
+end
diff --git a/test/factories/events.rb b/test/factories/events.rb
new file mode 100644
index 0000000..2504b82
--- /dev/null
+++ b/test/factories/events.rb
@@ -0,0 +1,14 @@
+# Read about factories at https://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :event do
+ title "MyString"
+ slug "MyString"
+ event_type_id 1
+ conference ""
+ info "MyText"
+ location ""
+ start_time "2014-03-15 12:32:41"
+ end_time "2014-03-15 12:32:41"
+ end
+end
diff --git a/test/factories/workshop_facilitators.rb b/test/factories/workshop_facilitators.rb
new file mode 100644
index 0000000..50db5c7
--- /dev/null
+++ b/test/factories/workshop_facilitators.rb
@@ -0,0 +1,9 @@
+# Read about factories at https://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :workshop_facilitator do
+ user_id 1
+ workshop_id 1
+ role "MyString"
+ end
+end
diff --git a/test/factories/workshop_requested_resources.rb b/test/factories/workshop_requested_resources.rb
new file mode 100644
index 0000000..8abaa5c
--- /dev/null
+++ b/test/factories/workshop_requested_resources.rb
@@ -0,0 +1,9 @@
+# Read about factories at https://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :workshop_requested_resource do
+ workshop_id 1
+ workshop_resource_id 1
+ status "MyString"
+ end
+end
diff --git a/test/factories/workshops.rb b/test/factories/workshops.rb
new file mode 100644
index 0000000..95c8b6c
--- /dev/null
+++ b/test/factories/workshops.rb
@@ -0,0 +1,16 @@
+# Read about factories at https://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :workshop do
+ title "MyString"
+ slug "MyString"
+ info "MyText"
+ conference_id 1
+ workshop_stream_id 1
+ workshop_presentation_style 1
+ min_facilitators 1
+ location_id 1
+ start_time "2014-03-13 20:56:47"
+ end_time "2014-03-13 20:56:47"
+ end
+end
diff --git a/test/helpers/event_types_helper_test.rb b/test/helpers/event_types_helper_test.rb
new file mode 100644
index 0000000..e62047a
--- /dev/null
+++ b/test/helpers/event_types_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class EventTypesHelperTest < ActionView::TestCase
+end
diff --git a/test/helpers/events_helper_test.rb b/test/helpers/events_helper_test.rb
new file mode 100644
index 0000000..2e7567e
--- /dev/null
+++ b/test/helpers/events_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class EventsHelperTest < ActionView::TestCase
+end
diff --git a/test/helpers/workshop_facilitators_helper_test.rb b/test/helpers/workshop_facilitators_helper_test.rb
new file mode 100644
index 0000000..4dc1d98
--- /dev/null
+++ b/test/helpers/workshop_facilitators_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class WorkshopFacilitatorsHelperTest < ActionView::TestCase
+end
diff --git a/test/helpers/workshop_requested_resources_helper_test.rb b/test/helpers/workshop_requested_resources_helper_test.rb
new file mode 100644
index 0000000..425320a
--- /dev/null
+++ b/test/helpers/workshop_requested_resources_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class WorkshopRequestedResourcesHelperTest < ActionView::TestCase
+end
diff --git a/test/helpers/workshops_helper_test.rb b/test/helpers/workshops_helper_test.rb
new file mode 100644
index 0000000..272f968
--- /dev/null
+++ b/test/helpers/workshops_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class WorkshopsHelperTest < ActionView::TestCase
+end
diff --git a/test/models/event_test.rb b/test/models/event_test.rb
new file mode 100644
index 0000000..c6f1566
--- /dev/null
+++ b/test/models/event_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class EventTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/event_type_test.rb b/test/models/event_type_test.rb
new file mode 100644
index 0000000..0d42331
--- /dev/null
+++ b/test/models/event_type_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class EventTypeTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/workshop_facilitator_test.rb b/test/models/workshop_facilitator_test.rb
new file mode 100644
index 0000000..4a15969
--- /dev/null
+++ b/test/models/workshop_facilitator_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class WorkshopFacilitatorTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/workshop_requested_resource_test.rb b/test/models/workshop_requested_resource_test.rb
new file mode 100644
index 0000000..bce24ce
--- /dev/null
+++ b/test/models/workshop_requested_resource_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class WorkshopRequestedResourceTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/workshop_test.rb b/test/models/workshop_test.rb
new file mode 100644
index 0000000..fe26431
--- /dev/null
+++ b/test/models/workshop_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class WorkshopTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end