Commit ef0297b7 authored by Mario Manno's avatar Mario Manno Committed by Mario Manno

rename public scopes to is_public, since public is reserved

Conflicts:
	app/models/person.rb
parent dc5bc7c3
......@@ -28,12 +28,12 @@ class Public::ScheduleController < ApplicationController
end
@day = @conference.days[@day_index]
@all_rooms = @conference.rooms.public.all
@all_rooms = @conference.rooms.is_public.all
@rooms = Array.new
@events = Hash.new
@skip_row = Hash.new
@all_rooms.each do |room|
events = room.events.confirmed.no_conflicts.public.scheduled_on(@day).order(:start_time).all
events = room.events.confirmed.no_conflicts.is_public.scheduled_on(@day).order(:start_time).all
unless events.empty?
@events[room] = events
@skip_row[room] = 0
......@@ -54,14 +54,14 @@ class Public::ScheduleController < ApplicationController
end
def events
@events = @conference.events.public.confirmed.scheduled.sort {|a,b|
@events = @conference.events.is_public.confirmed.scheduled.sort {|a,b|
a.to_sortable <=> b.to_sortable
}
end
def event
@event = @conference.events.public.confirmed.scheduled.find(params[:id])
@concurrent_events = @conference.events.public.confirmed.scheduled.where( start_time: @event.start_time )
@event = @conference.events.is_public.confirmed.scheduled.find(params[:id])
@concurrent_events = @conference.events.is_public.confirmed.scheduled.where( start_time: @event.start_time )
respond_to do |format|
format.html
format.ics
......
......@@ -139,7 +139,7 @@ class ReportsController < ApplicationController
@labels = %w{Day FullName PublicName Email Event Role State} # TODO translate
@conference.days.each do |day|
@conference.events.confirmed.no_conflicts.public.scheduled_on(day).order(:start_time).each do |event|
@conference.events.confirmed.no_conflicts.is_public.scheduled_on(day).order(:start_time).each do |event|
event.event_people.presenter.each do |event_person|
person = event_person.person
row = [ l(day.date), person.full_name, person.public_name, person.email, event.title, event_person.event_role, event_person.role_state ]
......
......@@ -38,7 +38,7 @@ class ScheduleController < ApplicationController
authorize! :read, Event
@page_size = params[:page_size]
@day = @conference.days.find(params[:date_id])
@rooms = @conference.rooms.public.find(params[:room_ids])
@rooms = @conference.rooms.is_public.find(params[:room_ids])
@events = Hash.new
@rooms.each do |room|
@events[room] = room.events.accepted.is_public.scheduled_on(@day).order(:start_time).all
......
......@@ -8,7 +8,7 @@ class EventAttachment < ActiveRecord::Base
has_paper_trail meta: {associated_id: :event_id, associated_type: "Event"}
scope :public, -> { where(public: true) }
scope :is_public, -> { where(public: true) }
def link_title
if self.title.present?
......
......@@ -101,7 +101,7 @@ class Person < ActiveRecord::Base
end
def public_and_accepted_events_as_speaker_in(conference)
self.events.public.accepted.where(:"events.state" => :confirmed, :"event_people.event_role" => ["speaker", "moderator"], conference_id: conference.id).all
self.events.is_public.accepted.where(:"events.state" => :confirmed, :"event_people.event_role" => ["speaker", "moderator"], conference_id: conference.id).all
end
def role_state(conference)
......
......@@ -60,11 +60,11 @@
- @event.links.each do |link|
= link_to link.title, link.url
%br/
- unless @event.event_attachments.public.empty?
- unless @event.event_attachments.is_public.empty?
%p
%b #{t('publich.schedule.files')}:
%br/
- @event.event_attachments.public.each do |attachment|
- @event.event_attachments.is_public.each do |attachment|
= link_to attachment.link_title, attachment.attachment.url
%br/
.span10
......
......@@ -36,10 +36,10 @@
%li= link_to "iCalendar", public_event_path(id: @event.id, format: :ics)
- @event.links.each do |link|
%li= link_to link.title, link.url
- if @event.event_attachments.public.any?
- if @event.event_attachments.is_public.any?
%h3= t '.files'
%ul
- @event.event_attachments.public.each do |attachment|
- @event.event_attachments.is_public.each do |attachment|
%li= link_to attachment.link_title, attachment.attachment.url
- if @conference.feedback_enabled?
%h3= t '.feedback'
......
@conference.events.public.accepted.order(:title).each do |event|
@conference.events.is_public.accepted.order(:title).each do |event|
next if event.start_time.nil?
cal.event do |e|
e.dtstamp = event.updated_at
......
......@@ -16,8 +16,8 @@ json.schedule do
json.day_start day.start_date.iso8601
json.day_end day.end_date.iso8601
json.rooms do
@conference.rooms.public.each do |room|
json.set! room.name, room.events.public.accepted.scheduled_on(day).order(:start_time) do |event|
@conference.rooms.is_public.each do |room|
json.set! room.name, room.events.is_public.accepted.scheduled_on(day).order(:start_time) do |event|
json.id event.id
json.guid event.guid
json.logo event.logo_path
......
......@@ -6,7 +6,7 @@
%x-wr-caldesc= "#{@conference.acronym} Schedule"
%x-wr-calname= "#{@conference.acronym} Schedule"
- @conference.events.accepted.public.each do |event|
- @conference.events.accepted.is_public.each do |event|
- next unless event.start_time
%vevent
%method= "PUBLISH"
......
......@@ -12,9 +12,9 @@
%timeslot_duration= duration_to_time(@conference.timeslot_duration)
- @conference.days.each_with_index do |day, index|
%day{index: (index + 1), date: day.start_date.strftime('%Y-%m-%d'), start: day.start_date.iso8601, end: day.end_date.iso8601}
- @conference.rooms.public.each do |room|
- @conference.rooms.is_public.each do |room|
%room{:name => room.name}
- room.events.public.accepted.scheduled_on(day).order(:start_time).each do |event|
- room.events.is_public.accepted.scheduled_on(day).order(:start_time).each do |event|
%event{:id=>event.id, :guid=>event.guid}
%date= event.start_time.iso8601
%start= event.start_time.strftime('%H:%M')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment