Merge branch 'master' of https://github.com/bikebike/BikeBike
Conflicts: Gemfile Gemfile.lock
This commit is contained in:
@@ -113,7 +113,6 @@ updateFormFieldList = () ->
|
||||
(json) ->
|
||||
$('#conference-form').html(json.form)
|
||||
$('#registration-form-field-list').html(json.list)
|
||||
#console.log json
|
||||
updateFormFieldList()
|
||||
return
|
||||
$('#conference-form .remove-form-field').click () ->
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the event_types controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the events controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the workshop_facilitators controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the workshop_requested_resources controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the workshops controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
@@ -37,6 +37,7 @@ class ConferencesController < ApplicationController
|
||||
registration = ConferenceRegistration.find_by(:user_id => current_user.id, :conference_id => @conference.id)
|
||||
if registration
|
||||
registration.conference_registration_responses.destroy_all
|
||||
registration.is_attending = params[:is_attending]
|
||||
else
|
||||
registration = ConferenceRegistration.new(user_id: current_user.id, conference_id: @conference.id, is_attending: params[:is_attending])
|
||||
end
|
||||
@@ -53,7 +54,7 @@ class ConferencesController < ApplicationController
|
||||
end
|
||||
end
|
||||
data.each do |key, value|
|
||||
registration.conference_registration_responses << ConferenceRegistrationResponse.new(registration_form_field_id: key.to_i, data: value.to_json.to_s)
|
||||
registration.conference_registration_responses << ConferenceRegistrationResponse.new(registration_form_field_id: key.to_i, data: value.to_json)
|
||||
end
|
||||
registration.save!
|
||||
render action: 'show'
|
||||
@@ -124,6 +125,12 @@ class ConferencesController < ApplicationController
|
||||
set_conference
|
||||
end
|
||||
|
||||
def workshops
|
||||
set_conference
|
||||
@workshops = Workshop.where(:conference_id => @conference.id)
|
||||
render 'workshops/index'
|
||||
end
|
||||
|
||||
# DELETE /conferences/1
|
||||
def destroy
|
||||
@conference.destroy
|
||||
@@ -133,7 +140,17 @@ class ConferencesController < ApplicationController
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_conference
|
||||
@conference = Conference.find_by(slug: params[:slug] || params[:conference_slug])
|
||||
@conference = Conference.find_by(slug: params[:conference_slug] || params[:slug])
|
||||
set_conference_registration
|
||||
end
|
||||
|
||||
def set_conference_registration
|
||||
if !@conference || !current_user
|
||||
@conference_registration = nil
|
||||
return
|
||||
end
|
||||
|
||||
@conference_registration = ConferenceRegistration.find_by(conference_id: @conference.id, user_id: current_user.id)
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
class EventTypesController < ApplicationController
|
||||
before_action :set_event_type, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /event_types
|
||||
def index
|
||||
@event_types = EventType.all
|
||||
end
|
||||
|
||||
# GET /event_types/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /event_types/new
|
||||
def new
|
||||
@event_type = EventType.new
|
||||
end
|
||||
|
||||
# GET /event_types/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /event_types
|
||||
def create
|
||||
@event_type = EventType.new(event_type_params)
|
||||
|
||||
if @event_type.save
|
||||
redirect_to @event_type, notice: 'Event type was successfully created.'
|
||||
else
|
||||
render action: 'new'
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /event_types/1
|
||||
def update
|
||||
if @event_type.update(event_type_params)
|
||||
redirect_to @event_type, notice: 'Event type was successfully updated.'
|
||||
else
|
||||
render action: 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /event_types/1
|
||||
def destroy
|
||||
@event_type.destroy
|
||||
redirect_to event_types_url, notice: 'Event type was successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_event_type
|
||||
@event_type = EventType.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def event_type_params
|
||||
params.require(:event_type).permit(:slug, :info)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,58 @@
|
||||
class EventsController < ApplicationController
|
||||
before_action :set_event, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /events
|
||||
def index
|
||||
@events = Event.all
|
||||
end
|
||||
|
||||
# GET /events/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /events/new
|
||||
def new
|
||||
@event = Event.new
|
||||
end
|
||||
|
||||
# GET /events/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /events
|
||||
def create
|
||||
@event = Event.new(event_params)
|
||||
|
||||
if @event.save
|
||||
redirect_to @event, notice: 'Event was successfully created.'
|
||||
else
|
||||
render action: 'new'
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /events/1
|
||||
def update
|
||||
if @event.update(event_params)
|
||||
redirect_to @event, notice: 'Event was successfully updated.'
|
||||
else
|
||||
render action: 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /events/1
|
||||
def destroy
|
||||
@event.destroy
|
||||
redirect_to events_url, notice: 'Event was successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_event
|
||||
@event = Event.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def event_params
|
||||
params.require(:event).permit(:title, :slug, :event_type_id, :conference, :info, :location, :start_time, :end_time)
|
||||
end
|
||||
end
|
||||
@@ -38,7 +38,10 @@ class RegistrationFormFieldsController < ApplicationController
|
||||
|
||||
private
|
||||
def ajax_return(success)
|
||||
@registration_form_fields = RegistrationFormField.all
|
||||
if params[:conference_id]
|
||||
@conference = Conference.find(params[:conference_id])
|
||||
@registration_form_fields = RegistrationFormField.where(["id NOT IN (?)", @conference.registration_form_fields.map(&:id)])
|
||||
end
|
||||
if success
|
||||
@registration_form_field = RegistrationFormField.new
|
||||
end
|
||||
@@ -54,13 +57,11 @@ class RegistrationFormFieldsController < ApplicationController
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def registration_form_field_params
|
||||
#type = params[:type]
|
||||
#allowed = RegistrationFormField::Types[type]
|
||||
#allowed << 'field_type'
|
||||
rff_params = params.require(:registration_form_field)
|
||||
allowed = RegistrationFormField::GetNonOptionKeys(rff_params[:field_type], rff_params)
|
||||
p = rff_params.send('permit', *allowed)#permit(:title, :help, :required, :field_type, :options, :is_retired)
|
||||
p[:options] = RegistrationFormField::GetOptions(rff_params[:field_type], rff_params).to_json.to_s
|
||||
p[:field_type] = rff_params[:field_type]
|
||||
p
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
class WorkshopFacilitatorsController < ApplicationController
|
||||
before_action :set_workshop_facilitator, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /workshop_facilitators
|
||||
def index
|
||||
@workshop_facilitators = WorkshopFacilitator.all
|
||||
end
|
||||
|
||||
# GET /workshop_facilitators/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /workshop_facilitators/new
|
||||
def new
|
||||
@workshop_facilitator = WorkshopFacilitator.new
|
||||
end
|
||||
|
||||
# GET /workshop_facilitators/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /workshop_facilitators
|
||||
def create
|
||||
@workshop_facilitator = WorkshopFacilitator.new(workshop_facilitator_params)
|
||||
|
||||
if @workshop_facilitator.save
|
||||
redirect_to @workshop_facilitator, notice: 'Workshop facilitator was successfully created.'
|
||||
else
|
||||
render action: 'new'
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /workshop_facilitators/1
|
||||
def update
|
||||
if @workshop_facilitator.update(workshop_facilitator_params)
|
||||
redirect_to @workshop_facilitator, notice: 'Workshop facilitator was successfully updated.'
|
||||
else
|
||||
render action: 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /workshop_facilitators/1
|
||||
def destroy
|
||||
@workshop_facilitator.destroy
|
||||
redirect_to workshop_facilitators_url, notice: 'Workshop facilitator was successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_workshop_facilitator
|
||||
@workshop_facilitator = WorkshopFacilitator.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def workshop_facilitator_params
|
||||
params.require(:workshop_facilitator).permit(:user_id, :workshop_id, :role)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,58 @@
|
||||
class WorkshopRequestedResourcesController < ApplicationController
|
||||
before_action :set_workshop_requested_resource, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /workshop_requested_resources
|
||||
def index
|
||||
@workshop_requested_resources = WorkshopRequestedResource.all
|
||||
end
|
||||
|
||||
# GET /workshop_requested_resources/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /workshop_requested_resources/new
|
||||
def new
|
||||
@workshop_requested_resource = WorkshopRequestedResource.new
|
||||
end
|
||||
|
||||
# GET /workshop_requested_resources/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /workshop_requested_resources
|
||||
def create
|
||||
@workshop_requested_resource = WorkshopRequestedResource.new(workshop_requested_resource_params)
|
||||
|
||||
if @workshop_requested_resource.save
|
||||
redirect_to @workshop_requested_resource, notice: 'Workshop requested resource was successfully created.'
|
||||
else
|
||||
render action: 'new'
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /workshop_requested_resources/1
|
||||
def update
|
||||
if @workshop_requested_resource.update(workshop_requested_resource_params)
|
||||
redirect_to @workshop_requested_resource, notice: 'Workshop requested resource was successfully updated.'
|
||||
else
|
||||
render action: 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /workshop_requested_resources/1
|
||||
def destroy
|
||||
@workshop_requested_resource.destroy
|
||||
redirect_to workshop_requested_resources_url, notice: 'Workshop requested resource was successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_workshop_requested_resource
|
||||
@workshop_requested_resource = WorkshopRequestedResource.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def workshop_requested_resource_params
|
||||
params.require(:workshop_requested_resource).permit(:workshop_id, :workshop_resource_id, :status)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,69 @@
|
||||
class WorkshopsController < ApplicationController
|
||||
before_action :set_workshop, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /workshops
|
||||
def index
|
||||
set_conference
|
||||
@workshops = Workshop.where(['conference_id = ?', @conference.id])
|
||||
end
|
||||
|
||||
# GET /workshops/1
|
||||
def show
|
||||
set_workshop
|
||||
set_conference
|
||||
end
|
||||
|
||||
# GET /workshops/new
|
||||
def new
|
||||
set_conference
|
||||
@workshop = Workshop.new
|
||||
end
|
||||
|
||||
# GET /workshops/1/edit
|
||||
def edit
|
||||
set_conference
|
||||
end
|
||||
|
||||
# POST /workshops
|
||||
def create
|
||||
set_conference
|
||||
@workshop = Workshop.new(workshop_params)
|
||||
|
||||
if @workshop.save
|
||||
redirect_to conference_workshop_path(@conference, @workshop), notice: 'Workshop was successfully created.'
|
||||
else
|
||||
render action: 'new'
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /workshops/1
|
||||
def update
|
||||
set_conference
|
||||
if @workshop.update(workshop_params)
|
||||
redirect_to conference_workshop_path(@conference, @workshop), notice: 'Workshop was successfully updated.'
|
||||
else
|
||||
render action: 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /workshops/1
|
||||
def destroy
|
||||
@workshop.destroy
|
||||
redirect_to workshops_url, notice: 'Workshop was successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_workshop
|
||||
@workshop = Workshop.find_by(slug: params[:workshop_slug] || params[:slug])
|
||||
end
|
||||
|
||||
def set_conference
|
||||
@conference = Conference.find_by(slug: params[:conference_slug] || params[:slug])
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def workshop_params
|
||||
params.require(:workshop).permit(:title, :slug, :info, :conference_id, :workshop_stream_id, :workshop_presentation_style, :min_facilitators, :location_id, :start_time, :end_time)
|
||||
end
|
||||
end
|
||||
@@ -90,7 +90,7 @@ module ApplicationHelper
|
||||
return nil
|
||||
end
|
||||
|
||||
def _(key, behavior = nil, behavior_size = nil, fake: nil, vars: {}, html: nil, blockData: {}, &block)
|
||||
def _(key, behavior = nil, behavior_size = nil, vars: {}, html: nil, blockData: {}, &block)
|
||||
|
||||
queued_keys = nil
|
||||
result = nil
|
||||
@@ -201,7 +201,7 @@ module ApplicationHelper
|
||||
end
|
||||
end
|
||||
|
||||
def field(form, name, type = nil, param = nil, html: nil, help: false, attrs: [], classes: nil, label: nil, placeholder: nil)
|
||||
def field(form, name, type = nil, param = nil, html: nil, help: false, attrs: [], classes: nil, label: nil, placeholder: nil, value: nil, checked: nil, required: false)
|
||||
|
||||
if form.is_a?(Symbol) || form.is_a?(String)
|
||||
param = type
|
||||
@@ -226,20 +226,26 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
select_prompt = nil
|
||||
show_label = true
|
||||
show_label = !(/^hidden_field/.match(type.to_s))
|
||||
label_after = true
|
||||
value_attribute = !form
|
||||
|
||||
if /select(_tag)?$/.match(type.to_s)
|
||||
placeholder = nil
|
||||
if !label
|
||||
select_prompt = 'Select a ' + name.to_s
|
||||
select_prompt = placeholder || (form ? 'Select a ' + name.to_s : 'Select one')
|
||||
label_html = ''
|
||||
show_label = false
|
||||
end
|
||||
label_after = false
|
||||
if param && param.is_a?(Array)
|
||||
param = options_for_select(param)
|
||||
placeholder = nil
|
||||
label_after = false
|
||||
if param
|
||||
if param.is_a?(Array)
|
||||
param = options_for_select(param, value)
|
||||
elsif param.is_a?(Hash)
|
||||
param = options_from_collection_for_select(param, :first, :last, value)
|
||||
end
|
||||
end
|
||||
value_attribute = false
|
||||
elsif type.to_s == 'image_field' || type.to_s == 'user_select_field' || type.to_s == 'organization_select_field'
|
||||
placeholder = nil
|
||||
label_html = ''
|
||||
@@ -256,7 +262,7 @@ module ApplicationHelper
|
||||
label_html = eval("(" + (form ? 'form.label' : 'label_tag') + " name, '<span>#{label ? CGI.escapeHTML(label) : name}</span>'.html_safe)")
|
||||
end
|
||||
|
||||
if label === false
|
||||
if label === false || !show_label
|
||||
label_html = ''
|
||||
end
|
||||
|
||||
@@ -316,14 +322,29 @@ module ApplicationHelper
|
||||
end
|
||||
else
|
||||
ph = ''
|
||||
va = ''
|
||||
if value_attribute
|
||||
if /^(check_box|radio_button)/.match(type.to_s)
|
||||
if checked === nil
|
||||
checked = value == "on" || value.to_s == "1"
|
||||
end
|
||||
if /^(radio_button)/.match(type.to_s)
|
||||
va = ', "' + value + '", checked'
|
||||
else
|
||||
va = ', "1", checked'
|
||||
end
|
||||
else
|
||||
va = ', value'
|
||||
end
|
||||
end
|
||||
if placeholder
|
||||
if form
|
||||
ph = ", :placeholder => '#{placeholder}'"
|
||||
else
|
||||
ph = ", nil, placeholder: '#{placeholder}'"
|
||||
ph = ", placeholder: '#{placeholder}'"
|
||||
end
|
||||
end
|
||||
form_html = (form ? "form.#{type} :#{name}" : "#{type} :#{name}") + ph + (param ? ', param' : '')
|
||||
form_html = (form ? "form.#{type} :#{name}" : "#{type} :#{name}") + va + ph + (param ? ', param' : '')
|
||||
attrs.each_index { |i| form_html += (i >= attrs_used ? ', attrs[' + i.to_s + ']' : '') }
|
||||
if select_prompt
|
||||
if form
|
||||
@@ -333,7 +354,9 @@ module ApplicationHelper
|
||||
end
|
||||
end
|
||||
form_html += (html_options || '')
|
||||
puts "\n\t" + form_html + "\n"
|
||||
if required
|
||||
form_html += ', :required => true'
|
||||
end
|
||||
form_html = eval(form_html)
|
||||
if root
|
||||
form_html = "<#{root}>" + form_html + "</#{root}>"
|
||||
@@ -383,7 +406,18 @@ module ApplicationHelper
|
||||
if params[:action] == tab.to_s
|
||||
c << 'current'
|
||||
end
|
||||
tab_list += link_to tab, link || object, :class => c
|
||||
link_html = ''
|
||||
if tab.is_a?(Hash)
|
||||
func = tab.keys[0]
|
||||
val = tab[func]
|
||||
args = val ? (val.is_a?(Array) ? (val.collect { |v| object[v] } ) : [object[val]] ) : nil
|
||||
|
||||
link_html = link_to func.to_s.gsub(/_path$/, ''), args ? self.send(func, args) : self.send(func), :class => c
|
||||
else
|
||||
#x
|
||||
link_html = link_to tab, link || object, :class => c
|
||||
end
|
||||
tab_list += link_html
|
||||
end
|
||||
('<nav class="row centered">
|
||||
<div class="tabs">' +
|
||||
@@ -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
|
||||
('<p>' + object.send(attribute.to_s).strip.gsub(/\s*\n+\s*/, '</p><p>') + '</p>').html_safe
|
||||
end
|
||||
|
||||
def form_field(f)
|
||||
def form_field(f, response = nil)
|
||||
id = 'field_' + f.id.to_s
|
||||
html = p(f, 'title')#'<label for="' + id + '">' + f.title + '</label>'
|
||||
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
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
module EventTypesHelper
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
module EventsHelper
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
module WorkshopFacilitatorsHelper
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
module WorkshopRequestedResourcesHelper
|
||||
end
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
class Event < ActiveRecord::Base
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
class EventType < ActiveRecord::Base
|
||||
end
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class Workshop < ActiveRecord::Base
|
||||
belongs_to :conference
|
||||
|
||||
def to_param
|
||||
slug
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
class WorkshopFacilitator < ActiveRecord::Base
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
class WorkshopRequestedResource < ActiveRecord::Base
|
||||
end
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
@@ -0,0 +1,7 @@
|
||||
%h1 Editing event_type
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @event_type
|
||||
\|
|
||||
= link_to 'Back', event_types_path
|
||||
@@ -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
|
||||
@@ -0,0 +1,5 @@
|
||||
%h1 New event_type
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', event_types_path
|
||||
@@ -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
|
||||
@@ -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'
|
||||
@@ -0,0 +1,7 @@
|
||||
%h1 Editing event
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @event
|
||||
\|
|
||||
= link_to 'Back', events_path
|
||||
@@ -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
|
||||
@@ -0,0 +1,5 @@
|
||||
%h1 New event
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', events_path
|
||||
@@ -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
|
||||
@@ -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}
|
||||
|
||||
@@ -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'
|
||||
@@ -0,0 +1,7 @@
|
||||
%h1 Editing workshop_facilitator
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @workshop_facilitator
|
||||
\|
|
||||
= link_to 'Back', workshop_facilitators_path
|
||||
@@ -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
|
||||
@@ -0,0 +1,5 @@
|
||||
%h1 New workshop_facilitator
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', workshop_facilitators_path
|
||||
@@ -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
|
||||
@@ -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'
|
||||
@@ -0,0 +1,7 @@
|
||||
%h1 Editing workshop_requested_resource
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @workshop_requested_resource
|
||||
\|
|
||||
= link_to 'Back', workshop_requested_resources_path
|
||||
@@ -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
|
||||
@@ -0,0 +1,5 @@
|
||||
%h1 New workshop_requested_resource
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', workshop_requested_resources_path
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,6 @@
|
||||
- page_style :form
|
||||
|
||||
= tabs!
|
||||
|
||||
.row
|
||||
= render 'form'
|
||||
@@ -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
|
||||
@@ -0,0 +1,6 @@
|
||||
- page_style :form
|
||||
|
||||
= tabs!
|
||||
|
||||
.row
|
||||
= render 'form'
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user