diff --git a/app/controllers/schedule.rb b/app/controllers/schedule.rb new file mode 100644 index 0000000..3a0f3f2 --- /dev/null +++ b/app/controllers/schedule.rb @@ -0,0 +1,25 @@ +class Schedule + include ActiveModel::Model + attr_accessor :hall, :slots + + def self.for_conference(conference) + schedule = {} + conference.halls.each do |hall| + schedule[hall.id] = hall.slots.includes(:event, event: [:speakers]).where('starts_at < ?', Date.tomorrow).where.not(event_id: nil).order(:starts_at).map do |slot| + { + title: slot.event.title, + subtitle: slot.event.subtitle, + startTime: slot.starts_at, + endTime: slot.ends_at, + speakers: slot.event.speakers.map do |speaker| + { + name: speaker.name, + description: speaker.biography + } + end + } + end + end + schedule + end +end diff --git a/app/controllers/schedules_controller.rb b/app/controllers/schedules_controller.rb new file mode 100644 index 0000000..564a93e --- /dev/null +++ b/app/controllers/schedules_controller.rb @@ -0,0 +1,10 @@ +class SchedulesController < ApplicationController + def show + @schedule = Schedule.for_conference Conference.current + headers['Access-Control-Allow-Origin'] = '*' + headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS' + headers['Access-Control-Max-Age'] = "1728000" + + respond_to { |format| format.json { render json: @schedule.to_json } } + end +end diff --git a/app/views/event_mailer/acceptance_second_notification.bg.text.erb b/app/views/event_mailer/acceptance_second_notification.bg.text.erb new file mode 100644 index 0000000..f128c7d --- /dev/null +++ b/app/views/event_mailer/acceptance_second_notification.bg.text.erb @@ -0,0 +1,18 @@ +Здравейте, + +Напомняме Ви, че предложението ви за участие в <%= @event.conference.title %> с <%= @event.class.model_name.human.mb_chars.downcase.to_s %> на тема „<%= @event.title %>“ беше одобрено. + +Моля, потвърдете участието си възможно най-скоро като кликнете на следния линк: +<% if @event.is_a? Lecture %> +<%= confirm_lecture_url(@event) %> +<% elsif @event.is_a? Workshop %> +<%= confirm_workshop_url(@event) %> +<% end %> + +Отговорете на този email, ако възникнат някакви въпроси. + +Първоначален вариант на програмата можете да видите тук: +http://wwwt.openfest.org/bg/programa/ + +Поздрави, +Екипът на <%= @event.conference.title %> diff --git a/app/views/event_mailer/acceptance_second_notification.en.text.erb b/app/views/event_mailer/acceptance_second_notification.en.text.erb new file mode 100644 index 0000000..68228e0 --- /dev/null +++ b/app/views/event_mailer/acceptance_second_notification.en.text.erb @@ -0,0 +1,18 @@ +Hello, + +We want to remind you that that your request for participation in <%= @event.conference.title %> with the <%= @event.class.model_name.human.mb_chars.downcase.to_s %> titled "<%= @event.title %>" was approved. + +Please confirm your participation as soon as you can by following the following link: +<% if @event.is_a? Lecture %> +<%= confirm_lecture_url(@event, locale: 'en') %> +<% elsif @event.is_a? Workshop %> +<%= confirm_workshop_url(@event, locale: 'en') %> +<% end %> + +Please respond to this email in case you have any questions. + +The initial conference schedule can be found here: +http://wwwt.openfest.org/en/schedule/ + +Regards, +The <%= @event.conference.title %> Team