This commit is contained in:
Aditya Chatterjee 2016-02-27 17:03:43 +05:30
parent 28e55f3f50
commit a5a2db4077
156 changed files with 3203 additions and 1206 deletions

View file

@ -12,7 +12,7 @@
//
//= require jquery
//= require jquery_ujs
//= require waypoints
//= require waypoints/jquery.waypoints
//= require dataTables/jquery.dataTables
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require cocoon
@ -20,15 +20,15 @@
//= require Chart
//= require d3
//= require osem
//= require dashboard
//= require osem-dashboard
//= require ahoy
//= require smoothscroll
//= require trianglify.min
//= require jquery-smooth-scroll
//= require trianglify
//= require tinycolor
//= require bootstrap-markdown
//= require to-markdown
//= require markdown
//= require moment
//= require momentjs
//= require leaflet
//= require bootstrap-datetimepicker
//= require osem-datepickers
@ -43,4 +43,8 @@ $(document).ready(function() {
$('a[disabled=disabled]').click(function(event){
return false;
});
$('body').smoothScroll({
delegateSelector: 'a.smoothscroll'
});
});

View file

@ -0,0 +1,130 @@
$(function() {
var t;
function size(animate){
if (animate == undefined){
animate = false;
}
clearTimeout(t);
t = setTimeout(function(){
$("canvas").each(function(i,el){
$(el).attr({
"width":$(el).parent().width()
});
});
$(".line_chart").each(function(){
draw_line_chart(animate, $(this));
});
$(".doughnut_chart").each(function(){
if($(this).is(":visible")){
draw_doughnut_chart(animate, $(this));
}
});
}, 30);
}
function draw_doughnut_chart(animation, $this){
var options = get_animation({}, animation);
var tmp = $this.data('chart');
if(jQuery.isEmptyObject(tmp)){
// Append error message if there is no data
$this.parent().append("<h4 class=\"text-warning\">No data!</h4>");
// Remove canvas
$this.remove();
}else{
var data = [];
for (var key in tmp) {
data.push(tmp[key]);
}
var ctx = $this.get(0).getContext("2d");
new Chart(ctx).Doughnut(data, options);
}
}
function get_animation(options, animation){
if (!animation){
options.animation = false;
} else {
options.animation = true;
}
return options;
}
function draw_line_chart(animation, $canvas){
var options = get_animation({}, animation);
var chart_data = create_dataset($canvas);
var weeks = $canvas.parent().data('weeks');
var data = {
labels : weeks,
datasets : chart_data
}
var ctx = $canvas.get(0).getContext("2d");
new Chart(ctx).Line(data, options);
}
function create_dataset($canvas){
var selected = getSelectedConferences($canvas);
var chart_data = $canvas.parent().data('chart');
var conferences = $canvas.parent().data('conferences');
var result = [];
for(var i in conferences){
if(selected.indexOf(conferences[i].short_title) >= 0){
var options = {};
options.fillColor = "rgba(255,255,255,0.0)";
options.strokeColor = conferences[i].color;
options.data = chart_data[conferences[i].short_title];
if(options.data == null || options.data.length == 0){
options.data = [0];
}
result.push(options)
}
}
return result
}
function getSelectedConferences($canvas){
var name = $canvas.data('name');
var id = '#' + name + 'Checkboxes'
var selected = [];
var $checkboxes = $(id + ' input');
// If there are checkboxes -> get selected
// Else -> use the active conference
if($checkboxes.length){
$(id + ' input').each(function(){
if($(this).is(":checked")) {
selected.push($(this).attr('name'));
}
});
}else{
var active = $canvas.parent().data('active');
for(i in active){
selected.push(active[i].short_title)
}
}
return selected;
}
$('.conferenceCheckboxes input').change(function(){
var chart_name = $(this).parent().data('chart');
var $canvas = $('#line_chart_' + chart_name);
draw_line_chart(false, $canvas);
});
$(window).on('resize', function(){
size(false);
});
$('#doughnut_tabs a').click(function (e) {
e.preventDefault();
$(this).tab('show');
size(false);
});
size(true);
});

View file

@ -0,0 +1,58 @@
module Admin
class CfpsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :program, through: :conference, singleton: true
load_and_authorize_resource through: :program, singleton: true
def show; end
def new
@cfp = @program.build_cfp
end
def edit; end
def create
@cfp = @program.build_cfp(cfp_params)
if @cfp.save
redirect_to admin_conference_program_cfp_path,
notice: 'Call for papers successfully created.'
else
flash[:error] = "Creating the call for papers failed. #{@cfp.errors.full_messages.join('. ')}."
render :new
end
end
def update
@cfp = @program.cfp
@cfp.assign_attributes(cfp_params)
send_mail_on_cfp_dates_updates = @cfp.notify_on_cfp_date_update?
if @cfp.update_attributes(cfp_params)
Mailbot.delay.send_on_cfps_dates_updates(@conference) if send_mail_on_cfp_dates_updates
redirect_to(admin_conference_program_cfp_path(@conference.short_title),
notice: 'Call for papers successfully updated.')
else
flash[:error] = "Updating call for papers failed. #{@cfp.errors.to_a.join('. ')}."
render :new
end
end
def destroy
if @cfp.destroy
redirect_to admin_conference_program_cfp_path, notice: 'Call for Papers was successfully deleted.'
else
redirect_to admin_conference_program_cfp_path, error: 'An error prohibited this Call for Papers from being destroyed: '\
"#{@cfp.errors.full_messages.join('. ')}."
end
end
private
def cfp_params
params.require(:cfp).permit(:start_date, :end_date)
end
end
end

View file

@ -22,7 +22,7 @@ module Admin
# Grouping all comments by conference, and by event. It returns {:conference => {:event => [{comment_2}, {comment_1 }]}}
def grouped_comments(remarks)
remarks.group_by{ |comment| comment.commentable.conference }.map {|conference, comments| [conference, comments.group_by{|comment| comment.commentable}]}.to_h
remarks.group_by{ |comment| comment.commentable.program.conference }.map {|conference, comments| [conference, comments.group_by{|comment| comment.commentable}]}.to_h
end
end
end

View file

@ -1,6 +1,7 @@
module Admin
class ConferenceController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_resource :program, through: :conference, singleton: true, except: :index
load_resource :user, only: [:remove_user]
def index
@ -94,14 +95,17 @@ module Admin
end
def show
@conference = Conference.find_by(short_title: params[:id])
@program = @conference.program
unless @conference.program
@program = Program.new(conference_id: @conference.id)
end
# Overview and since last login information
@total_reg = @conference.registrations.count
@new_reg = @conference.registrations.where('created_at > ?', current_user.last_sign_in_at).count
@total_submissions = @conference.events.count
@new_submissions = @conference.events.
@total_submissions = @program.events.count
@new_submissions = @program.events.
where('created_at > ?', current_user.last_sign_in_at).count
@program_length = @conference.current_program_hours
@ -141,7 +145,7 @@ module Admin
@tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed)
# Recent actions information
@recent_events = @conference.events.limit(5).order(created_at: :desc)
@recent_events = @conference.program.events.limit(5).order(created_at: :desc)
@recent_registrations = @conference.registrations.limit(5).order(created_at: :desc)
@top_submitter = @conference.get_top_submitter
@ -207,7 +211,7 @@ module Admin
:vpositions_attributes, :use_volunteers, :color,
:sponsorship_levels_attributes, :sponsors_attributes,
:photos_attributes, :targets, :targets_attributes,
:campaigns, :campaigns_attributes)
:campaigns, :campaigns_attributes, :registration_limit)
end
def get_users(role_name)

View file

@ -1,23 +1,24 @@
module Admin
class DifficultyLevelsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :difficulty_level, through: :conference
load_and_authorize_resource :program, through: :conference, singleton: true
load_and_authorize_resource through: :program
def index
authorize! :index, DifficultyLevel.new(conference_id: @conference.id)
# authorize! :index, DifficultyLevel.new(program_id: @program.id)
end
def edit; end
def new
@difficulty_level = @conference.difficulty_levels.new
@difficulty_level = @conference.program.difficulty_levels.new
end
def create
@difficulty_level = @conference.difficulty_levels.new(difficulty_level_params)
@difficulty_level = @conference.program.difficulty_levels.new(difficulty_level_params)
if @difficulty_level.save
flash[:notice] = 'Difficulty level successfully created.'
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title))
else
flash[:error] = "Creating difficulty level failed: #{@difficulty_level.errors.full_messages.join('. ')}."
render :new
@ -27,7 +28,7 @@ module Admin
def update
if @difficulty_level.update_attributes(difficulty_level_params)
flash[:notice] = 'Difficulty level successfully updated.'
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title))
else
flash[:error] = "Update difficulty level failed: #{@difficulty_level.errors.full_messages.join('. ')}."
render :edit
@ -37,11 +38,11 @@ module Admin
def destroy
if @difficulty_level.destroy
flash[:notice] = 'Difficulty level successfully deleted.'
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title))
else
flash[:error] = 'Deleting difficulty level type failed! ' \
"#{@difficulty_level.errors.full_messages.join('. ')}."
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title))
end
end

View file

@ -1,23 +1,22 @@
module Admin
class EventTypesController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :event_type, through: :conference
load_and_authorize_resource :program, through: :conference, singleton: true
load_and_authorize_resource :event_type, through: :program
def index
authorize! :index, EventType.new(conference_id: @conference.id)
end
def index; end
def edit; end
def new
@event_type = @conference.event_types.new
@event_type = @conference.program.event_types.new
end
def create
@event_type = @conference.event_types.new(event_type_params)
@event_type = @conference.program.event_types.new(event_type_params)
if @event_type.save
flash[:notice] = 'Event type successfully created.'
redirect_to(admin_conference_event_types_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_event_types_path(conference_id: @conference.short_title))
else
flash[:error] = "Creating event type failed: #{@event_type.errors.full_messages.join('. ')}."
render :new
@ -27,7 +26,7 @@ module Admin
def update
if @event_type.update_attributes(event_type_params)
flash[:notice] = 'Event type successfully updated.'
redirect_to(admin_conference_event_types_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_event_types_path(conference_id: @conference.short_title))
else
flash[:error] = "Update event type failed: #{@event_type.errors.full_messages.join('. ')}."
render :edit
@ -37,11 +36,11 @@ module Admin
def destroy
if @event_type.destroy
flash[:notice] = 'Event type successfully deleted.'
redirect_to(admin_conference_event_types_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_event_types_path(conference_id: @conference.short_title))
else
flash[:error] = 'Destroying event type failed! ' \
"#{@event_type.errors.full_messages.join('. ')}."
redirect_to(admin_conference_event_types_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_event_types_path(conference_id: @conference.short_title))
end
end

View file

