Browse Source

Fixed past conference details on the stats page

G0dwin-copy-edits
Godwin 6 years ago
committed by GitHub
parent
commit
0aa67e6aae
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      app/controllers/conference_administration_controller.rb

20
app/controllers/conference_administration_controller.rb

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

Loading…
Cancel
Save