Fixed past conference details on the stats page

This commit is contained in:
Godwin 2018-11-08 07:02:45 -08:00 committed by GitHub
parent eb20538beb
commit 0aa67e6aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,11 +342,6 @@ class ConferenceAdministrationController < ApplicationController
end
def administrate_stats
if @this_conference.start_date.blank? || @this_conference.end_date.blank?
@warning_message = :no_date_warning
return
end
get_stats(!request.format.xlsx?)
if request.format.xlsx?
@ -355,6 +350,16 @@ class ConferenceAdministrationController < ApplicationController
format.xlsx { render xlsx: '../conferences/stats', filename: "stats-#{DateTime.now.strftime('%Y-%m-%d')}" }
end
else
@past_conferences = []
Conference.all.order("start_date DESC").each do |conference|
@past_conferences << conference if conference.is_public && @this_conference.id != conference.id
end
if @this_conference.start_date.blank? || @this_conference.end_date.blank?
@warning_message = :no_date_warning
return
end
@registration_count = @registrations.size
@completed_registrations = 0
@bikes = 0
@ -378,11 +383,6 @@ class ConferenceAdministrationController < ApplicationController
end
end
end
@past_conferences = []
Conference.all.order("start_date DESC").each do |conference|
@past_conferences << conference if conference.is_public && @this_conference.id != conference.id
end
end
end