@ -1,7 +1,8 @@
module Admin
class EventsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :event, through: :conference
load_and_authorize_resource :program, through: :conference, singleton: true
load_and_authorize_resource :event, through: :program
before_action :get_event, except: [:index, :create]
@ -14,13 +15,11 @@ module Admin
end
def index
authorize! :index, @conference.events.build
@conference = Conference.find_by(short_title: params[:conference_id])
@events = @conference.events
@tracks = @conference.tracks
@difficulty_levels = @conference.difficulty_levels
@events = @program.events
@tracks = @program.tracks
@difficulty_levels = @program.difficulty_levels
@machine_states = @events.state_machine.states.map
@event_types = @conference.event_types
@event_types = @program.event_types
@mystates = []
@mytypes = []
@ -72,26 +71,26 @@ module Admin
respond_to do |format|
format.html
# Explicity call #to_json to avoid the use of EventSerializer
format.json { render json: Event.where(state: :confirmed, conference: @conference).to_json }
format.json { render json: Event.where(state: :confirmed, program: @program).to_json }
end
end
def show
@tracks = @conference.tracks
@event_types = @conference.event_types
@tracks = @program.tracks
@event_types = @program.event_types
@comments = @event.root_comments
@comment_count = @event.comment_threads.count
@ratings = @event.votes.includes(:user)
@difficulty_levels = @conference.difficulty_levels
@difficulty_levels = @program.difficulty_levels
end
def edit
@event_types = @conference.event_types
@event_types = @program.event_types
@tracks = Track.all
@comments = @event.root_comments
@comment_count = @event.comment_threads.count
@user = @event.submitter
@url = admin_conference_event_path(@conference.short_title, @event)
@url = admin_conference_program_event_path(@conference.short_title, @event)
end
def comment
@ -101,7 +100,7 @@ module Admin
comment.move_to_child_of(params[:parent])
end
redirect_to admin_conference_event_path(conference_id: @conference.short_title)
redirect_to admin_conference_program_event_path(@conference.short_title, @event)
end
def update
@ -111,10 +110,10 @@ module Admin
render js: 'index'
else
flash[:notice] = "Successfully updated event with ID #{@event.id}."
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event))
redirect_back_or_to(admin_conference_program_event_path(@conference.short_title, @event))
end
else
@url = admin_conference_event_path(@conference.short_title, @event)
@url = admin_conference_program_event_path(@conference.short_title, @event)
flash[:notice] = 'Update not successful. ' + @event.errors.full_messages.to_sentence
render :edit
end
@ -123,8 +122,8 @@ module Admin
def create; end
def accept
send_mail = @event.conference.email_settings.send_on_accepted
subject = @event.conference.email_settings.accepted_subject.blank?
send_mail = @event.program.conference.email_settings.send_on_accepted
subject = @event.program.conference.email_settings.accepted_subject.blank?
update_state(:accept, 'Event accepted!', true, subject, send_mail)
end
@ -137,8 +136,8 @@ module Admin
end
def reject
send_mail = @event.conference.email_settings.send_on_rejected
subject = @event.conference.email_settings.rejected_subject.blank?
send_mail = @event.program.conference.email_settings.send_on_rejected
subject = @event.program.conference.email_settings.rejected_subject.blank?
update_state(:reject, 'Event rejected!', true, subject, send_mail)
end
@ -159,7 +158,7 @@ module Admin
end
respond_to do |format|
format.html { redirect_to admin_conference_event_path(@conference.short_title, @event) }
format.html { redirect_to admin_conference_program_event_path(@conference.short_title, @event) }
format.js
end
end
@ -181,9 +180,9 @@ module Admin
end
def get_event
@event = @conference.events.find_by_id(params[:id])
@event = @conference.program.events.find(params[:id])
if !@event
redirect_to(admin_conference_events_path(conference_id: @conference.short_title),
redirect_to(admin_conference_program_events_path(conference_id: @conference.short_title),
alert: 'Error! Could not find event!') && return
end
@event
@ -194,10 +193,10 @@ module Admin
if alert.blank?
flash[:notice] = notice
redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
redirect_back_or_to(admin_conference_program_events_path(conference_id: @conference.short_title)) && return
else
flash[:error] = alert
return redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
return redirect_back_or_to(admin_conference_program_events_path(conference_id: @conference.short_title)) && return
end
end
end

View file

@ -0,0 +1,32 @@
module Admin
class ProgramsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource through: :conference, singleton: true
def show; end
def edit; end
def update
authorize! :update, @conference.program
@program = @conference.program
@program.assign_attributes(program_params)
# send_mail_on_schedule_public = @program.notify_on_schedule_public?
if @program.update_attributes(program_params)
# Mailbot.delay.send_on_schedule_public(@conference) if send_mail_on_schedule_public
redirect_to(admin_conference_program_path(@conference.short_title),
notice: 'The program was successfully updated.')
else
flash[:error] = "Updating program failed. #{@program.errors.to_a.join('. ')}."
render :new
end
end
private
def program_params
params.require(:program).permit(:rating, :schedule_public, :schedule_fluid)
end
end
end

View file

@ -1,23 +1,22 @@
module Admin
class RoomsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource through: :conference
load_and_authorize_resource :venue, through: :conference, singleton: true
load_and_authorize_resource through: :venue
def index
authorize! :index, Room.new(conference_id: @conference.id)
end
def index; end
def edit; end
def new
@room = @conference.rooms.new
@room = @venue.rooms.new
end
def create
@room = @conference.rooms.new(room_params)
@room = @venue.rooms.new(room_params)
if @room.save
flash[:notice] = 'Room successfully created.'
redirect_to(admin_conference_rooms_path(conference_id: @conference.short_title))
redirect_to(admin_conference_venue_rooms_path(conference_id: @conference.short_title))
else
flash[:error] = "Creating Room failed: #{@room.errors.full_messages.join('. ')}."
render :new
@ -27,7 +26,7 @@ module Admin
def update
if @room.update_attributes(room_params)
flash[:notice] = 'Room successfully updated.'
redirect_to(admin_conference_rooms_path(conference_id: @conference.short_title))
redirect_to(admin_conference_venue_rooms_path(conference_id: @conference.short_title))
else
flash[:error] = "Update Room failed: #{@room.errors.full_messages.join('. ')}."
render :edit
@ -37,10 +36,10 @@ module Admin
def destroy
if @room.destroy
flash[:notice] = 'Room successfully deleted.'
redirect_to(admin_conference_rooms_path(conference_id: @conference.short_title))
redirect_to(admin_conference_venue_rooms_path(conference_id: @conference.short_title))
else
flash[:error] = "Destroying room failed! #{@room.errors.full_messages.join('. ')}."
redirect_to(admin_conference_rooms_path(conference_id: @conference.short_title))
redirect_to(admin_conference_venue_rooms_path(conference_id: @conference.short_title))
end
end

View file

@ -3,23 +3,29 @@ module Admin
# By authorizing 'conference' resource, we can ensure there will be no unauthorized access to
# the schedule of a conference, which should not be accessed in the first place
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :program, through: :conference, singleton: true
load_resource :venue, through: :conference, singleton: true
skip_before_filter :verify_authenticity_token, only: [:update]
layout 'schedule'
def show
authorize! :update, @conference.events.new
authorize! :update, @program.events.new
if @conference.nil?
redirect_to admin_conference_index_path
return
end
@dates = @conference.start_date..@conference.end_date
@rooms = @conference.rooms
if @venue && @venue.rooms.any?
@rooms = @venue.rooms
else
@rooms = [ Room.new(name: 'No Rooms!', size: 0) ]
end
end
def update
authorize! :update, @conference.events.new
event = Event.where(guid: event_params).first
authorize! :update, @program.events.new
event = Event.where(guid: params[:event]).first
error_message = nil
if event.nil?
error_message = "Could not find event GUID: #{params[:event]}"
@ -63,7 +69,7 @@ module Admin
end
def room_params
params.require(:room).permit(:guid)
params.require(:room)
end
end
end

View file

@ -1,7 +1,8 @@
module Admin
class TracksController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :track, through: :conference
load_and_authorize_resource :program, through: :conference, singleton: true
load_and_authorize_resource through: :program
def index; end
@ -13,14 +14,14 @@ module Admin
end
def new
@track = @conference.tracks.new
@track = @program.tracks.new
end
def create
@track = @conference.tracks.new(track_params)
@track = @program.tracks.new(track_params)
if @track.save
flash[:notice] = 'Track successfully created.'
redirect_to(admin_conference_tracks_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_tracks_path(conference_id: @conference.short_title))
else
flash[:error] = "Creating Track failed: #{@track.errors.full_messages.join('. ')}."
render :new
@ -32,7 +33,7 @@ module Admin
def update
if @track.update_attributes(track_params)
flash[:notice] = 'Track successfully updated.'
redirect_to(admin_conference_tracks_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_tracks_path(conference_id: @conference.short_title))
else
flash[:error] = "Track update failed: #{@track.errors.full_messages.join('. ')}."
render :edit
@ -42,10 +43,10 @@ module Admin
def destroy
if @track.destroy
flash[:notice] = 'Track successfully deleted.'
redirect_to(admin_conference_tracks_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_tracks_path(conference_id: @conference.short_title))
else
flash[:error] = "Track couldn't be deleted. #{@track.errors.full_messages.join('. ')}."
redirect_to(admin_conference_tracks_path(conference_id: @conference.short_title))
redirect_to(admin_conference_program_tracks_path(conference_id: @conference.short_title))
end
end

View file

@ -1,15 +1,15 @@
module Api
module V1
class ConferencesController < Api::BaseController
load_resource find_by: :short_title
respond_to :json
def index
if params[:conference_id].blank?
conferences = Conference.all
else
conferences = Conference.find_all_by_guid(params[:conference_id])
end
render json: conferences, serializer: ConferencesArraySerializer
render json: @conferences, serializer: ConferencesArraySerializer
end
def show
render json: [@conference], serializer: ConferencesArraySerializer
end
end
end

View file

@ -1,13 +1,16 @@
module Api
module V1
class EventsController < Api::BaseController
load_resource :conference, find_by: :short_title
respond_to :json
def index
events = Event.includes(:conference, :track, :room, :event_type, event_users: :user)
unless params[:conference_id].blank?
events = events.where(conferences: { guid: params[:conference_id] })
if @conference
events = events.where(conference: @conference)
end
respond_with events.confirmed
end
end

View file

@ -1,6 +1,7 @@
module Api
module V1
class RoomsController < Api::BaseController
load_resource :conference, find_by: :short_title
respond_to :json
def index
@ -8,7 +9,7 @@ module Api
rooms = Room.all
else
conference = Conference.find_by_guid(params[:conference_id])
rooms = conference.rooms
rooms = conference.venue.rooms if conference.venue
end
respond_with rooms
end

View file

@ -1,16 +1,18 @@
module Api
module V1
class SpeakersController < Api::BaseController
load_resource :conference, find_by: :short_title
respond_to :json
def index
if params[:conference_id].blank?
users = User.joins(:event_users)
else
if @conference
users = User.joins(event_users: { event: :conference })
users = users.where(conferences: { guid: params[:conference_id] })
users = users.where(conferences: { short_title: @conference.short_title })
else
users = User.joins(:event_users)
end
users = users.where(event_users: {event_role: :speaker})
users = users.where(event_users: {event_role: :speaker}).uniq
render json: users, each_serializer: SpeakerSerializer
end
end

View file

@ -1,15 +1,12 @@
module Api
module V1
class TracksController < Api::BaseController
load_resource :conference, find_by: :short_title
respond_to :json
def index
if params[:conference_id].blank?
tracks = Track.all
else
tracks = Track.joins(:conference)
tracks = tracks.where(conferences: { guid: params[:conference_id] })
end
@conference ? (tracks = @conference.tracks) : (tracks = Track.all)
respond_with tracks
end
end

View file

@ -71,6 +71,8 @@ class ApplicationController < ActionController::Base
##
# Returns a string build from the start and end date of the given conference.
#
# If the conference is only one day long
# * %B %d %Y (January 17 2014)
# If the conference starts and ends in the same month and year
# * %B %d - %d, %Y (January 17 - 21 2014)
# If the conference ends in another month but in the same year
@ -82,8 +84,13 @@ class ApplicationController < ActionController::Base
endstr = 'Unknown'
# When the conference in the same month
if start_date.month == end_date.month && start_date.year == end_date.year
startstr = start_date.strftime('%B %d - ')
endstr = end_date.strftime('%d, %Y')
if start_date.day == end_date.day
startstr = start_date.strftime('%B %d')
endstr = end_date.strftime(' %Y')
else
startstr = start_date.strftime('%B %d - ')
endstr = end_date.strftime('%d, %Y')
end
elsif start_date.month != end_date.month && start_date.year == end_date.year
startstr = start_date.strftime('%B %d - ')
endstr = end_date.strftime('%B %d, %Y')

View file

@ -8,7 +8,7 @@ class CommercialsController < ApplicationController
authorize! :create, @commercial
if @commercial.save
redirect_to edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id, anchor: 'commercials-content'),
redirect_to edit_conference_program_proposal_path(conference_id: @conference.short_title, id: @event.id, anchor: 'commercials-content'),
notice: 'Commercial was successfully created.'
else
flash[:error] = "An error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
@ -18,7 +18,7 @@ class CommercialsController < ApplicationController
def update
if @commercial.update(commercial_params)
redirect_to edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id, anchor: 'commercials-content'),
redirect_to edit_conference_program_proposal_path(conference_id: @conference.short_title, id: @event.id, anchor: 'commercials-content'),
notice: 'Commercial was successfully updated.'
else
flash[:error] = "An error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
@ -28,7 +28,7 @@ class CommercialsController < ApplicationController
def destroy
@commercial.destroy
redirect_to edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id, anchor: 'commercials-content'),
redirect_to edit_conference_program_proposal_path(conference_id: @conference.short_title, id: @event.id),
notice: 'Commercial was successfully destroyed.'
end
@ -44,7 +44,7 @@ class CommercialsController < ApplicationController
private
def set_event
@event = @conference.events.find(params[:proposal_id])
@event = @conference.program.events.find(params[:proposal_id])
end
def commercial_params

View file

@ -1,6 +1,7 @@
class ConferenceController < ApplicationController
before_filter :respond_to_options
load_and_authorize_resource find_by: :short_title
load_resource :program, through: :conference, singleton: true, except: :index
def index
@current = Conference.where('end_date >= ?', Date.current).order('start_date ASC')
@ -10,8 +11,8 @@ class ConferenceController < ApplicationController
def show; end
def schedule
@rooms = @conference.rooms
@events = @conference.events
@rooms = @conference.venue.rooms if @conference.venue
@events = @conference.program.events
@dates = @conference.start_date..@conference.end_date
if @dates == Date.current

View file

@ -20,6 +20,11 @@ class ConferenceRegistrationsController < ApplicationController
redirect_to edit_conference_conference_registrations_path(@conference.short_title)
end
if @conference.registration_limit_exceeded?
redirect_to root_path, alert: "Sorry, registration limit exceeded for #{@conference.title}"
return
end
@registration = Registration.new
# @user variable needs to be set so that _sign_up_form_embedded works properly

View file

