Merge OSEM updates
This commit is contained in:
commit
d1ca21f479
50 changed files with 338 additions and 382 deletions
|
|
@ -13,11 +13,13 @@ $(function () {
|
|||
|
||||
$("#conference-start-datepicker").datetimepicker({
|
||||
useCurrent: false,
|
||||
format: "YYYY-MM-DD"
|
||||
ignoreReadonly: true,
|
||||
format: "YYYY-MM-DD",
|
||||
});
|
||||
|
||||
$("#conference-end-datepicker").datetimepicker({
|
||||
useCurrent: false,
|
||||
ignoreReadonly: true,
|
||||
format: "YYYY-MM-DD"
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@ class ConferencesController < ApplicationController
|
|||
load_and_authorize_resource find_by: :short_title, except: :show
|
||||
|
||||
def index
|
||||
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc)
|
||||
@antiquated = Conference.where('end_date < ?', Date.current)
|
||||
@current = Conference.upcoming.reorder(start_date: :asc)
|
||||
@antiquated = Conference.past
|
||||
if @antiquated.empty? && @current.empty? && User.empty?
|
||||
render :new_install
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
@ -68,6 +71,47 @@ class ConferencesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def calendar
|
||||
respond_to do |format|
|
||||
format.ics do
|
||||
calendar = Icalendar::Calendar.new
|
||||
Conference.all.each do |conf|
|
||||
if params[:full]
|
||||
event_schedules = conf.program.selected_event_schedules(
|
||||
includes: [{ event: %i[event_type speakers submitter] }]
|
||||
)
|
||||
calendar = icalendar_proposals(calendar, event_schedules.map(&:event), conf)
|
||||
else
|
||||
calendar.event do |e|
|
||||
e.dtstart = conf.start_date
|
||||
e.dtstart.ical_params = { 'VALUE'=>'DATE' }
|
||||
e.dtend = conf.end_date
|
||||
e.dtend.ical_params = { 'VALUE'=>'DATE' }
|
||||
e.duration = "P#{(conf.end_date - conf.start_date + 1).floor}D"
|
||||
e.created = conf.created_at
|
||||
e.last_modified = conf.updated_at
|
||||
e.summary = conf.title
|
||||
e.description = conf.description
|
||||
e.uid = conf.guid
|
||||
e.url = conference_url(conf.short_title)
|
||||
v = conf.venue
|
||||
if v
|
||||
e.geo = v.latitude, v.longitude if v.latitude && v.longitude
|
||||
location = ''
|
||||
location += "#{v.street}, " if v.street
|
||||
location += "#{v.postalcode} #{v.city}, " if v.postalcode && v.city
|
||||
location += v.country_name if v.country_name
|
||||
e.location = location if location
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
calendar.publish
|
||||
render inline: calendar.to_ical
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def conference_finder_conditions
|
||||
|
|
|
|||
|
|
@ -21,6 +21,12 @@ class SchedulesController < ApplicationController
|
|||
format.xml do
|
||||
@events_xml = event_schedules.map(&:event).group_by{ |event| event.time.to_date } if event_schedules
|
||||
end
|
||||
format.ics do
|
||||
cal = Icalendar::Calendar.new
|
||||
cal = icalendar_proposals(cal, event_schedules.map(&:event), @conference)
|
||||
cal.publish
|
||||
render inline: cal.to_ical
|
||||
end
|
||||
|
||||
format.html do
|
||||
@rooms = @conference.venue.rooms if @conference.venue
|
||||
|
|
|
|||
|
|
@ -27,4 +27,33 @@ module ConferenceHelper
|
|||
|
||||
markdown(ticket.description.split("\n").first&.strip)
|
||||
end
|
||||
|
||||
# adds events to icalendar for proposals in a conference
|
||||
def icalendar_proposals(calendar, proposals, conference)
|
||||
proposals.each do |proposal|
|
||||
calendar.event do |e|
|
||||
e.dtstart = proposal.time
|
||||
e.dtend = proposal.time + proposal.event_type.length * 60
|
||||
e.duration = "PT#{proposal.event_type.length}M"
|
||||
e.created = proposal.created_at
|
||||
e.last_modified = proposal.updated_at
|
||||
e.summary = proposal.title
|
||||
e.description = proposal.abstract
|
||||
e.uid = proposal.guid
|
||||
e.url = conference_program_proposal_url(conference.short_title, proposal.id)
|
||||
v = conference.venue
|
||||
if v
|
||||
e.geo = v.latitude, v.longitude if v.latitude && v.longitude
|
||||
location = ''
|
||||
location += "#{proposal.room.name} - " if proposal.room.name
|
||||
location += " - #{v.street}, " if v.street
|
||||
location += "#{v.postalcode} #{v.city}, " if v.postalcode && v.city
|
||||
location += "#{v.country_name}, " if v.country_name
|
||||
e.location = location
|
||||
end
|
||||
e.categories = conference.title, "Difficulty: #{proposal.difficulty_level.title}", "Track: #{proposal.track.name}"
|
||||
end
|
||||
end
|
||||
calendar
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -61,6 +61,9 @@ class Conference < ApplicationRecord
|
|||
has_one :email_settings, dependent: :destroy
|
||||
has_one :program, dependent: :destroy
|
||||
has_one :venue, dependent: :destroy
|
||||
delegate :city, :country_name, to: :venue, allow_nil: true
|
||||
delegate :name, :street, to: :venue, prefix: true, allow_nil: true
|
||||
|
||||
has_many :ticket_purchases, dependent: :destroy
|
||||
has_many :physical_tickets, through: :ticket_purchases
|
||||
has_many :payments, dependent: :destroy
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ class SurveyQuestion < ActiveRecord::Base
|
|||
|
||||
validates :title, presence: true
|
||||
validates :possible_answers, :max_choices, :min_choices, presence: true, if: :choice?
|
||||
validates :min_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true
|
||||
validates :max_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true
|
||||
validates :min_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true, if: :choice?
|
||||
validates :max_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true, if: :choice?
|
||||
|
||||
validate :max_choices_greater_than_min
|
||||
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ class TicketPdf < Prawn::Document
|
|||
draw_text @conference.title.to_s, at: [@mid_horizontal + 30, cursor - 30], size: 12
|
||||
draw_text @conference.organization.name.to_s, at: [@mid_horizontal + 30, cursor - 50], size: 12
|
||||
if @conference.venue
|
||||
draw_text @conference.venue.name, at: [@mid_horizontal + 30, cursor - 70]
|
||||
draw_text @conference.venue.street, at: [@mid_horizontal + 30, cursor - 90]
|
||||
draw_text @conference.venue.city, at: [@mid_horizontal + 30, cursor - 110]
|
||||
draw_text @conference.venue_name, at: [@mid_horizontal + 30, cursor - 70]
|
||||
draw_text @conference.venue_street, at: [@mid_horizontal + 30, cursor - 90]
|
||||
draw_text @conference.city, at: [@mid_horizontal + 30, cursor - 110]
|
||||
end
|
||||
move_up 130
|
||||
move_down @mid_vertical
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ class PictureUploader < CarrierWave::Uploader::Base
|
|||
include CarrierWave::Compatibility::Paperclip
|
||||
include CarrierWave::BombShelter
|
||||
|
||||
storage :file
|
||||
|
||||
# use cloudinary if it's configured
|
||||
if Cloudinary.config.cloud_name
|
||||
# use https by default
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
.row
|
||||
.col-md-12
|
||||
= f.input :title
|
||||
= f.input :title, input_html: { autofocus: true }
|
||||
= f.input :mandatory
|
||||
.survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' }
|
||||
= f.input :possible_answers, hint: 'Comma separated', input_html: { rows: 3 }
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@
|
|||
.panel-body
|
||||
- question_replies = survey_question.survey_replies
|
||||
- if question_replies.any?
|
||||
= pie_chart question_replies.group(:text).count, library: { legend: 'bottom', plotOptions: { pie: { dataLabels: { enabled: false }, showInLegend: true } } }
|
||||
= pie_chart question_replies.group(:text).count, library: { legend: { position: 'bottom' }, plotOptions: { pie: { dataLabels: { enabled: false }, showInLegend: true } } }
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@
|
|||
= event.title
|
||||
%small
|
||||
= event.subtitle
|
||||
.text-muted
|
||||
= registered_text(event)
|
||||
- if event.scheduled?
|
||||
(Scheduled on: #{event.time.to_date})
|
||||
|
||||
.panel-body
|
||||
-# %p
|
||||
-# = canceled_replacement_event_label(event, event_schedule)
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
-if @conference.venue
|
||||
at
|
||||
%strong
|
||||
= "#{@conference.venue.name},"
|
||||
= "#{@conference.venue.street},"
|
||||
= "#{@conference.venue.city} / #{@conference.venue.country_name}."
|
||||
= "#{@conference.venue_name},"
|
||||
= "#{@conference.venue_street},"
|
||||
= "#{@conference.city} / #{@conference.country_name}."
|
||||
%small
|
||||
= date_string(@conference.start_date, @conference.end_date)
|
||||
- unless @conference.code_of_conduct.blank?
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
= date_string(conference.start_date, conference.end_date)
|
||||
- if conference.venue
|
||||
%p
|
||||
= "#{conference.venue.city}/#{conference.venue.country_name}"
|
||||
= "#{conference.city}/#{conference.country_name}"
|
||||
- unless conference.description.blank?
|
||||
%p
|
||||
= markdown(conference.description)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,11 @@
|
|||
#antiquated.collapse
|
||||
- @antiquated.each do |conference|
|
||||
= render '/conferences/conference_details', conference: conference
|
||||
- if @antiquated.empty? && @current.empty? && User.empty?
|
||||
= render partial: 'new_install'
|
||||
%p
|
||||
Add the events to your calendar:
|
||||
%span.btn-group
|
||||
= link_to("Days only", calendar_url(protocol: 'webcal', format: 'ics'), class: 'btn btn-default')
|
||||
= link_to("Detailed", calendar_url(protocol: 'webcal', format: 'ics', full: true), class: 'btn btn-default')
|
||||
|
||||
-content_for :script_body do
|
||||
:javascript
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@
|
|||
will the be administrator of it.
|
||||
%p
|
||||
We hope you enjoy using OSEM, if you have any question don't hesitate to
|
||||
= link_to('http://osem.io/#contact') do
|
||||
= link_to('https://osem.io/#contact') do
|
||||
contact us!
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
%li
|
||||
= link_to(conference_conference_registration_path(@conference)) do
|
||||
%span.fa.fa-id-badge
|
||||
= @conference.short_title
|
||||
registration
|
||||
= @conference.short_title
|
||||
registration
|
||||
-if @conference && @conference.program
|
||||
%li
|
||||
= link_to(conference_program_proposals_path(@conference.short_title)) do
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
- if @conference.venue
|
||||
at
|
||||
%strong
|
||||
#{@conference.venue.name},
|
||||
#{@conference.venue.street},
|
||||
#{@conference.venue.city} / #{@conference.venue.country_name}.
|
||||
#{@conference.venue_name},
|
||||
#{@conference.venue_street},
|
||||
#{@conference.city} / #{@conference.country_name}.
|
||||
%small
|
||||
= date_string(@conference.start_date, @conference.end_date)
|
||||
.row
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
250
|
||||
words.
|
||||
|
||||
- if current_user.is_admin? or @program.cfp.enable_registrations?
|
||||
- if current_user.is_admin? or @program.cfp&.enable_registrations?
|
||||
= f.inputs 'Enable pre-registration' do
|
||||
= f.input :require_registration, label: 'Require participants to register to your event'
|
||||
- message = @event.room ? "Value must be between 1 and #{@event.room.size}" : 'Check room capacity after scheduling.'
|
||||
|
|
|
|||
|
|
@ -36,17 +36,17 @@
|
|||
data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]},
|
||||
include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
|
||||
|
||||
- if @program.languages.present?
|
||||
= f.input :language, as: :select,
|
||||
collection: @languages,
|
||||
include_blank: false, label: 'Language', input_html: { class: 'select-help-toggle' }
|
||||
|
||||
- @program.event_types.each do |event_type|
|
||||
%div{ class: 'help-block event_event_type_id collapse', id: "#{event_type.id}-help"}
|
||||
%strong Directions
|
||||
%div
|
||||
= markdown(event_type.description)
|
||||
|
||||
- if @program.languages.present?
|
||||
= f.input :language, as: :select,
|
||||
collection: @languages,
|
||||
include_blank: false, label: 'Language', input_html: { class: 'select-help-toggle' }
|
||||
|
||||
= f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } },
|
||||
hint: markdown_hint
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,13 @@
|
|||
|
||||
.visible-md-inline.visible-lg-inline
|
||||
= render partial: 'carousel', locals: { date: date, hrs_per_slide: 3 }
|
||||
%p.pull-right
|
||||
= link_to app_conference_schedule_path do
|
||||
Get the mobile app!
|
||||
%p
|
||||
%span
|
||||
= link_to conference_schedule_url(protocol: 'webcal', format: 'ics') do
|
||||
Add the schedule to your calendar
|
||||
%span.pull-right
|
||||
= link_to app_conference_schedule_path do
|
||||
Get the mobile app!
|
||||
|
||||
:javascript
|
||||
// change of active tab and the button title when a date is clicked
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue