From 6b07685e471eee368e6ebf76587074dd519ed3bf Mon Sep 17 00:00:00 2001 From: Godwin Date: Thu, 18 Aug 2016 09:03:51 -0700 Subject: [PATCH 1/6] Fixed error on Schedule page --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4f9c04f..b1956bd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -547,7 +547,7 @@ class ApplicationController < LinguaFrancaApplicationController end last_event = time end - @schedule[day][:num_locations] = data[:locations].size + @schedule[day][:num_locations] = (data[:locations] || []).size end @schedule.deep_dup.each do | day, data | From 7d89b2689aa927a700b2045c4152988453fe8c89 Mon Sep 17 00:00:00 2001 From: Godwin Date: Thu, 18 Aug 2016 09:05:31 -0700 Subject: [PATCH 2/6] Fixed error on Schedule page --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b1956bd..19ada50 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -572,7 +572,7 @@ class ApplicationController < LinguaFrancaApplicationController @schedule.each do | day, data | @schedule[day][:times] = data[:times].sort.to_h - @schedule[day][:locations][0] = :add if @schedule[day][:locations].size > 0 + @schedule[day][:locations][0] = :add if (@schedule[day][:locations] || []).size > 0 data[:times].each do | time, time_data | if time_data[:type] == :workshop && time_data[:item].present? && time_data[:item][:workshops].present? From 1c1cc3b400a604cc53e59a847bb8f0b1706d92c2 Mon Sep 17 00:00:00 2001 From: Godwin Date: Thu, 18 Aug 2016 09:19:20 -0700 Subject: [PATCH 3/6] Added missing translations for workshop times page --- config/locales/en.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index bc987ad..34b44d7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1309,6 +1309,8 @@ en: deschedule: De-Schedule reschedule: Reschedule schedule_workshop: Schedule + delete_block: Delete + update_block: Update aria: remove_interest: Click if you are no longer interested in this workshop show_interest: Click if you are interested in this workshop From 697b8c5bd5abdc976d9427accb94701ef36957bd Mon Sep 17 00:00:00 2001 From: Godwin Date: Mon, 22 Aug 2016 11:19:45 -0700 Subject: [PATCH 4/6] Fixed error deleting a workshop --- app/controllers/conferences_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index 0f86c0e..2ecaa28 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -1057,7 +1057,7 @@ class ConferencesController < ApplicationController @workshop.destroy end - return redirect_to workshops_url + return redirect_to register_step_path(@this_conference.slug, 'workshops') end return redirect_to view_workshop_url(@this_conference.slug, @workshop.id) end From 48a5c2ce90cb1d68b1c871ee4b1d33a2fd1e0be5 Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 23 Aug 2016 06:38:52 -0700 Subject: [PATCH 5/6] Fixed error on stats page due to nil food option --- app/controllers/conferences_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index 2ecaa28..afe9f41 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -438,8 +438,10 @@ class ConferencesController < ApplicationController @bikes += 1 if r.bike == 'yes' - @food[r.food.to_sym] += 1 - @food[:all] += 1 + if r.food.present? + @food[r.food.to_sym] += 1 + @food[:all] += 1 + end if r.registration_fees_paid.present? && r.registration_fees_paid > 0 @donation_count += 1 From f3eb2322ce89fd9bb3a4ab15f41a36d2f13a3a8f Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 23 Aug 2016 10:14:08 -0700 Subject: [PATCH 6/6] Fixed a bug causing login to fail when referrer is not present --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 19ada50..e11fd09 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -342,7 +342,7 @@ class ApplicationController < LinguaFrancaApplicationController template = 'login_confirmation_sent' @page_title ||= 'page_titles.403.Please_Check_Email' - if (conference = /^\/conferences\/(\w+)\/register\/?$/.match(request.referrer.gsub(/^https?:\/\/.*?\//, '/'))) + if (request.present? && request.referrer.present? && conference = /^\/conferences\/(\w+)\/register\/?$/.match(request.referrer.gsub(/^https?:\/\/.*?\//, '/'))) @this_conference = Conference.find_by!(slug: conference[1]) @banner_image = @this_conference.cover_url template = 'conferences/email_confirm'