@ -1,7 +1,8 @@
class ProposalController < ApplicationController
before_filter :authenticate_user!, except: [:show, :new, :create]
load_resource :conference, find_by: :short_title
load_and_authorize_resource :event, parent: false, through: :conference
load_resource :program, through: :conference, singleton: true
load_and_authorize_resource :event, parent: false, through: :program
def index
@events = current_user.proposals(@conference)
@ -14,16 +15,16 @@ class ProposalController < ApplicationController
def new
@user = User.new
@url = conference_proposal_index_path(@conference.short_title)
@url = conference_program_proposal_index_path(@conference.short_title)
end
def edit
authorize! :edit, @event
@url = conference_proposal_path(@conference.short_title, params[:id])
@url = conference_program_proposal_path(@conference.short_title, params[:id])
end
def create
@url = conference_proposal_index_path(@conference.short_title)
@url = conference_program_proposal_index_path(@conference.short_title)
unless current_user
@user = User.new(user_params)
@ -39,7 +40,7 @@ class ProposalController < ApplicationController
params[:event].delete :user
@event = Event.new(event_params)
@event.conference = @conference
@event.program = @program
@event.event_users.new(user: current_user,
event_role: 'submitter')
@ -55,12 +56,12 @@ class ProposalController < ApplicationController
ahoy.track 'Event submission', title: 'New submission'
flash[:notice] = 'Proposal was successfully submitted.'
redirect_to conference_proposal_index_path(@conference.short_title)
redirect_to conference_program_proposal_index_path(@conference.short_title)
end
def update
authorize! :update, @event
@url = conference_proposal_path(@conference.short_title, params[:id])
@url = conference_program_proposal_path(@conference.short_title, params[:id])
if !@event.update(event_params)
flash[:error] = "Could not update proposal: #{@event.errors.full_messages.join(', ')}"
@ -68,13 +69,13 @@ class ProposalController < ApplicationController
return
end
redirect_to(conference_proposal_index_path(conference_id: @conference.short_title),
redirect_to(conference_program_proposal_index_path(conference_id: @conference.short_title),
notice: 'Proposal was successfully updated.')
end
def destroy
authorize! :destroy, @event
@url = conference_proposal_path(@conference.short_title, params[:id])
@url = conference_program_proposal_path(@conference.short_title, params[:id])
begin
@event.withdraw
@ -84,13 +85,13 @@ class ProposalController < ApplicationController
end
@event.save(validate: false)
redirect_to(conference_proposal_index_path(conference_id: @conference.short_title),
redirect_to(conference_program_proposal_index_path(conference_id: @conference.short_title),
notice: 'Proposal was successfully withdrawn.')
end
def confirm
authorize! :update, @event
@url = conference_proposal_path(@conference.short_title, params[:id])
@url = conference_program_proposal_path(@conference.short_title, params[:id])
begin
@event.confirm!
@ -106,7 +107,7 @@ class ProposalController < ApplicationController
end
if @conference.user_registered?(current_user)
redirect_to(conference_proposal_index_path(@conference.short_title),
redirect_to(conference_program_proposal_index_path(@conference.short_title),
notice: 'The proposal was confirmed.')
else
redirect_to(new_conference_conference_registrations_path(conference_id: @conference.short_title),
@ -116,12 +117,12 @@ class ProposalController < ApplicationController
def restart
authorize! :update, @event
@url = conference_proposal_path(@conference.short_title, params[:id])
@url = conference_program_proposal_path(@conference.short_title, params[:id])
begin
@event.restart
rescue Transitions::InvalidTransition
redirect_to(conference_proposal_index_path(conference_id: @conference.short_title),
redirect_to(conference_program_proposal_index_path(conference_id: @conference.short_title),
error: "The proposal can't be re-submitted.")
return
end
@ -132,7 +133,7 @@ class ProposalController < ApplicationController
return
end
redirect_to(conference_proposal_index_path(conference_id: @conference.short_title),
redirect_to(conference_program_proposal_index_path(conference_id: @conference.short_title),
notice: "The proposal was re-submitted. The #{@conference.short_title} organizers will review it again.")
end

View file

@ -159,7 +159,7 @@ module ApplicationHelper
end
def pre_registered(event)
@conference.events.joins(:registrations).where('events.id = ?', event.id)
@conference.program.events.joins(:registrations).where('events.id = ?', event.id)
end
def add_association_link(association_name, form_builder, div_class, html_options = {})
@ -184,7 +184,7 @@ module ApplicationHelper
end
def event_types(conference)
all = conference.event_types.map { |et | et.title.pluralize }
all = conference.program.event_types.map { |et | et.title.pluralize }
first = all[0...-1]
last = all[-1]
ets = ''
@ -198,7 +198,21 @@ module ApplicationHelper
end
def tracks(conference)
all = conference.tracks.map {|t| t.name}
all = conference.program.tracks.map {|t| t.name}
first = all[0...-1]
last = all[-1]
ts = ''
if all.length > 1
ts << first.join(', ')
ts << " and #{last}"
else
ts = all.join
end
return ts
end
def difficulty_levels(conference)
all = conference.program.difficulty_levels.map {|t| t.title}
first = all[0...-1]
last = all[-1]
ts = ''

View file

@ -66,17 +66,17 @@ class Mailbot < ActionMailer::Base
User.joins(:subscriptions).merge(conference.subscriptions) do |user|
build_email(conference,
user.email,
conference.email_settings.call_for_papers_schedule_public_subject,
conference.email_settings.generate_email_on_conf_updates(conference, user, conference.email_settings.call_for_papers_schedule_public_body))
conference.email_settings.program_schedule_public_subject,
conference.email_settings.generate_email_on_conf_updates(conference, user, conference.email_settings.program_schedule_public_body))
end
end
def send_on_call_for_papers_dates_updated(conference)
def send_on_cfp_dates_updates(conference)
User.joins(:subscriptions).merge(conference.subscriptions) do |user|
build_email(conference,
user.email,
conference.email_settings.call_for_papers_dates_updated_subject,
conference.email_settings.generate_email_on_conf_updates(conference, user, conference.email_settings.call_for_papers_dates_updated_body))
conference.email_settings.cfp_dates_updated_subject,
conference.email_settings.generate_email_on_conf_updates(conference, user, conference.email_settings.cfp_dates_updated_body))
end
end

View file

@ -39,7 +39,7 @@ class Ability
end
# Can view the schedule
can [:schedule], Conference do |conference|
conference.call_for_paper && conference.call_for_paper.schedule_public
conference.program.cfp && conference.program.schedule_public
end
can :show, Event do |event|
@ -53,9 +53,13 @@ class Ability
can [:show, :create], Registration do |registration|
registration.new_record?
end
can [:show, :create], Event do |event|
can :show, Event do |event|
event.new_record?
end
can [:new, :create], Event do |event|
event.program.cfp_open? && event.new_record?
end
end
end
@ -77,7 +81,7 @@ class Ability
event.users.include?(user)
end
# can create an event until the last day of a conference
can :create, Event, conference_id: Conference.where('end_date >= ?', Date.today).pluck(:id)
can :create, Event, program_id: Conference.where('end_date >= ?', Date.today).map { |conference| conference.program.id}.compact
# can manage the commercials of their own events
can :manage, Commercial, commercialable_type: 'Event', commercialable_id: user.events.pluck(:id)
@ -100,6 +104,12 @@ class Ability
cannot [:edit, :update, :destroy], Question, global: true
# for admins
can :manage, :all if user.is_admin
cannot :destroy, Program
# Do not delete venue, when there are rooms being used
cannot :destroy, Venue do |venue|
venue.conference.program.events.where.not(room_id: nil).any?
end
end
def signed_in_with_organizer_role(user)
@ -125,21 +135,22 @@ class Ability
end
can :manage, Vposition, conference_id: conf_ids_for_organizer
can :manage, Vday, conference_id: conf_ids_for_organizer
can :manage, CallForPaper, conference_id: conf_ids_for_organizer
can :manage, Event, conference_id: conf_ids_for_organizer
can :manage, EventType, conference_id: conf_ids_for_organizer
can :manage, Track, conference_id: conf_ids_for_organizer
can :manage, DifficultyLevel, conference_id: conf_ids_for_organizer
can :manage, Program, conference_id: conf_ids_for_organizer
can :manage, Cfp, program: { conference_id: conf_ids_for_organizer}
can :manage, Event, program: { conference_id: conf_ids_for_organizer}
can :manage, EventType, program: { conference_id: conf_ids_for_organizer}
can :manage, Track, program: { conference_id: conf_ids_for_organizer}
can :manage, DifficultyLevel, program: { conference_id: conf_ids_for_organizer}
can :manage, Commercial, commercialable_type: 'Event',
commercialable_id: Event.where(conference_id: conf_ids_for_organizer).pluck(:id)
commercialable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
can :manage, Venue, conference_id: conf_ids_for_organizer
can :manage, Lodging, conference_id: conf_ids_for_organizer
can :manage, Room, conference_id: conf_ids_for_organizer
can :manage, Room, venue: { conference_id: conf_ids_for_organizer}
can :manage, Sponsor, conference_id: conf_ids_for_organizer
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
can :manage, Ticket, conference_id: conf_ids_for_organizer
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(conference_id: conf_ids_for_organizer).pluck(:id)
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
end
def signed_in_with_cfp_role(user)
@ -148,18 +159,19 @@ class Ability
conf_ids_for_cfp =
Conference.with_role(:cfp, user).pluck(:id) if user.has_role? :cfp, :any
can :manage, Event, conference_id: conf_ids_for_cfp
can :manage, EventType, conference_id: conf_ids_for_cfp
can :manage, Track, conference_id: conf_ids_for_cfp
can :manage, DifficultyLevel, conference_id: conf_ids_for_cfp
can :manage, Event, program: { conference_id: conf_ids_for_cfp }
can :manage, EventType, program: { conference_id: conf_ids_for_cfp }
can :manage, Track, program: { conference_id: conf_ids_for_cfp }
can :manage, DifficultyLevel, program: { conference_id: conf_ids_for_cfp }
can :manage, EmailSettings, conference_id: conf_ids_for_cfp
can :manage, Room, conference_id: conf_ids_for_cfp
can :index, Venue, conference_id: conf_ids_for_cfp
can :manage, CallForPaper, conference_id: conf_ids_for_cfp
can :manage, Room, venue: { conference_id: conf_ids_for_cfp }
can :show, Venue, conference_id: conf_ids_for_cfp
can :manage, Cfp, program: { conference_id: conf_ids_for_cfp }
can :manage, Program, conference_id: conf_ids_for_cfp
can :manage, Commercial, commercialable_type: 'Event',
commercialable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
commercialable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
end
def signed_in_with_info_desk_role(user)

113
app/models/ahoy/program.rb Normal file
View file

@ -0,0 +1,113 @@
# cannot delete program if there are events submitted
class Program < ActiveRecord::Base
belongs_to :conference
has_one :cfp, dependent: :destroy
has_many :event_types, dependent: :destroy
has_many :tracks, dependent: :destroy
has_many :difficulty_levels, dependent: :destroy
has_many :rooms, dependent: :destroy
has_many :events, dependent: :destroy do
def workshops
where(require_registration: true, state: :confirmed)
end
def confirmed
where(state: :confirmed)
end
def scheduled
where.not(start_time: nil)
end
def highlights
where(state: :confirmed, is_highlight: true)
end
end
has_many :event_users, through: :events
has_many :speakers, -> { distinct }, through: :event_users, source: :user do
def confirmed
joins(:events).where(events: { state: :confirmed })
end
end
accepts_nested_attributes_for :event_types, allow_destroy: true
accepts_nested_attributes_for :tracks, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
accepts_nested_attributes_for :difficulty_levels, allow_destroy: true
accepts_nested_attributes_for :rooms, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
# validates :conference_id, presence: true, uniqueness: true
validates :rating, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 10 }
before_create :create_event_types
before_create :create_difficulty_levels
##
# Checcks if the program has rating enabled
#
# ====Returns
# * +false+ -> If rating is not enabled
# * +true+ -> If rating is enabled
def rating_enabled?
self.rating && self.rating > 0
end
##
# Checks if the call for papers for the conference is currently open
#
# ====Returns
# * +false+ -> If the CFP is not set or today isn't in the CFP period.
# * +true+ -> If today is in the CFP period.
def cfp_open?
cfp = self.cfp
cfp.present? && (cfp.start_date..cfp.end_date).cover?(Date.current)
end
##
# Checks whether cfp dates is updated
#
# ====Returns
# * +True+ -> If cfp dates is updated and all other parameters are set
# * +False+ -> Either cfp date is not updated or one or more parameter is not set
def notify_on_schedule_public?
self.cfp && !self.cfp.end_date.blank? && !self.cfp.start_date.blank?\
&& (self.cfp.start_date_changed? || self.cfp.end_date_changed?)\
&& self.conference.email_settings.send_on_cfp_dates_updates\
&& !self.conference.email_settings.cfp_dates_updates_subject.blank?\
&& !self.conference.email_settings.cfp_dates_updates_template.blank?
end
private
##
# Creates default EventTypes for this Conference. Used as before_create.
#
def create_event_types
event_types << EventType.create(title: 'Talk', length: 30, color: '#FF0000', description: 'Presentation in lecture format',
minimum_abstract_length: 0,
maximum_abstract_length: 500)
event_types << EventType.create(title: 'Workshop', length: 60, color: '#0000FF', description: 'Interactive hands-on practice',
minimum_abstract_length: 0,
maximum_abstract_length: 500)
true
end
##
# Creates default DifficultyLevels for this Conference. Used as before_create.
#
def create_difficulty_levels
difficulty_levels << DifficultyLevel.create(title: 'Easy',
description: 'Events are understandable for everyone without knowledge of the topic.',
color: '#70EF69')
difficulty_levels << DifficultyLevel.create(title: 'Medium',
description: 'Events require a basic understanding of the topic.',
color: '#EEEF69')
difficulty_levels << DifficultyLevel.create(title: 'Hard',
description: 'Events require expert knowledge of the topic.',
color: '#EF6E69')
true
end
end

71
app/models/cfp.rb Normal file
View file

@ -0,0 +1,71 @@
# cannot delete program if there are events submitted
class Cfp < ActiveRecord::Base
belongs_to :program
validates :program_id, presence: true, uniqueness: true
validates :start_date, :end_date, presence: true
validate :before_end_of_conference
validate :start_after_end_date
##
# Checks whether cfp date is updated
#
# ====Returns
# * +True+ -> If cfp dates is updated and all other parameters are set
# * +False+ -> Either cfp date is not updated or one or more parameter is not set
def notify_on_cfp_date_update?
!self.end_date.blank? && !self.start_date.blank?\
&& (self.start_date_changed? || self.end_date_changed?)\
&& self.program.conference.email_settings.send_on_cfp_dates_updated\
&& !self.program.conference.email_settings.cfp_dates_updated_subject.blank?\
&& !self.program.conference.email_settings.cfp_dates_updated_body.blank?
end
##
# Calculates how many weeks the call for paper is.
#
# ====Returns
# * +Integer+ -> start week
def weeks
result = end_week - start_week + 1
weeks = Date.new(start_date.year, 12, 31).strftime('%W').to_i
result < 0 ? result + weeks : result
end
##
# Calculates the end week of the cfp
#
# ====Returns
def start_week
start_date.strftime('%W').to_i
end
##
# Calculates the end week of the cfp
#
# ====Returns
def end_week
end_date.strftime('%W').to_i
end
def remaining_days(date = Date.today)
result = (self.end_date - date).to_i
result > 0 ? result : 0
end
private
def before_end_of_conference
errors.
add(:end_date, "can't be after the conference end date (#{program.conference.end_date})") if program.conference && program.conference.end_date && end_date && (end_date > program.conference.end_date)
errors.
add(:start_date, "can't be after the conference end date (#{program.conference.end_date})") if program.conference && program.conference.end_date && start_date && (start_date > program.conference.end_date)
end
def start_after_end_date
errors.
add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date
end
end

View file

@ -1,6 +1,5 @@
##
# This class represents a conference
# rubocop:disable Style/ClassLength
class Conference < ActiveRecord::Base
require 'uri'
serialize :events_per_week, Hash
@ -16,40 +15,14 @@ class Conference < ActiveRecord::Base
has_one :contact, dependent: :destroy
has_one :registration_period, dependent: :destroy
has_one :email_settings, dependent: :destroy
has_one :call_for_paper, dependent: :destroy
has_one :program, dependent: :destroy
has_one :venue, dependent: :destroy
has_many :social_events, dependent: :destroy
has_many :ticket_purchases, dependent: :destroy
has_many :supporters, through: :ticket_purchases, source: :user
has_many :tickets, dependent: :destroy
has_many :dietary_choices, dependent: :destroy
has_many :events, dependent: :destroy do
def workshops
where(require_registration: true, state: :confirmed)
end
def confirmed
where(state: :confirmed)
end
def scheduled
where.not(start_time: nil)
end
def highlights
where(state: :confirmed, is_highlight: true)
end
end
has_many :event_users, through: :events
has_many :speakers, -> { distinct }, through: :event_users, source: :user do
def confirmed
joins(:events).where(events: { state: :confirmed })
end
end
has_many :event_types, dependent: :destroy
has_many :tracks, dependent: :destroy
has_many :difficulty_levels, dependent: :destroy
has_many :rooms, dependent: :destroy
has_many :lodgings, dependent: :destroy
has_many :registrations, dependent: :destroy
has_many :participants, through: :registrations, source: :user
@ -63,16 +36,12 @@ class Conference < ActiveRecord::Base
has_many :commercials, as: :commercialable, dependent: :destroy
has_many :subscriptions, dependent: :destroy
accepts_nested_attributes_for :rooms, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
accepts_nested_attributes_for :tracks, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
accepts_nested_attributes_for :difficulty_levels, allow_destroy: true
accepts_nested_attributes_for :social_events, allow_destroy: true
accepts_nested_attributes_for :venue
accepts_nested_attributes_for :dietary_choices, allow_destroy: true
accepts_nested_attributes_for :tickets, allow_destroy: true
accepts_nested_attributes_for :sponsorship_levels, allow_destroy: true
accepts_nested_attributes_for :sponsors, allow_destroy: true
accepts_nested_attributes_for :event_types, allow_destroy: true
accepts_nested_attributes_for :email_settings
accepts_nested_attributes_for :questions, allow_destroy: true
accepts_nested_attributes_for :vdays, allow_destroy: true
@ -95,14 +64,13 @@ class Conference < ActiveRecord::Base
validates_uniqueness_of :short_title
validates_format_of :short_title, with: /\A[a-zA-Z0-9_-]*\z/
validates :registration_limit, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
# This validation is needed since a conference with a start date greater than the end date is not possible
validate :valid_date_range?
before_create :generate_guid
before_create :create_event_types
before_create :create_difficulty_levels
before_create :create_email_settings
before_create :add_color
before_create :create_email_settings
def date_range_string
startstr = 'Unknown - '
@ -158,18 +126,6 @@ class Conference < ActiveRecord::Base
registration_period.end_date.present?
end
##
# Checks if the call for papers for the conference is currently open
#
# ====Returns
# * +false+ -> If the CFP is not set or today isn't in the CFP period.
# * +true+ -> If today is in the CFP period.
def cfp_open?
cfp = self.call_for_paper
cfp.present? && (cfp.start_date..cfp.end_date).cover?(Date.current)
end
##
# Returns an array with the summarized event submissions per week.
#
@ -178,10 +134,10 @@ class Conference < ActiveRecord::Base
def get_submissions_per_week
result = []
if call_for_paper && events
submissions = events.group(:week).count
start_week = call_for_paper.start_week
weeks = call_for_paper.weeks
if program && program.cfp && program.events
submissions = program.events.group(:week).count
start_week = program.cfp.start_week
weeks = program.cfp.weeks
result = calculate_items_per_week(start_week, weeks, submissions)
end
result
@ -195,10 +151,10 @@ class Conference < ActiveRecord::Base
# * +Array+ -> e.g. 'Submitted' => [0, 3, 3, 5] -> first week 0 events, second week 3 events.
def get_submissions_data
result = {}
if call_for_paper && events
if program && program.cfp && program.events
result = get_events_per_week_by_state
start_week = call_for_paper.start_week
start_week = program.cfp.start_week
end_week = end_date.strftime('%W').to_i
weeks = weeks(start_week, end_week)
@ -260,8 +216,8 @@ class Conference < ActiveRecord::Base
# ====Returns
# * +Integer+ -> weeks
def cfp_weeks
if call_for_paper
call_for_paper.weeks
if program
program.cfp.weeks
else
0
end
@ -344,7 +300,7 @@ class Conference < ActiveRecord::Base
# * +hash+ -> user: submissions
def get_top_submitter(limit = 5)
submitter = EventUser.joins(:event).
where('event_role = ? and conference_id = ?', 'submitter', id).
where('event_role = ? and program_id = ?', 'submitter', Conference.find(id).program.id).
limit(limit).group(:user_id)
counter = submitter.order('count_all desc').count
Conference.calculate_user_submission_hash(submitter, counter)
@ -366,7 +322,7 @@ class Conference < ActiveRecord::Base
# ====Returns
# * +hash+ -> hash
def event_distribution
Conference.calculate_event_distribution_hash(events.select(:state).group(:state).count)
Conference.calculate_event_distribution_hash(program.events.select(:state).group(:state).count)
end
##
@ -391,7 +347,7 @@ class Conference < ActiveRecord::Base
# ====Returns
# * +hash+ -> Fixnum minutes
def current_program_minutes
events_grouped = events.select(:event_type_id).group(:event_type_id)
events_grouped = program.events.select(:event_type_id).group(:event_type_id)
events_counted = events_grouped.count
calculate_program_minutes(events_grouped, events_counted)
end
@ -411,7 +367,7 @@ class Conference < ActiveRecord::Base
# ====Returns
# * +hash+ -> Fixnum minutes
def new_program_minutes(date)
events_grouped = events.select(:event_type_id).where('created_at > ?', date).group(:event_type_id)
events_grouped = program.events.select(:event_type_id).where('created_at > ?', date).group(:event_type_id)
events_counted = events_grouped.count
calculate_program_minutes(events_grouped, events_counted)
end
@ -450,9 +406,9 @@ class Conference < ActiveRecord::Base
# * +hash+ -> track => {color, value}
def tracks_distribution(state = nil)
if state
tracks_grouped = events.select(:track_id).where('state = ?', state).group(:track_id)
tracks_grouped = program.events.select(:track_id).where('state = ?', state).group(:track_id)
else
tracks_grouped = events.select(:track_id).group(:track_id)
tracks_grouped = program.events.select(:track_id).group(:track_id)
end
tracks_counted = tracks_grouped.count
@ -539,7 +495,7 @@ class Conference < ActiveRecord::Base
Conference.where('end_date > ?', Date.today).each do |conference|
result = {}
Event.state_machine.states.each do |state|
count = conference.events.where('state = ?', state.name).count
count = conference.program.events.where('state = ?', state.name).count
result[state.name] = count
end
@ -580,10 +536,15 @@ class Conference < ActiveRecord::Base
email_settings.conference_registration_dates_updated_body
end
def registration_limit_exceeded?
registration_limit > 0 && registrations.count >= registration_limit
end
private
after_create do
self.create_contact
self.create_program
end
##
@ -631,10 +592,10 @@ class Conference < ActiveRecord::Base
# Actual week
this_week = Date.today.end_of_week.strftime('%W').to_i
result['Confirmed'][this_week] = events.where('state = ?', :confirmed).count
result['Unconfirmed'][this_week] = events.where('state = ?', :unconfirmed).count
result['Submitted'] = events.select(:week).group(:week).count
result['Submitted'][this_week] = events.where(week: this_week).count
result['Confirmed'][this_week] = program.events.where('state = ?', :confirmed).count
result['Unconfirmed'][this_week] = program.events.where('state = ?', :unconfirmed).count
result['Submitted'] = program.events.select(:week).group(:week).count
result['Submitted'][this_week] = program.events.where(week: this_week).count
result
end
@ -720,7 +681,7 @@ class Conference < ActiveRecord::Base
# * +True+ -> One difficulty level or more
# * +False+ -> No diffculty level
def difficulty_levels_set?
difficulty_levels.count > 0
program.difficulty_levels.count > 0
end
##
@ -730,7 +691,7 @@ class Conference < ActiveRecord::Base
# * +True+ -> One difficulty level or more
# * +False+ -> No diffculty level
def event_types_set?
event_types.count > 0
program.event_types.count > 0
end
##
@ -740,7 +701,7 @@ class Conference < ActiveRecord::Base
# * +True+ -> One track or more
# * +False+ -> No track
def tracks_set?
tracks.count > 0
program.tracks.count > 0
end
##
@ -750,7 +711,7 @@ class Conference < ActiveRecord::Base
# * +True+ -> One room or more
# * +False+ -> No room
def rooms_set?
rooms.count > 0
venue.present? && venue.rooms.count > 0
end
# Checks if the conference has a venue object.
@ -769,7 +730,7 @@ class Conference < ActiveRecord::Base
# * +True+ -> If conference has a cfp object.
# * +False+ -> If conference has no cfp object.
def cfp_set?
!!call_for_paper
!!program.cfp
end
##
@ -788,9 +749,9 @@ class Conference < ActiveRecord::Base
# * +hash+ -> object_type => {color, value}
def calculate_event_distribution(group_by_id, association_symbol, state = nil)
if state
grouped = events.select(group_by_id).where('state = ?', 'confirmed').group(group_by_id)
grouped = program.events.select(group_by_id).where('state = ?', 'confirmed').group(group_by_id)
else
grouped = events.select(group_by_id).group(group_by_id)
grouped = program.events.select(group_by_id).group(group_by_id)
end
counted = grouped.count
@ -910,35 +871,6 @@ class Conference < ActiveRecord::Base
result
end
##
# Creates default EventTypes for this Conference. Used as before_create.
#
def create_event_types
event_types << EventType.create(title: 'Talk', length: 30, color: '#FF0000', description: 'Presentation in lecture format',
minimum_abstract_length: 0,
maximum_abstract_length: 500)
event_types << EventType.create(title: 'Workshop', length: 60, color: '#0000FF', description: 'Interactive hands-on practice',
minimum_abstract_length: 0,
maximum_abstract_length: 500)
true
end
##
# Creates default DifficultyLevels for this Conference. Used as before_create.
#
def create_difficulty_levels
difficulty_levels << DifficultyLevel.create(title: 'Easy',
description: 'Events are understandable for everyone without knowledge of the topic.',
color: '#70EF69')
difficulty_levels << DifficultyLevel.create(title: 'Medium',
description: 'Events require a basic understanding of the topic.',
color: '#EEEF69')
difficulty_levels << DifficultyLevel.create(title: 'Hard',
description: 'Events require expert knowledge of the topic.',
color: '#EF6E69')
true
end
##
# Creates a EmailSettings association proxy. Used as before_create.
#

View file

@ -1,5 +1,5 @@
class DifficultyLevel < ActiveRecord::Base
belongs_to :conference
belongs_to :program
has_many :events, dependent: :nullify
validates :title, presence: true

View file

@ -15,9 +15,9 @@ class EmailSettings < ActiveRecord::Base
conference.short_title, host: CONFIG['url_for_emails'])
}
if conference.call_for_paper
h['cfp_start_date'] = conference.call_for_paper.start_date
h['cfp_end_date'] = conference.call_for_paper.end_date
if conference.program.cfp
h['cfp_start_date'] = conference.program.cfp.start_date
h['cfp_end_date'] = conference.program.cfp.end_date
else
h['cfp_start_date'] = 'Unknown'
h['cfp_end_date'] = 'Unknown'

View file

@ -19,7 +19,7 @@ class Event < ActiveRecord::Base
belongs_to :track
belongs_to :room
belongs_to :difficulty_level
belongs_to :conference
belongs_to :program
accepts_nested_attributes_for :event_users, allow_destroy: true
accepts_nested_attributes_for :users
@ -31,7 +31,7 @@ class Event < ActiveRecord::Base
validates :title, presence: true
validates :abstract, presence: true
validates :event_type, presence: true
validates :conference, presence: true
validates :program, presence: true
scope :confirmed, -> { where(state: 'confirmed') }
scope :highlighted, -> { where(is_highlight: true) }
@ -108,19 +108,19 @@ class Event < ActiveRecord::Base
end
def process_confirmation
if conference.email_settings.send_on_confirmed_without_registration? &&
conference.email_settings.confirmed_without_registration_body &&
conference.email_settings.confirmed_without_registration_subject
if conference.registrations.where(user_id: submitter.id).first.nil?
if program.conference.email_settings.send_on_confirmed_without_registration? &&
program.conference.email_settings.confirmed_without_registration_body &&
program.conference.email_settings.confirmed_without_registration_subject
if program.conference.registrations.where(user_id: submitter.id).first.nil?
Mailbot.delay.confirm_reminder_mail(self)
end
end
end
def process_acceptance(options)
if conference.email_settings.send_on_accepted &&
conference.email_settings.accepted_body &&
conference.email_settings.accepted_subject &&
if program.conference.email_settings.send_on_accepted &&
program.conference.email_settings.accepted_body &&
program.conference.email_settings.accepted_subject &&
!options[:send_mail].blank?
Rails.logger.debug 'Sending event acceptance mail'
Mailbot.delay.acceptance_mail(self)
@ -128,9 +128,9 @@ class Event < ActiveRecord::Base
end
def process_rejection(options)
if conference.email_settings.send_on_rejected &&
conference.email_settings.rejected_body &&
conference.email_settings.rejected_subject &&
if program.conference.email_settings.send_on_rejected &&
program.conference.email_settings.rejected_body &&
program.conference.email_settings.rejected_subject &&
!options[:send_mail].blank?
Rails.logger.debug 'Sending rejected mail'
Mailbot.delay.rejection_mail(self)
@ -190,7 +190,7 @@ class Event < ActiveRecord::Base
# Returns +Hash+
def progress_status
{
registered: self.conference.user_registered?(self.submitter),
registered: self.program.conference.user_registered?(self.submitter),
commercials: self.commercials.any?,
biography: !self.submitter.biography.blank?,
subtitle: !self.subtitle.blank?,
@ -241,7 +241,7 @@ class Event < ActiveRecord::Base
def before_end_of_conference
errors.
add(:created_at, "can't be after the conference end date!") if conference.end_date &&
(Date.today > conference.end_date)
add(:created_at, "can't be after the conference end date!") if program.conference && program.conference.end_date &&
(Date.today > program.conference.end_date)
end
end

View file

@ -1,5 +1,5 @@
class EventType < ActiveRecord::Base
belongs_to :conference
belongs_to :program
has_many :events, dependent: :restrict_with_error
validates :title, presence: true

97
app/models/program.rb Normal file
View file

@ -0,0 +1,97 @@
# cannot delete program if there are events submitted
class Program < ActiveRecord::Base
belongs_to :conference
has_one :cfp, dependent: :destroy
has_many :event_types, dependent: :destroy
has_many :tracks, dependent: :destroy
has_many :difficulty_levels, dependent: :destroy
has_many :events, dependent: :destroy do
def workshops
where(require_registration: true, state: :confirmed)
end
def confirmed
where(state: :confirmed)
end
def scheduled
where.not(start_time: nil)
end
def highlights
where(state: :confirmed, is_highlight: true)
end
end
has_many :event_users, through: :events
has_many :speakers, -> { distinct }, through: :event_users, source: :user do
def confirmed
joins(:events).where(events: { state: :confirmed })
end
end
accepts_nested_attributes_for :event_types, allow_destroy: true
accepts_nested_attributes_for :tracks, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
accepts_nested_attributes_for :difficulty_levels, allow_destroy: true
# validates :conference_id, presence: true, uniqueness: true
validates :rating, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 10 }
before_create :create_event_types
before_create :create_difficulty_levels
##
# Checcks if the program has rating enabled
#
# ====Returns
# * +false+ -> If rating is not enabled
# * +true+ -> If rating is enabled
def rating_enabled?
self.rating && self.rating > 0
end
##
# Checks if the call for papers for the conference is currently open
#
# ====Returns
# * +false+ -> If the CFP is not set or today isn't in the CFP period.
# * +true+ -> If today is in the CFP period.
def cfp_open?
cfp = self.cfp
cfp.present? && (cfp.start_date..cfp.end_date).cover?(Date.current)
end
private
##
# Creates default EventTypes for this Conference. Used as before_create.
#
def create_event_types
event_types << EventType.create(title: 'Talk', length: 30, color: '#FF0000', description: 'Presentation in lecture format',
minimum_abstract_length: 0,
maximum_abstract_length: 500)
event_types << EventType.create(title: 'Workshop', length: 60, color: '#0000FF', description: 'Interactive hands-on practice',
minimum_abstract_length: 0,
maximum_abstract_length: 500)
true
end
##
# Creates default DifficultyLevels for this Conference. Used as before_create.
#
def create_difficulty_levels
difficulty_levels << DifficultyLevel.create(title: 'Easy',
description: 'Events are understandable for everyone without knowledge of the topic.',
color: '#70EF69')
difficulty_levels << DifficultyLevel.create(title: 'Medium',
description: 'Events require a basic understanding of the topic.',
color: '#EEEF69')
difficulty_levels << DifficultyLevel.create(title: 'Hard',
description: 'Events require expert knowledge of the topic.',
color: '#EF6E69')
true
end
end

View file

@ -26,6 +26,7 @@ class Registration < ActiveRecord::Base
validates :user, presence: true
validates_uniqueness_of :user_id, scope: :conference_id, message: 'already Registered!'
validate :registration_limit_not_exceed, on: :create
after_create :set_week, :subscribe_to_conference, :send_registration_mail
@ -49,4 +50,10 @@ class Registration < ActiveRecord::Base
self.week = created_at.strftime('%W')
save!
end
def registration_limit_not_exceed
if conference.registration_limit > 0 && conference.registrations(:reload).count >= conference.registration_limit
errors.add(:base, 'Registration limit exceeded')
end
end
end

View file

@ -1,5 +1,22 @@
class RegistrationPeriod < ActiveRecord::Base
validates :start_date, :end_date, presence: true
belongs_to :conference
validates :start_date, :end_date, presence: true
validate :before_end_of_conference
validate :start_date_before_end_date
private
def before_end_of_conference
errors.
add(:start_date, "can't be after the conference end date (#{conference.end_date})") if conference && conference.end_date && start_date && (start_date > conference.end_date)
errors.
add(:end_date, "can't be after the conference end date (#{conference.end_date})") if conference && conference.end_date && end_date && (end_date > conference.end_date)
end
def start_date_before_end_date
errors.
add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date
end
end

View file

@ -1,10 +1,10 @@
class Room < ActiveRecord::Base
belongs_to :conference
belongs_to :venue
has_many :events, dependent: :nullify
before_create :generate_guid
validates :name, presence: true
validates :name, :venue_id, presence: true
validates :size, numericality: { only_integer: true, greater_than: 0 }, allow_nil: true

View file

@ -29,7 +29,7 @@ class Target < ActiveRecord::Base
numerator =
case unit
when Target.units[:submissions]
conference.events.where('created_at < ?', due_date).count
conference.program.events.where('created_at < ?', due_date).count
when Target.units[:registrations]
conference.registrations.where('created_at < ?', due_date).count
when Target.units[:program_minutes]

View file

@ -1,5 +1,5 @@
class Track < ActiveRecord::Base
belongs_to :conference
belongs_to :program
has_many :events, dependent: :nullify
before_create :generate_guid

View file

@ -177,7 +177,7 @@ class User < ActiveRecord::Base
end
def proposals(conference)
events.where('conference_id = ? AND event_users.event_role=?', conference.id, 'submitter')
events.where('program_id = ? AND event_users.event_role=?', conference.program.id, 'submitter')
end
def proposal_count(conference)

View file

@ -1,9 +1,10 @@
class Venue < ActiveRecord::Base
belongs_to :conference
has_many :lodgings
has_many :rooms, dependent: :destroy
before_create :generate_guid
validates :name, :street, :city, :country, presence: true
validates :conference_id, presence: true, uniqueness: true
has_attached_file :photo,
styles: { thumb: '100x100>', large: '300x300>' }
@ -11,8 +12,6 @@ class Venue < ActiveRecord::Base
content_type: [/jpg/, /jpeg/, /png/, /gif/],
size: { in: 0..500.kilobytes }
accepts_nested_attributes_for :lodgings, allow_destroy: true
after_update :send_mail_notification
def address

View file

@ -1,5 +1,53 @@
class ConferenceSerializer < ActiveModel::Serializer
attributes :guid, :name, :description, :year, :socialtag, :date_range, :url, :revision
attributes :short_title, :title, :description, :start_date, :end_date, :logo,
:difficulty_levels, :event_types, :rooms, :tracks,
:date_range, :revision
def difficulty_levels
object.difficulty_levels.map do |difficulty_level| { id: difficulty_level.id,
title: difficulty_level.title,
description: difficulty_level.description
}
end
end
def event_types
object.event_types.map do |event_type| { id: event_type.id,
title: event_type.title,
length: event_type.length,
description: event_type.description
}
end
end
def rooms
object.rooms.includes(:events).map do |room| { id: room.id,
size: room.size,
events: room.events.map do |event| { guid: event.title,
title: event.title,
subtitle: event.subtitle,
abstract: event.abstract,
description: event.description,
is_highlight: event.is_highlight,
require_registration: event.require_registration,
start_time: event.start_time,
event_type_id: event.event_type.id,
difficulty_level_id: event.difficulty_level_id,
track_id: event.track_id,
speaker_names: event.speaker_names
}
end
}
end
end
def tracks
object.tracks.map do |track| { 'id' => track.id,
'name' => track.name,
'description' => track.description
}
end
end
def name
object.title
@ -17,19 +65,9 @@ class ConferenceSerializer < ActiveModel::Serializer
object.revision || 0
end
# FIXME: adjusting the format the DIRTY way, for oSC13.
# If you think this is ugly, don't look at the methods below
def date_range
object.date_range_string.try(:split, ',').try(:first)
end
# FIXME: just giving suseconferenceclient something to play with
def description
'openSUSE Conference 2013 - Power to the Geeko'
end
# FIXME: same than the former
def url
'https://conference.opensuse.org/'
if defined? object.date_range_string
object.date_range_string.try(:split, ',').try(:first)
end
end
end

View file

@ -0,0 +1,11 @@
.row
.col-md-12
.page-header
%h1 Call for Papers
.row
.col-md-8
= semantic_form_for(@cfp, :url => admin_conference_program_cfp_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
%p.text-right
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -0,0 +1,58 @@
.row
.col-md-12
.page-header
%h1 Call for Papers
%p.text-muted
Call for people to submit events to your conference
- if @cfp
.row
.col-md-8
%dl.dl-horizontal
%dt
Start Date:
%dd#start_date
= @cfp.start_date.strftime('%A, %B %-d. %Y')
%dt
End Date:
%dd#end_date
= @cfp.end_date.strftime('%A, %B %-d. %Y')
%dt
Days Left:
%dd
= pluralize(@cfp.remaining_days, 'day')
%dt
Event types:
%dd
= event_types(@conference)
%dt
Tracks:
%dd
= tracks(@conference)
%dt
Public Schedule
%dd#schedule_public
- if @program.schedule_public
Yes
- else
No
%dt
Schedule changeable?
%dd#schedule_changes
- if @program.schedule_fluid
Yes
- else
No
%dt
Rating Levels
%dd#rating
= @program.rating
.row
.col-md-12.text-right
= link_to(edit_admin_conference_program_cfp_path(@conference.short_title), class: 'btn btn-primary') do
Edit
= link_to(admin_conference_program_cfp_path(@conference.short_title), method: 'delete', class: 'btn btn-danger', data: { confirm: 'Are you sure you want to delete the CfP?' }) do
Delete
-else
.row
.col-md-12.text-right
= link_to 'Create Call for Papers', new_admin_conference_program_cfp_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -5,7 +5,7 @@
.panel-body
- events.each do |event, comments|
.notifications
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%h4.title= link_to event.title, admin_conference_program_event_path(event.program.conference.short_title, event)
%hr
- comments.each do |comment|
%h5.strong Posted by: #{comment.user.name} | Created at: #{comment.created_at}

View file

@ -5,7 +5,7 @@
.panel-body
- events.each do |event, comments|
.notifications
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%h4.title= link_to event.title, admin_conference_program_event_path(event.program.conference.short_title, event)
%hr
- comments.each do |comment|
%h5.strong Created at: #{comment.created_at}

View file

@ -5,7 +5,7 @@
.panel-body
- events.each do |event, comments|
.notifications
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%h4.title= link_to event.title, admin_conference_program_event_path(event.program.conference.short_title, event)
%hr
- comments.each do |comment|
%h5.strong Posted by: #{comment.user.name} | Created at: #{comment.created_at}

View file

@ -16,8 +16,8 @@
%td= link_to event.submitter.name, admin_user_path(event.submitter.id)
- else
%td Unknown Submitter
%td= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%td= link_to event.conference.title, admin_conference_path(event.conference.short_title)
%td= link_to event.title, admin_conference_program_event_path(event.program.conference.short_title, event)
%td= link_to event.program.conference.title, admin_conference_path(event.program.conference.short_title)
%td
.span{'class'=>label_for(event.state)} #{event.state.humanize}
- else

View file

@ -17,8 +17,8 @@
Set up registration period
%li{'class'=>"list-group-item #{class_for_todo(conference_progress['cfp'])}"}
%span{'class'=>icon_for_todo(conference_progress['cfp'])}
- if can? :update, CallForPaper.new(conference_id: @conference.id)
= link_to 'Set up call for papers', admin_conference_call_for_paper_path(conference_progress['short_title'])
- if can? :update, Cfp.new(program_id: @program.id)
= link_to 'Set up call for papers', admin_conference_program_cfp_path(conference_progress['short_title'])
- else
Set up call for papers
%li{'class'=>"list-group-item #{class_for_todo(conference_progress['venue'])}"}
@ -32,26 +32,26 @@
Add venue
%li{'class'=>"list-group-item #{class_for_todo(conference_progress['rooms'])}"}
%span{'class'=>icon_for_todo(conference_progress['rooms'])}
- if can? :update, @conference.rooms.build
= link_to 'Add rooms', admin_conference_rooms_path(conference_progress['short_title'])
- if @conference.venue && (can? :update, @conference.venue.rooms.build)
= link_to 'Add rooms', admin_conference_venue_rooms_path(conference_progress['short_title'])
- else
Add rooms
%li{'class'=>"list-group-item #{class_for_todo(conference_progress['tracks'])}"}
%span{'class'=>icon_for_todo(conference_progress['tracks'])}
- if can? :update, @conference.tracks.build
= link_to 'Add tracks', admin_conference_tracks_path(conference_progress['short_title'])
- if can? :update, @conference.program.tracks.build
= link_to 'Add tracks', admin_conference_program_tracks_path(conference_progress['short_title'])
- else
Add tracks
%li{'class'=>"list-group-item #{class_for_todo(conference_progress['event_types'])}"}
%span{'class'=>icon_for_todo(conference_progress['event_types'])}
- if can? :update, @conference.event_types.build
= link_to 'Add event types', admin_conference_event_types_path(conference_progress['short_title'])
- if can? :update, @conference.program.event_types.build
= link_to 'Add event types', admin_conference_program_event_types_path(conference_progress['short_title'])
- else
Add event types
%li{'class'=>"list-group-item #{class_for_todo(conference_progress['difficulty_levels'])}"}
%span{'class'=>icon_for_todo(conference_progress['difficulty_levels'])}
- if can? :update, @conference.difficulty_levels.build
= link_to 'Add difficulty levels', admin_conference_difficulty_levels_path(conference_progress['short_title'])
- if can? :update, @conference.program.difficulty_levels.build
= link_to 'Add difficulty levels', admin_conference_program_difficulty_levels_path(conference_progress['short_title'])
- else
Add difficulty levels
%li{class: "list-group-item #{class_for_todo(conference_progress['splashpage'])}"}

View file

@ -18,5 +18,6 @@
= f.input :timezone, :as => :time_zone, :hint => "The conference time zone"
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
= f.inputs name: "Registrations" do
= f.input :registration_limit, as: :number, in: 0..9999, hint: "Limit the number of registrations to the conference (0 no limit)"
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -8,7 +8,7 @@
= @difficulty_level.title
.row
.col-md-8
= semantic_form_for(@difficulty_level, :url => (@difficulty_level.new_record? ? admin_conference_difficulty_levels_path : admin_conference_difficulty_level_path(@conference.short_title, @difficulty_level))) do |f|
= semantic_form_for(@difficulty_level, :url => (@difficulty_level.new_record? ? admin_conference_program_difficulty_levels_path : admin_conference_program_difficulty_level_path(@conference.short_title, @difficulty_level))) do |f|
= f.input :title, :required => true
= f.input :description, :input_html => {:rows => 3, :class => "span6"}
= f.input :color, :input_html => {:size => 6, :type => "color"}

View file

@ -3,7 +3,7 @@
.page-header
%h1 Difficulty Levels
%p.text-muted
Classify your conference events by difficulty
Classify your conference.program.events by difficulty
.row
.col-md-12
%table.table.table-hover#difficulty_levels
@ -13,7 +13,7 @@
%th Color
%th Actions
%tbody
- @conference.difficulty_levels.each do |difficulty_level|
- @conference.program.difficulty_levels.each do |difficulty_level|
%tr
%td
= difficulty_level.title
@ -24,11 +24,11 @@
= difficulty_level.color
%td
.btn-group{role: "group"}
= link_to 'Edit', edit_admin_conference_difficulty_level_path(@conference.short_title, difficulty_level.id),
= link_to 'Edit', edit_admin_conference_program_difficulty_level_path(@conference.short_title, difficulty_level.id),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_difficulty_level_path(@conference.short_title, difficulty_level.id),
= link_to 'Delete', admin_conference_program_difficulty_level_path(@conference.short_title, difficulty_level.id),
method: :delete, class: 'btn btn-danger',
data: { confirm: "Do you really want to delete #{difficulty_level.title}? Attention: This difficulty level will be removed from all Events that have it set" }
.row
.col-md-12.text-right
= link_to 'Add Difficulty Level', new_admin_conference_difficulty_level_path(@conference.short_title), class: 'btn btn-primary'
= link_to 'Add Difficulty Level', new_admin_conference_program_difficulty_level_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -41,14 +41,14 @@
%tr
%td {venue_address}
%td The address of the venue
- unless @conference.call_for_paper.blank? || @conference.call_for_paper.start_date.blank? || @conference.call_for_paper.end_date.blank?
- unless @conference.program.cfp.blank? || @conference.program.cfp.start_date.blank? || @conference.program.cfp.end_date.blank?
%tr
%td {cfp_start_date}
%td The call for papers start date
%tr
%td {cfp_end_date}
%td The call for papers end date
-if @conference.call_for_paper.schedule_public
-if @conference.program.schedule_public
%td {schedule_link}
%td The link to complete schedule of the conference
- if @conference.splashpage && @conference.splashpage.public

View file

@ -69,18 +69,18 @@
%a.btn.btn-link.control_label.template_help_link{"data-name"=>"updated_venue_help"} Show Help
= render partial: 'help', locals: {id: 'updated_venue_help', show_event_variables: false}
#cfp.tab-pane{:role => "tabpanel"}
= f.input :send_on_call_for_papers_schedule_public, hint: "This will notify all participants when the dates are updated or when the schedule is made public"
= f.input :call_for_papers_schedule_public_subject, hint: "This subject will used whenever dates are updated or when the schedule is made public"
= f.input :call_for_papers_schedule_public_body, :input_html => { :rows => 10, :cols => 20 }
= f.input :send_on_program_schedule_public, hint: "This will notify all participants when the dates are updated or when the schedule is made public"
= f.input :program_schedule_public_subject, hint: "This subject will used whenever dates are updated or when the schedule is made public"
= f.input :program_schedule_public_body, :input_html => { :rows => 10, :cols => 20 }
%a.btn.btn-link.control_label.load_template{"data-template"=>"Dear {name},\n\nThe Conference Call for Papers Details of {conference} has changed.The schedule is being made public.\n Link to Schedule {schedule_link} \n\nBest wishes\n\n{conference} Team",
"data-name"=>"email_settings_call_for_papers_schedule_public_body"} Load Template
"data-name"=>"email_settings_program_schedule_public_body"} Load Template
%a.btn.btn-link.control_label.template_help_link{"data-name"=>"updated_cfp_help"} Show Help
= render partial: 'help', locals: {id: 'updated_cfp_help', show_event_variables: false}
= f.input :send_on_call_for_papers_dates_updated, hint: "This will notify all participants when the dates are updated or when the schedule is made public"
= f.input :call_for_papers_dates_updated_subject, hint: "This subject will used whenever dates are updated or when the schedule is made public"
= f.input :call_for_papers_dates_updated_body, :input_html => { :rows => 10, :cols => 20 }
= f.input :send_on_cfp_dates_updated, hint: "This will notify all participants when the dates are updated or when the schedule is made public"
= f.input :cfp_dates_updated_subject, hint: "This subject will used whenever dates are updated or when the schedule is made public"
= f.input :cfp_dates_updated_body, :input_html => { :rows => 10, :cols => 20 }
%a.btn.btn-link.control_label.load_template{"data-template"=>"Dear {name},\n\nThe Conference Call for Papers Details of {conference} has changed.\nNew Dates : {cfp_start_date} - {cfp_end_date}.\n Link to Schedule {schedule_link} \n\nBest wishes\n\n{conference} Team",
"data-name"=>"email_settings_call_for_papers_dates_updated_body"} Load Template
"data-name"=>"email_settings_cfp_dates_updated_body"} Load Template
%a.btn.btn-link.control_label.template_help_link{"data-name"=>"updated_cfp_help"} Show Help
= render partial: 'help', locals: {id: 'updated_cfp_help', show_event_variables: false}
.row

