2018-03-25 12:15:39 -04:00
|
|
|
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
2018-03-25 13:30:42 -04:00
|
|
|
class FrontController < ApplicationController
|
|
|
|
def index
|
2018-05-23 15:42:07 -05:00
|
|
|
if !Nonprofit.any?
|
|
|
|
redirect_to onboard_path
|
|
|
|
elsif current_role?([:nonprofit_admin,:nonprofit_associate])
|
2018-03-25 13:30:42 -04:00
|
|
|
redirect_to NonprofitPath.dashboard(administered_nonprofit)
|
|
|
|
elsif current_user
|
|
|
|
redirect_to '/profiles/' + current_user.profile.id.to_s
|
|
|
|
else
|
2018-05-23 15:42:07 -05:00
|
|
|
redirect_to new_user_session_path
|
2018-03-25 13:30:42 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|