Fixed 404 and 403 errors

This commit is contained in:
Godwin
2016-12-25 09:10:49 -08:00
parent 92a9224716
commit ec06059ce5
8 changed files with 73 additions and 36 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
require 'redcarpet'
module ApplicationHelper
include ScheduleHelper
include RegistrationHelper
@@keyQueue = nil
@@translationsOnThisPage = nil
+31
View File
@@ -0,0 +1,31 @@
module RegistrationHelper
def current_registration_steps(registration = @registration)
return nil unless registration.present?
steps = registration_steps(registration.conference)
current_steps = []
disable_steps = false
completed_steps = registration.steps_completed || []
registration_complete = registration_complete?(registration)
steps.each do | step |
# disable the step if we've already found an incomplete step
enabled = !disable_steps || registration_complete
# record whether or not we've found an incomplete step
disable_steps ||= !completed_steps.include?(step.to_s)
current_steps << {
name: step,
enabled: enabled
}
end
return current_steps
end
def current_step(registration = @registration)
completed_steps = registration.steps_completed || []
(registration_steps(registration.conference) || []).each do | step |
return step unless completed_steps.include?(step.to_s)
end
return registration_steps(registration.conference).last
end
end