View file

@ -8,7 +8,7 @@
= @event_type.title
.row
.col-md-12
= semantic_form_for(@event_type, :url => (@event_type.new_record? ? admin_conference_event_types_path : admin_conference_event_type_path(@conference.short_title, @event_type))) do |f|
= semantic_form_for(@event_type, :url => (@event_type.new_record? ? admin_conference_program_event_types_path : admin_conference_program_event_type_path(@conference.short_title, @event_type))) do |f|
= f.input :title
= f.input :length, :input_html => {:size => 3}
= f.input :description

View file

@ -15,7 +15,7 @@
%th Color
%th Actions
%tbody
- @conference.event_types.each do |event_type|
- @conference.program.event_types.each do |event_type|
%tr
%td
= event_type.title
@ -32,11 +32,11 @@
= event_type.color
%td
.btn-group{role: "group"}
= link_to 'Edit', edit_admin_conference_event_type_path(@conference.short_title, event_type.id),
= link_to 'Edit', edit_admin_conference_program_event_type_path(@conference.short_title, event_type.id),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_event_type_path(@conference.short_title, event_type.id),
= link_to 'Delete', admin_conference_program_event_type_path(@conference.short_title, event_type.id),
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete #{event_type.name}?" }
.row
.col-md-12.text-right
= link_to 'Add Event Type', new_admin_conference_event_type_path(@conference.short_title), class: 'btn btn-primary'
= link_to 'Add Event Type', new_admin_conference_program_event_type_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -1,37 +1,37 @@
- if event.transition_possible? :accept
%li= link_to 'Accept event',
accept_admin_conference_event_path(@conference.short_title, event),
accept_admin_conference_program_event_path(@conference.short_title, event),
method: :patch, id: "accept_event_#{event.id}"
- if @conference.email_settings.send_on_accepted?
%li= link_to 'Accept event (without email)',
accept_admin_conference_event_path(@conference.short_title, event, send_mail: false),
accept_admin_conference_program_event_path(@conference.short_title, event, send_mail: false),
method: :patch, hint: 'Accept this event without sending an automated email.',
id: "accept_event_without_mail_#{event.id}"
- if event.transition_possible? :reject
%li= link_to 'Reject event',
reject_admin_conference_event_path(@conference.short_title, event),
reject_admin_conference_program_event_path(@conference.short_title, event),
method: :patch, confirm: 'Are you sure?', id: "reject_event_#{event.id}"
- if @conference.email_settings.send_on_rejected?
%li= link_to 'Reject event (without email)',
reject_admin_conference_event_path(@conference.short_title, event, send_mail: false),
reject_admin_conference_program_event_path(@conference.short_title, event, send_mail: false),
method: :patch, confirm: 'Are you sure?', id: "reject_event_without_mail_#{event.id}"
- if event.transition_possible? :restart
%li= link_to 'Start review',
restart_admin_conference_event_path(@conference.short_title, event),
restart_admin_conference_program_event_path(@conference.short_title, event),
method: :patch, id: "restart_event_#{event.id}"
- if event.transition_possible? :confirm
%li= link_to 'Confirm event',
confirm_admin_conference_event_path(@conference.short_title, event),
confirm_admin_conference_program_event_path(@conference.short_title, event),
method: :patch, id: "confirm_event_#{event.id}",
hint: 'Confirm that the speaker(s) will be present and that the event will actually take place.'
- if event.transition_possible? :cancel
%li= link_to 'Cancel event',
cancel_admin_conference_event_path(@conference.short_title, event),
cancel_admin_conference_program_event_path(@conference.short_title, event),
method: :patch, id: "cancel_event_#{event.id}",
hint: 'Mark this event as cancelled. Usually this means that the speakers had to cancel their appearance.'
hint: 'Mark this event as cancelled. Usually this means that the speakers had to cancel their appearance.'

