Merge branch 'master' into 2.0

This commit is contained in:
Petko Bordjukov 2016-05-16 03:29:55 +03:00
commit ab4a71319f
4 changed files with 71 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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 %>

View File

@ -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