Fixed 404 and 403 errors
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
require 'redcarpet'
|
||||
|
||||
module ApplicationHelper
|
||||
include ScheduleHelper
|
||||
include RegistrationHelper
|
||||
|
||||
@@keyQueue = nil
|
||||
@@translationsOnThisPage = nil
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user