View file

@ -6,7 +6,7 @@
%div
%a.pull-right.comment-reply-link{href: "#"} Reply
.comment-reply
= form_tag "#{comment_admin_conference_event_path(@conference.short_title, comment.commentable_id)}", method: :post do
= form_tag "#{comment_admin_conference_program_event_path(@conference.short_title, comment.commentable_id)}", method: :post do
%input{name: "parent", type: "hidden", value: "#{comment.id}"}
%input{name: "authenticity_token", type: "hidden", value: "#{form_authenticity_token}"}
%textarea{name: "comment"}

View file

@ -5,7 +5,7 @@
%br
%small
= @event.subtitle
= link_to 'Edit', edit_admin_conference_event_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary pull-right'
= link_to 'Edit', edit_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary pull-right'
.row
.col-md-12
@ -24,7 +24,7 @@
%ul.dropdown-menu
- @event_types.each do |type|
%li= link_to type.title,
admin_conference_event_path(@conference.short_title,
admin_conference_program_event_path(@conference.short_title,
@event,
event: { event_type_id: type.id }),
method: :patch
@ -33,7 +33,7 @@
%b Highlight
%td
= check_box_tag @conference.short_title, @event.id, @event.is_highlight,
method: :patch, url: "/admin/conference/#{@conference.short_title}/events/#{@event.id}?event[is_highlight]=",
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}?event[is_highlight]=",
class: 'switch-checkbox', data: { size: 'small',
off_color: 'warning',
on_text: 'Yes',
@ -63,7 +63,7 @@
%ul.dropdown-menu
- @tracks.each do |track|
%li= link_to track.name,
admin_conference_event_path(@conference.short_title,
admin_conference_program_event_path(@conference.short_title,
@event,
event: { track_id: track.id }),
method: :patch
@ -80,7 +80,7 @@
<b class="caret"></b>
%ul.dropdown-menu
- @difficulty_levels.each do |difficulty|
%li= link_to difficulty.title, admin_conference_event_path(@conference.short_title,
%li= link_to difficulty.title, admin_conference_program_event_path(@conference.short_title,
@event,
event: { difficulty_level_id: difficulty.id }),
method: :patch
@ -89,7 +89,7 @@
%b Requires Registration
%td
= check_box_tag @conference.short_title, @event.id, @event.require_registration,
method: :patch, url: "/admin/conference/#{@conference.short_title}/events/#{@event.id}?event[require_registration]=",
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}?event[require_registration]=",
class: 'switch-checkbox', data: { size: 'small',
off_color: 'warning',
on_text: 'Yes',
@ -137,7 +137,7 @@
%b Description
%td= simple_format(@event.description)
- if @conference.call_for_paper && @conference.call_for_paper.rating && @conference.call_for_paper.rating > 0
- if @conference.program && @conference.program.rating && @conference.program.rating > 0
= render partial: 'voting'
.row
@ -147,7 +147,7 @@
%ul.media
%div
.row-fluid
= form_tag(comment_admin_conference_event_path(@conference.short_title, @event.id), method: :post) do
= form_tag(comment_admin_conference_program_event_path(@conference.short_title, @event.id), method: :post) do
= text_area_tag(:comment, '')
= submit_tag 'Add Comment', class: 'btn btn-primary pull-right'
%br

View file

@ -4,11 +4,11 @@
%b Rating
%td
- if @event.average_rating.to_f > 0
#{@event.average_rating}/#{@conference.call_for_paper.rating}
#{@event.average_rating}/#{@conference.program.rating}
- else
Rating: 0/#{@conference.call_for_paper.rating}
Rating: 0/#{@conference.program.rating}
- @conference.call_for_paper.rating.times do |counter|
- @conference.program.rating.times do |counter|
- if @event.average_rating.to_f.round == counter+1
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
@ -27,12 +27,12 @@
%td
%b Your vote
%td
- @conference.call_for_paper.rating.times do |counter|
- @conference.program.rating.times do |counter|
- voted = @event.voted?(@event, current_user)
- if voted && voted.rating == counter+1
= link_to "", vote_admin_conference_event_path(@conference.short_title, @event, :rating => counter+1), :remote => true, :id =>"label#{counter+1}", :class => "myrating", :voted => true
= link_to "", vote_admin_conference_program_event_path(@conference.short_title, @event, :rating => counter+1), :remote => true, :id =>"label#{counter+1}", :class => "myrating", :voted => true
- else
= link_to "", vote_admin_conference_event_path(@conference.short_title, @event, :rating => counter+1), :remote => true, :id =>"label#{counter+1}", :class => "myrating"
= link_to "", vote_admin_conference_program_event_path(@conference.short_title, @event, :rating => counter+1), :remote => true, :id =>"label#{counter+1}", :class => "myrating"
%br
- if @ratings.length > 0
@ -42,7 +42,7 @@
%td
= rate.name
%td
- @conference.call_for_paper.rating.times do |counter|
- @conference.program.rating.times do |counter|
- voted = @event.voted?(@event, rate.user)
- if voted && voted.rating == counter+1
= label_tag "label#{counter+1}", "", :class => "othersrating", :voted => true

View file

@ -15,7 +15,7 @@
%b ID
%th
%b Title
- if @conference.call_for_paper && @conference.call_for_paper.rating && @conference.call_for_paper.rating > 0
- if @program.rating_enabled?
%th
%b Rating
%th
@ -39,16 +39,16 @@
%td
= event.id
%td
=link_to event.title, admin_conference_event_path(@conference.short_title, event)
=link_to event.title, admin_conference_program_event_path(@conference.short_title, event)
- if @conference.call_for_paper && @conference.call_for_paper.rating && @conference.call_for_paper.rating > 0
- if @program.rating_enabled?
%td.col-md-1{'data-order' => "#{event.average_rating}"}
- if event.average_rating.to_f > 0
#{event.average_rating}/#{@conference.call_for_paper.rating}
#{event.average_rating}/#{@program.rating}
%br
#{pluralize(event.voters.length, 'voter')}
%br
- @conference.call_for_paper.rating.times do |counter|
- @program.rating.times do |counter|
- if event.average_rating.to_f.round == counter+1
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
@ -63,7 +63,7 @@
%span.label.label-danger
Not rated
- else
0/#{@conference.call_for_paper.rating}
0/#{@program.rating}
%br
- if event.submitter && event.submitter.registrations && event.submitter.registrations.count < 1
@ -85,7 +85,7 @@
%td{'data-order' => "#{event.require_registration}"}
= check_box_tag @conference.short_title, event.id, event.require_registration,
method: :patch, url: "/admin/conference/#{@conference.short_title}/events/#{event.id}?event[require_registration]=",
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{event.id}?event[require_registration]=",
class: 'switch-checkbox', data: { size: 'small',
off_color: 'warning',
on_text: 'Yes',
@ -93,7 +93,7 @@
%td{'data-order' => "#{event.is_highlight}"}
= check_box_tag @conference.short_title, event.id, event.is_highlight,
method: :patch, url: "/admin/conference/#{@conference.short_title}/events/#{event.id}?event[is_highlight]=",
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{event.id}?event[is_highlight]=",
class: 'switch-checkbox', data: { size: 'small',
off_color: 'warning',
on_text: 'Yes',
@ -110,7 +110,7 @@
%ul.dropdown-menu
- @event_types.each do |type|
%li= link_to type.title,
admin_conference_event_path(@conference.short_title,
admin_conference_program_event_path(@conference.short_title,
event,
event: { event_type_id: type.id }),
method: :patch
@ -125,7 +125,7 @@
%ul.dropdown-menu
- @tracks.each do |track|
%li= link_to track.name,
admin_conference_event_path(@conference.short_title,
admin_conference_program_event_path(@conference.short_title,
event,
event: { track_id: track.id }),
method: :patch
@ -140,7 +140,7 @@
%ul.dropdown-menu
- @difficulty_levels.each do |difficulty_level|
%li= link_to difficulty_level.title,
admin_conference_event_path(@conference.short_title,
admin_conference_program_event_path(@conference.short_title,
event,
event: { difficulty_level_id: difficulty_level.id }),
method: :patch

View file

@ -0,0 +1,12 @@
.row
.col-md-12
.page-header
%h1 Program
.row
.col-md-8
= semantic_form_for(@program, :url => admin_conference_program_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :schedule_public, label: "Show Schedule on the home and splash page"
= f.input :schedule_fluid, label: "Allow submitters to change their event after it is scheduled"
= f.input :rating, :hint => "Enter the number of different rating levels you want to have for voting on proposals. Enter 0 if you do not want to vote on proposals."
%p.text-right
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -0,0 +1,61 @@
.row
.col-md-12
.page-header
%h1 Program
- if @program
.row
.col-md-8
%dl.dl-horizontal
- if @cfp
%dt
Start Date:
%dd#start_date
= @cfp.start_date.strftime('%A, %B %-d. %Y')
%dt
End Date:
%dd#end_date
= @cfp.end_date.strftime('%A, %B %-d. %Y')
%dt
Days Left:
%dd
= pluralize(@cfp.remaining_days, 'day')
%dt
Event types:
%dd
= event_types(@conference)
%dt
Tracks:
%dd
= tracks(@conference)
%dt
Difficulty Levels:
%dd
= difficulty_levels(@conference)
%dt
Public Schedule
%dd#schedule_public
- if @program.schedule_public
Yes
- else
No
%dt
Schedule changeable?
%dd#schedule_changes
- if @program.schedule_fluid
Yes
- else
No
%dt
Rating Levels
%dd#rating
= @program.rating
.row
.col-md-12.text-right
- if can? :edit, @progam
= link_to edit_admin_conference_program_path(@conference.short_title), class: 'btn btn-primary' do
Edit
- if can? :destroy, @program
= link_to admin_conference_program_path(@conference.short_title), method: 'delete', class: 'btn btn-danger', data: { confirm: 'Are you sure you want to delete this program?' } do
Delete

View file

@ -8,8 +8,8 @@
= @room.name
.row
.col-md-8
= semantic_form_for(@room, :url => (@room.new_record? ? admin_conference_rooms_path : admin_conference_room_path(@conference.short_title, @room))) do |f|
= f.input :name
= semantic_form_for(@room, :url => (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f|
= f.input :name, input_html: { autofocus: true}
= f.input :size, :input_html => {:size => 5}
%p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -5,7 +5,7 @@
%p.text-muted
The rooms of your conference venue
- if @conference.rooms.any?
- if @rooms.any?
.row
.col-md-12
%table.table.table-hover#rooms
@ -14,18 +14,18 @@
%th Size
%th Actions
%tbody
- @conference.rooms.each_with_index do |room, index|
- @rooms.each_with_index do |room, index|
%tr
%td
= room.name
%td
= room.size
%td
= link_to 'Edit', edit_admin_conference_room_path(@conference.short_title, room.id),
= link_to 'Edit', edit_admin_conference_venue_room_path(@conference.short_title, room.id),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_room_path(@conference.short_title, room.id),
= link_to 'Delete', admin_conference_venue_room_path(@conference.short_title, room.id),
method: :delete, class: 'btn btn-danger',
data: { confirm: "Do you really want to delete #{room.name}? Attention: This room will be removed from all Events that have it set"}
.row
.col-md-12.text-right
= link_to 'Add Room', new_admin_conference_room_path(@conference.short_title), class: 'btn btn-primary'
= link_to 'Add Room', new_admin_conference_venue_room_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -8,7 +8,7 @@
Track
.row
.col-md-12
= semantic_form_for(@track, :url => (@track.new_record? ? admin_conference_tracks_path : admin_conference_track_path(@conference.short_title, @track))) do |f|
= semantic_form_for(@track, :url => (@track.new_record? ? admin_conference_program_tracks_path : admin_conference_program_track_path(@conference.short_title, @track))) do |f|
= f.input :name
= f.input :color, :input_html => {:size => 6, :type => "color"}, :required=> true
= f.input :description, :input_html => {:rows => 2, data: { provide: "markdown-editable" } }, hint: markdown_hint

View file

@ -13,10 +13,10 @@
%th Color
%th Actions
%tbody
- @conference.tracks.each do |track|
- @tracks.each do |track|
%tr
%td
= link_to(admin_conference_track_path(@conference.short_title, track)) do
= link_to(admin_conference_program_track_path(@conference.short_title, track)) do
= track.name
%td
%p
@ -26,12 +26,12 @@
= track.color
%td
.btn-group{role: "group"}
= link_to 'Edit', edit_admin_conference_track_path(@conference.short_title, track.id),
= link_to 'Edit', edit_admin_conference_program_track_path(@conference.short_title, track.id),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_track_path(@conference.short_title, track.id),
= link_to 'Delete', admin_conference_program_track_path(@conference.short_title, track.id),
method: :delete, class: 'btn btn-danger',
data: { confirm: "Do you really want to delete #{track.name}? Attention: This track will be removed from all Events that have it set" }
.row
.col-md-12.text-right
= link_to 'New Track', new_admin_conference_track_path(@conference.short_title), class: 'btn btn-success'
= link_to 'New Track', new_admin_conference_program_track_path(@conference.short_title), class: 'btn btn-success'

View file

@ -19,7 +19,7 @@
- @track.events.each_with_index do |event|
%tr
%td
=link_to event.title, admin_conference_event_path(@conference.short_title, event)
=link_to event.title, admin_conference_program_event_path(@conference.short_title, event)
%td
= event.event_type.title
%td

View file

@ -17,13 +17,13 @@
- @user.events.each do |event|
%tr
%td= event.id
%td= link_to event.conference.short_title, admin_conference_path(event.conference.short_title)
%td= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%td= link_to event.program.conference.short_title, admin_conference_path(event.program.conference.short_title)
%td= link_to event.title, admin_conference_program_event_path(event.program.conference.short_title, event)
%td= event.state
%td= "#{event.event_type.title} (#{show_time(event.event_type.length)})"
%td
- if event.conference.call_for_paper && event.conference.call_for_paper.rating && event.conference.call_for_paper.rating > 0
- event.conference.call_for_paper.rating.times do |counter|
- if event.program && event.program.rating && event.program.rating > 0
- event.program.rating.times do |counter|
- if event.average_rating.to_f.round == counter+1
= label_tag 'label_rating', '', class: 'avgrating', avgrate: true
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"

View file

@ -20,12 +20,12 @@
= @venue.country_name
.row
.col-md-12
= link_to(edit_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary') do
= link_to(edit_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary', disabled: !(can? :update, @venue) ) do
Edit Venue
= link_to(admin_conference_venue_path(@conference.short_title), method: 'delete', class: 'btn btn-danger') do
= link_to(admin_conference_venue_path(@conference.short_title), method: 'delete', class: 'btn btn-danger', disabled: !(can? :destroy, @venue)) do
Delete Venue
-else
.row
.col-md-12.text-right
= link_to(new_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary') do
Create Venue
Create Venue

View file

@ -0,0 +1,9 @@
.container
.row
.col-md-12
.page-header
%h1 Editing Commercial
.row
.col-md-12
= semantic_form_for @commercial, url: conference_program_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event.id, id: @commercial.id) do |f|
= render 'form', f: f

View file

@ -0,0 +1,9 @@
.container
.row
.col-md-12
.page-header
%h1 New Commercial
.row
.col-md-12
= semantic_form_for @commercial, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event.id) do |f|
= render 'form', f: f

View file

@ -1,8 +1,8 @@
<h1 class="text-center">Program for <%= @conference.title %></h1>
<% @conference.events.confirmed.each do |event| %>
<% @conference.program.events.confirmed.each do |event| %>
<div>
<h3>
<%= link_to event.title, conference_proposal_path(@conference.short_title, event.id) %>
<%= link_to event.title, conference_program_proposal_path(@conference.short_title, event.id) %>
<br>
<small>
<%= event.subtitle %>
@ -13,7 +13,7 @@
</h4>
<p>
<%= truncate(event.abstract, :length => 400) -%>
<%= link_to 'more', conference_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400 %>
<%= link_to 'more', conference_program_proposal_path(@conference.short_title, @conference.program.id, event.id) if event.abstract.length > 400 %>
</p>
</div>
<% end %>

View file

@ -12,22 +12,22 @@
.row
.col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1
%p
- if @conference.event_types.any?
- if @program.event_types.any?
You can submit proposals for
= "#{event_types(@conference)}."
- if @conference.tracks.any?
- if @program.tracks.any?
Proposals should fit in one of the
= "#{pluralize(@conference.tracks.count, 'track')}:"
= "#{pluralize(@program.tracks.count, 'track')}:"
= "#{tracks(@conference)}."
The submission period has begun
%em
= @conference.call_for_paper.start_date.strftime('%A, %B %-d. %Y')
= @program.cfp.start_date.strftime('%A, %B %-d. %Y')
and closes
%em
= @conference.call_for_paper.end_date.strftime('%A, %B %-d. %Y.')
- if @conference.cfp_open?
= @program.cfp.end_date.strftime('%A, %B %-d. %Y.')
- if @program.cfp_open?
That means you have only
%b= pluralize(@conference.call_for_paper.remaining_days, 'day')
%b= pluralize(@program.cfp.remaining_days, 'day')
left!
Remember
= @conference.short_title
@ -37,4 +37,4 @@
.row
.col-md-12.text-center
%p.cta-button
= link_to "Submit your paper now", conference_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
= link_to "Submit your paper now", conference_program_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'

View file

@ -21,17 +21,19 @@
- if !@conference || @conference != conference
- if conference.splashpage && conference.splashpage.public
= link_to "View Conference", conference_path(conference.short_title), :class =>"btn btn-default"
- if conference.call_for_paper and conference.call_for_paper.schedule_public
- if conference.program and conference.program.schedule_public
= link_to "Schedule", schedule_conference_path(conference.short_title), :class =>"btn btn-default"
- if conference.registration_open?
- if conference.user_registered?(current_user)
= link_to "My Registration", conference_conference_registrations_path(conference.short_title), :class =>"btn btn-default"
- else
= link_to "Register", new_conference_conference_registrations_path(conference.short_title), :class =>"btn btn-default"
= link_to "Register", new_conference_conference_registrations_path(conference.short_title), class: "btn btn-default", disabled: conference.registration_limit_exceeded?
- if conference.registration_limit_exceeded?
Sorry, no places left
- if !current_user.nil? && current_user.proposal_count(conference) > 0
= link_to "My Proposals", conference_proposal_index_path(conference.short_title), :class =>"btn btn-default"
- elsif conference.cfp_open?
= link_to "Submit Proposal", new_conference_proposal_path(conference.short_title), :class =>"btn btn-default"
= link_to "My Proposals", conference_program_proposal_index_path(conference.short_title), :class =>"btn btn-default"
- elsif conference.program.cfp_open?
= link_to "Submit Proposal", new_conference_program_proposal_path(conference.short_title), :class =>"btn btn-default"
- if current_user.nil? || !current_user.subscribed?(conference)
= link_to 'Subscribe', conference_subscriptions_path(conference.short_title), method: :post, class: 'btn btn-default'
- else

View file

@ -0,0 +1,40 @@
= content_for :splash_nav do
%li
%a.smoothscroll{ href: '#callforpapers' } Call For Papers
.container
.row
.col-md-12.text-center
%h2
Call for Papers
%p.lead
We are ready to accept your proposals for sessions!
.row
.col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1
%p
- if @conference.program.event_types.any?
You can submit proposals for
= "#{event_types(@conference)}."
- if @conference.tracks.any?
Proposals should fit in one of the
= "#{pluralize(@conference.tracks.count, 'track')}:"
= "#{tracks(@conference)}."
The submission period has begun
%em
= @program.cfp.start_date.strftime('%A, %B %-d. %Y')
and closes
%em
= @program.cfp.end_date.strftime('%A, %B %-d. %Y.')
- if @conference.cfp_open?
That means you have only
%b= pluralize(@program.cfp.remaining_days, 'day')
left!
Remember
= @conference.short_title
will only be as good as the sessions you present. Submit early, submit often!
- else
The submission period is closed.
.row
.col-md-12.text-center
%p.cta-button
= link_to "Submit your paper now", conference_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'

View file

@ -6,14 +6,25 @@
.row
.col-md-12.text-center
%h1 Registration
%p.lead
Going to
= @conference.short_title
is free of charge.
%p
We only ask you to register yourself until
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
so we can plan for the right amount of people.
%p.cta-button
- if @conference.registration_limit_exceeded?
%p
Sorry, the conference registration limit has exceeded
- else
- if @conference.tickets.empty?
%p.lead
Going to
= @conference.short_title
is free of charge.
%p
We only ask you to register yourself until
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
so we can plan for the right amount of people.
%p.cta-button
- else
%p
The registration period ends on
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
%p.cta-button
= link_to(new_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-lg btn-success') do
Register Now

View file

@ -1,7 +1,7 @@
%td.event{ style: "width: #{95 / @rooms.length}%; cursor:pointer", |
rowspan: span[room.id], |
role: "button" } |
%a.unstyled-link{href: url_for(conference_proposal_path(@conference.short_title, event[0].id))}
%a.unstyled-link{href: url_for(conference_program_proposal_path(@conference.short_title, event[0].id))}
- if speaker = event[0].speakers.first
= image_tag speaker.gravatar_url, :class => "img-circle pull-right", |
:alt => speaker.name, |

View file

@ -6,10 +6,10 @@
%p.lead.text-center
= @conference.short_title
has the most awesome program ever!
- if @conference.splashpage and @conference.tracks.any? and @conference.splashpage.include_tracks
- if @conference.splashpage and @conference.program.tracks.any? and @conference.splashpage.include_tracks
See rock-star speakers cover the topics of
- if @conference.splashpage and @conference.splashpage.include_tracks
- @conference.tracks.each_slice(3) do |slice|
- @conference.program.tracks.each_slice(3) do |slice|
.row.row-centered
- slice.each do |track|
.col-md-4.col-sm-4.col-centered.col-top.track
@ -17,7 +17,7 @@
= track.name
= markdown(track.description)
- if @conference.call_for_paper and @conference.call_for_paper.schedule_public
- if @conference.program and @conference.program.schedule_public
.row
.col-md-12
%p.cta-button.text-center
@ -28,10 +28,10 @@
%h3.text-center
Don't miss out!
%br
- if @conference.events.highlights.any?
- if @conference.program.events.highlights.any?
.row
.col-md-12
- @conference.events.highlights.each_slice(2) do |slice|
- @conference.program.events.highlights.each_slice(2) do |slice|
.row.row-centered
- slice.each do |event|
.col-md-6.col-centered.col-top.highlights
@ -39,7 +39,7 @@
%b= event.title
%h5.text-center
= simple_format truncate(event.abstract, length: 500, separator: ' ')
= link_to "Read More", conference_proposal_path(@conference.short_title, event)
= link_to "Read More", conference_program_proposal_path(@conference.short_title, event)
= content_for :splash_nav do
%li

View file

@ -6,8 +6,9 @@
- popup = "<h3>#{@conference.venue.name}</h3><br>#{@conference.venue.street}<br>#{@conference.venue.city}<br>#{@conference.venue.country_name}"
- content_for(:script_body) do
:javascript
L.Icon.Default.imagePath = '/assets/leaflet/';
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map', {scrollWheelZoom: false}).setView([#{@conference.venue.latitude}, #{@conference.venue.longitude}], 11);
var map = L.map('map', { scrollWheelZoom: false }).setView([#{@conference.venue.latitude}, #{@conference.venue.longitude}], 11);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',

View file

@ -1,5 +1,5 @@
<div class="container">
<% if @conference.events.scheduled.any? %>
<% if @conference.program.events.scheduled.any? %>
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
@ -24,4 +24,4 @@
<% else %>
<%= render 'all_events' %>
<% end %>
</div>
</div>

View file

@ -36,7 +36,7 @@
%section#program
= render 'schedule_splashpage'
- if @conference.cfp_open? and @conference.splashpage.include_cfp
- if @program.cfp_open? and @conference.splashpage.include_cfp
%section#callforpapers
= render 'call_for_paper'
@ -69,8 +69,13 @@
var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); });
$(function () {
$(document).ready(function() {
var t = new Trianglify({cellsize: 100, x_gradient: triangle_colors });
var pattern = t.generate(document.body.clientWidth, ($( "#banner" ).height() + 200 ));
$('#banner').css('background-image', pattern.dataUrl);
var triangle_width = document.body.clientWidth;
var triangle_height = ($( "#banner" ).height() + 200 );
var pattern = Trianglify({ width: triangle_width,
height: triangle_height,
cell_size: 100,
x_colors: triangle_colors
});
$('#banner').css('background-image', 'url("' + pattern.png() + '")');
});
});

View file

@ -1,8 +1,8 @@
- if @conference.questions.any?
= render partial: 'conference_registrations/questions', locals: { f: f }
- if @conference.events.workshops.any?
- if @conference.program.events.workshops.any?
=f.inputs 'Pre-registration required for the following:' do
= f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops
= f.input :events, as: :check_boxes, label: false, collection: @conference.program.events.workshops
= f.inputs 'Your Travel Info' do
= f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' }
= f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' }

View file

@ -126,13 +126,13 @@
- @conference.participants.each do |participant|
= image_tag(participant.gravatar_url(size: '25'), title: "#{participant.name}!", class: 'img-circle')
.col-md-4.col-md-offset-2
- if @conference.speakers.confirmed.any?
- if @conference.program.speakers.confirmed.any?
%h4
%span.fa-stack
%i.fa.fa-square-o.fa-stack-2x
%i.fa.fa-microphone.fa-stack-1x
= @conference.speakers.confirmed.count
= @conference.program.speakers.confirmed.count
Confirmed
= word_pluralize(@conference.speakers.confirmed.count, 'Speaker')
- @conference.speakers.confirmed.each do |speaker|
= word_pluralize(@conference.program.speakers.confirmed.count, 'Speaker')
- @conference.program.speakers.confirmed.each do |speaker|
= image_tag(speaker.gravatar_url(size: '25'), title: "#{speaker.name}!", class: 'img-circle')

View file

@ -47,39 +47,39 @@
- if can? :update, @conference
%li{:class=> active_nav_li(edit_admin_conference_splashpage_path(@conference.short_title))}
= link_to 'Splashpage', admin_conference_splashpage_path(@conference.short_title)
- if can? :index, Venue.new(conference_id: @conference.id)
- if can? :show, Venue.new(conference_id: @conference.id)
%li{:class=> "#{active_nav_li(admin_conference_venue_path(@conference.short_title))}"}
= link_to(admin_conference_venue_path(@conference.short_title)) do
%span.fa.fa-road
Venue
%ul
- if can? :update, @conference.rooms.build
%li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))}
= link_to 'Rooms', admin_conference_rooms_path(@conference.short_title)
- if @conference.venue && @conference.venue.persisted? && (can? :update, @conference.venue.rooms.build)
%li{:class=> active_nav_li(admin_conference_venue_rooms_path(@conference.short_title))}
= link_to 'Rooms', admin_conference_venue_rooms_path(@conference.short_title)
- if can? :update, @conference.lodgings.build
%li{ class: active_nav_li(admin_conference_lodgings_path(@conference.short_title)) }
= link_to 'Lodgings', admin_conference_lodgings_path(@conference.short_title)
%li
%a
%li{:class=> "#{active_nav_li(admin_conference_program_path(@conference.short_title))}"}
= link_to admin_conference_program_path(@conference.short_title) do
%span.fa.fa-calendar
Program
%ul
- if can? :update, @conference.events.build
%li{:class=> active_nav_li(admin_conference_events_path(@conference.short_title))}
= link_to 'Events', admin_conference_events_path(@conference.short_title)
- if can? :update, CallForPaper.new(conference_id: @conference.id)
%li{:class=> "#{active_nav_li(admin_conference_call_for_paper_path(@conference.short_title))}"}
= link_to 'Call for Papers', admin_conference_call_for_paper_path(@conference.short_title)
- if can? :update, @conference.tracks.build
%li{:class=> active_nav_li(admin_conference_tracks_path(@conference.short_title))}
= link_to 'Tracks', admin_conference_tracks_path(@conference.short_title)
- if can? :update, @conference.event_types.build
%li{:class=> active_nav_li(admin_conference_event_types_path(@conference.short_title))}
= link_to 'Event Types', admin_conference_event_types_path(@conference.short_title)
- if can? :update, @conference.difficulty_levels.build, conference_id: @conference.id
%li{:class=> active_nav_li(admin_conference_difficulty_levels_path(@conference.short_title))}
= link_to 'Difficulty Levels', admin_conference_difficulty_levels_path(@conference.short_title)
- if can? :update, @conference.events.build
- if can? :update, Cfp.new(program_id: @conference.program.id)
%li{:class=> active_nav_li(admin_conference_program_cfp_path(@conference.short_title))}
= link_to 'Call for Papers', admin_conference_program_cfp_path(@conference.short_title)
- if can? :update, @conference.program.events.build
%li{:class=> active_nav_li(admin_conference_program_events_path(@conference.short_title))}
= link_to 'Events', admin_conference_program_events_path(@conference.short_title)
- if can? :update, @conference.program.tracks.build
%li{:class=> active_nav_li(admin_conference_program_tracks_path(@conference.short_title))}
= link_to 'Tracks', admin_conference_program_tracks_path(@conference.short_title)
- if can? :update, @conference.program.event_types.build
%li{:class=> active_nav_li(admin_conference_program_event_types_path(@conference.short_title))}
= link_to 'Event Types', admin_conference_program_event_types_path(@conference.short_title)
- if can? :update, @conference.program.difficulty_levels.build, conference_id: @conference.id
%li{:class=> active_nav_li(admin_conference_program_difficulty_levels_path(@conference.short_title))}
= link_to 'Difficulty Levels', admin_conference_program_difficulty_levels_path(@conference.short_title)
- if can? :update, @conference.program.events.build
%li{class: active_nav_li(admin_conference_schedule_path(@conference.short_title))}
= link_to 'Schedule', admin_conference_schedule_path(@conference.short_title), target: '_blank'

View file

@ -37,7 +37,7 @@
- if unread_notifications(current_user).length > 0
%li.dropdown-header Last 5 Comments for:
- unread_notifications(current_user).limit(5).group_by{ |comment| comment.commentable}.each do |event, comments|
%li= link_to("#{event.title}(#{comments.count})", admin_conference_event_path(event.conference.short_title, event.id))
%li= link_to("#{event.title}(#{comments.count})", admin_conference_program_event_path(event.program.conference.short_title, event.id))
%li.divider
%li= link_to "See all unread Comments (#{unread_notifications(current_user).length})", admin_comments_path
%li= link_to 'See all Comments', admin_comments_path(anchor: 'all_comments')

View file

@ -7,9 +7,9 @@
= link_to(edit_user_path(current_user.id)) do
%span.fa.fa-user
Edit Profile
-if @conference and @conference.call_for_paper
-if @conference and @conference.program
%li
= link_to(conference_proposal_index_path(@conference.short_title)) do
= link_to(conference_program_proposal_index_path(@conference.short_title)) do
%span.fa.fa-comment
My Submissions
%li

View file

@ -2,7 +2,7 @@
%head
%meta{:charset => "utf-8"}
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"}
%title= content_for?(:title) ? yield(:title) : "OSEM"
%title= content_for?(:title) ? yield(:title) : CONFIG['name']
%meta{:content => "", :name => "description"}
%meta{:content => "", :name => "author"}
= stylesheet_link_tag "application", :media => "all"

View file

@ -3,7 +3,7 @@
%head
%meta{:charset => "utf-8"}
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"}
%title= content_for?(:title) ? yield(:title) : "OSEM"
%title= content_for?(:title) ? yield(:title) : CONFIG['name']
%meta{:content => "", :name => "description"}
%meta{:content => "", :name => "author"}
= stylesheet_link_tag "/stylesheets/schedule/jquery-ui-1.9.2.custom.min"

View file

@ -1,20 +1,20 @@
%p.lead
- if @conference.event_types.any?
- if @program.event_types.any?
You can submit proposals for
= "#{event_types(@conference)}."
- if @conference.tracks.any?
- if @program.tracks.any?
Proposals should fit in one of the
= "#{pluralize(@conference.tracks.count, 'track')}:"
= "#{pluralize(@program.tracks.count, 'track')}:"
= "#{tracks(@conference)}."
- if @conference.cfp_open?
- if @program.cfp_open?
The submission period has begun
%em
= @conference.call_for_paper.start_date.strftime('%A, %B %-d. %Y')
= @program.cfp.start_date.strftime('%A, %B %-d. %Y')
and closes
%em
= @conference.call_for_paper.end_date.strftime('%A, %B %-d. %Y.')
= @program.cfp.end_date.strftime('%A, %B %-d. %Y.')
That means you have
%b= pluralize(@conference.call_for_paper.remaining_days, 'day')
%b= pluralize(@program.cfp.remaining_days, 'day')
left!
Remember
= @conference.title

View file

@ -13,7 +13,7 @@
#commercials-content.tab-pane
%p.text-muted
You can add commercials for your proposal. These commercials will be displayed on the
= link_to 'public proposal page.', conference_proposal_path(@conference.short_title, @event)
= link_to 'public proposal page.', conference_program_proposal_path(@conference.short_title, @event)
If you don't add a commercial, the conference commercial will be displayed!
- if can? :create, @event.commercials.new
.row
@ -22,7 +22,7 @@
#resource-placeholder{ style: 'background-color:#d3d3d3; float: left; width: 400px; height: 250px; margin: 5px; border-width: 1px; border-style: solid; border-color: rgba(0,0,0,.2);' }
.row
.col-md-6
= semantic_form_for(@event.commercials.build, url: conference_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event)) do |f|
= semantic_form_for(@event.commercials.build, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event)) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' },
hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.'
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }
@ -37,9 +37,9 @@
= render partial: 'shared/media_item', locals: { commercial: commercial }
.caption
- if can? :update, commercial
= semantic_form_for commercial, url: conference_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event, id: commercial) do |f|
= semantic_form_for commercial, url: conference_program_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event, id: commercial) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required', type: 'url' }
= f.action :submit, as: :button, button_html: { class: 'btn btn-success' }, label: 'Update'
- if can? :destroy, commercial
= link_to 'Delete', conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id),
= link_to 'Delete', conference_program_proposal_commercial_path(@conference.short_title, @event.id, commercial.id),
:method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger'

View file

@ -5,21 +5,21 @@
= f.input :subtitle, as: :string
= f.input :event_type_id, as: :select,
collection: @conference.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
collection: @conference.program.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 }]},
include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
- @conference.event_types.each do |event_type|
- @conference.program.event_types.each do |event_type|
%span{ class: 'help-block select-help-text event_event_type_id collapse', id: "#{event_type.id}-help" }
= event_type.description
:javascript
$("##{@conference.event_types.first.id}-help").collapse('show');
$("##{@conference.program.event_types.first.id}-help").collapse('show');
= f.input :difficulty_level, as: :select, collection: @conference.difficulty_levels, input_html: { class: 'select-help-toggle' },
include_blank: '(Please select)' if @conference.difficulty_levels.any?
= f.input :difficulty_level, as: :select, collection: @conference.program.difficulty_levels, input_html: { class: 'select-help-toggle' },
include_blank: '(Please select)' if @conference.program.difficulty_levels.any?
- @conference.difficulty_levels.each do |difficulty_level|
- @conference.program.difficulty_levels.each do |difficulty_level|
%span{ class: 'help-block select-help-text collapse event_difficulty_level_id', id: "#{difficulty_level.id}-help" }
= difficulty_level.description

View file

@ -3,9 +3,9 @@
%li{'class'=>class_for_todo(progress_status['registered'])}
%span{'class'=>icon_for_todo(progress_status['registered'])}
- if progress_status['registered']
= link_to 'Edit your registration', edit_conference_conference_registrations_path(event.conference.short_title)
= link_to 'Edit your registration', edit_conference_conference_registrations_path(event.program.conference.short_title)
- else
= link_to 'Register to the conference', new_conference_conference_registrations_path(event.conference.short_title)
= link_to 'Register to the conference', new_conference_conference_registrations_path(event.program.conference.short_title)
%li{'class'=>class_for_todo(progress_status['biography'])}
%span{'class'=>icon_for_todo(progress_status['biography'])}
@ -17,20 +17,19 @@
%li{'class'=>class_for_todo(progress_status['subtitle'])}
%span{'class'=>icon_for_todo(progress_status['subtitle'])}
- if progress_status['subtitle']
= link_to 'Edit the subtitle', edit_conference_proposal_path(event.conference.short_title, event)
= link_to 'Edit the subtitle', edit_conference_program_proposal_path(event.program.conference.short_title, event)
- else
= link_to 'Add a subtitle', edit_conference_proposal_path(event.conference.short_title, event)
= link_to 'Add a subtitle', edit_conference_program_proposal_path(event.program.conference.short_title, event)
%li{'class'=>class_for_todo(progress_status['commercials'])}
%span{'class'=>icon_for_todo(progress_status['commercials'])}
- if progress_status['commercials']
= link_to 'Edit the commercials', edit_conference_proposal_path(event.conference.short_title, event, anchor: 'commercials-content')
= link_to 'Edit the commercials', edit_conference_program_proposal_path(event.program.conference.short_title, event, anchor: 'commercials-content')
- else
= link_to 'Add a commercial', edit_conference_proposal_path(event.conference.short_title, event, anchor: 'commercials-content')
= link_to 'Add a commercial', edit_conference_program_proposal_path(event.program.conference.short_title, event, anchor: 'commercials-content')
%li{'class'=>class_for_todo(progress_status['difficulty_level'])}
%span{'class'=>icon_for_todo(progress_status['difficulty_level'])}
- if progress_status['difficulty_level']
= link_to 'Change the difficulty level', edit_conference_proposal_path(event.conference.short_title, event)
= link_to 'Change the difficulty level', edit_conference_program_proposal_path(event.program.conference.short_title, event)
- else
= link_to 'Add a difficulty level', edit_conference_proposal_path(event.conference.short_title, event)
= link_to 'Add a difficulty level', edit_conference_program_proposal_path(event.program.conference.short_title, event)

View file

@ -18,7 +18,7 @@
Some of your proposals have been selected as a highlight of #{@conference.title}!
%ul
- @events.highlighted.each do |event|
%li= link_to event.title, conference_proposal_path(@conference.short_title, event)
%li= link_to event.title, conference_program_proposal_path(@conference.short_title, event)
.row
@ -60,7 +60,7 @@
%span{ title: event.state.humanize, class: "fa #{event_status_icon(event)}" }
%td.col-md-7{style: "padding:20px 8px 20px 8px;"}
= link_to event.title, conference_proposal_path(@conference.short_title, event.id)
= link_to event.title, conference_program_proposal_path(@conference.short_title, event.id)
%br
%small.text-muted
= event.event_type.title
@ -82,20 +82,20 @@
.pull-right
- if event.transition_possible? :confirm
= link_to 'Confirm',
confirm_conference_proposal_path(@conference.short_title, event),
confirm_conference_program_proposal_path(@conference.short_title, event),
method: :patch, class: 'btn btn-mini btn-success', id: "confirm_proposal_#{event.id}"
- if event.transition_possible? :withdraw
= link_to 'Withdraw', conference_proposal_path(@conference.short_title, event.id), method: :delete,
= link_to 'Withdraw', conference_program_proposal_path(@conference.short_title, event.id), method: :delete,
data: { confirm: 'Are you sure you want to withdraw this proposal?' }, class: 'btn btn-mini btn-warning',
id: "delete_proposal_#{event.id}"
- if event.state == 'withdrawn' || event.state == 'rejected'
= link_to 'Re-Submit',
restart_conference_proposal_path(@conference.short_title, event.id),
restart_conference_program_proposal_path(@conference.short_title, event.id),
method: :patch, class: 'btn btn-mini btn-success', id: "review_event_#{event.id}"
= link_to 'Edit', edit_conference_proposal_path(@conference.short_title, event.id),
= link_to 'Edit', edit_conference_program_proposal_path(@conference.short_title, event.id),
class: 'btn btn-default', id: "edit_proposal_#{event.id}"
.row
.col-md-12
- if @conference.cfp_open? || (current_user.has_role? :organizer, @conference)
= link_to "New Proposal", new_conference_proposal_path(@conference.short_title), :class => "btn btn-success pull-right"
- if can? :create, @program.events.new
= link_to "New Proposal", new_conference_program_proposal_path(@conference.short_title), :class => "btn btn-success pull-right"

View file

@ -27,16 +27,16 @@
= f.inputs name: 'Proposal Information' do
= f.input :title, as: :string, required: true, input_html: { required: true }
= f.input :event_type_id, as: :select,
collection: @conference.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
collection: @program.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 }]},
include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
- @conference.event_types.each do |event_type|
- @program.event_types.each do |event_type|
%span{ class: 'help-block event_event_type_id collapse', id: "#{event_type.id}-help" }
= event_type.description
:javascript
$("##{@conference.event_types.first.id}-help").collapse('show');
$("##{@program.event_types.first.id}-help").collapse('show');
= f.input :abstract, input_html: { rows: 5, required: true },
required: true, hint: link_to('Tips to improve your presentations', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx')

View file

@ -9,7 +9,7 @@
= @event.subtitle
= link_to "Schedule", schedule_conference_path(@conference.short_title), :class =>"btn btn-success pull-right"
- if can? :edit, @event
= link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary pull-right"
= link_to "Edit", edit_admin_conference_program_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary pull-right"
.row
.col-md-3
%p
@ -24,7 +24,7 @@
- if @event.room_id
= @event.room.name
%dt Conference:
%dd= @event.conference.title
%dd= @event.program.conference.title
%dt Language:
%dd= @event.language if @event.language
%dt Track:

View file

@ -18,7 +18,7 @@
- @user.events.confirmed.each do |event|
%li
%h4
= link_to event.title, conference_proposal_path(event.conference.short_title, event.id)
= link_to event.title, conference_program_proposal_path(event.program.conference.short_title, event.id)
%strong
at
= event.conference.title
= event.program.conference.title