class ApplicationController
Public Instance Methods
Source
# File app/controllers/application_controller.rb, line 40 def current_organisation = current_user&.selected_organisation def current_team = current_user&.selected_team helper_method :current_organisation, :current_team private def ensure_team_is_selected redirect_to new_users_teams_path if current_user && cis2_info.team.nil? end def set_header_path @header_path = dashboard_path end def set_assets_name @assets_name = "application" end def set_theme_colour @theme_colour = HostingEnvironment.theme_colour end def set_service_name @service_name = "Manage vaccinations in schools" @service_name_with_abbreviation = "Manage vaccinations in schools (Mavis)" @sub_service_name = ("National reporting" if current_team&.has_national_reporting_access?) end def set_service_url @service_url = "https://www.manage-vaccinations-in-schools.nhs.uk" end def set_disable_cache_headers response.headers["Cache-Control"] = "no-store" response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "0" end def handle_unprocessable_entity render "errors/unprocessable_entity", status: :unprocessable_content end def user_not_authorized flash[:alert] = "You are not authorized to perform this action." redirect_back_or_to dashboard_path, allow_other_host: false end def set_service_guide_url base_url = "https://guide.manage-vaccinations-in-schools.nhs.uk" @service_guide_url = if current_team&.has_national_reporting_access? "#{base_url}/national-reporting/" else base_url end end def set_privacy_policy_url @privacy_policy_url = nil end def set_sentry_user Sentry.set_user(id: current_user&.id) end
Source
# File app/controllers/application_controller.rb, line 42 def current_team = current_user&.selected_team helper_method :current_organisation, :current_team private def ensure_team_is_selected redirect_to new_users_teams_path if current_user && cis2_info.team.nil? end def set_header_path @header_path = dashboard_path end def set_assets_name @assets_name = "application" end def set_theme_colour @theme_colour = HostingEnvironment.theme_colour end def set_service_name @service_name = "Manage vaccinations in schools" @service_name_with_abbreviation = "Manage vaccinations in schools (Mavis)" @sub_service_name = ("National reporting" if current_team&.has_national_reporting_access?) end def set_service_url @service_url = "https://www.manage-vaccinations-in-schools.nhs.uk" end def set_disable_cache_headers response.headers["Cache-Control"] = "no-store" response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "0" end def handle_unprocessable_entity render "errors/unprocessable_entity", status: :unprocessable_content end def user_not_authorized flash[:alert] = "You are not authorized to perform this action." redirect_back_or_to dashboard_path, allow_other_host: false end def set_service_guide_url base_url = "https://guide.manage-vaccinations-in-schools.nhs.uk" @service_guide_url = if current_team&.has_national_reporting_access? "#{base_url}/national-reporting/" else base_url end end def set_privacy_policy_url @privacy_policy_url = nil end def set_sentry_user Sentry.set_user(id: current_user&.id) end end
Source
# File app/controllers/application_controller.rb, line 48 def ensure_team_is_selected redirect_to new_users_teams_path if current_user && cis2_info.team.nil? end
Source
# File app/controllers/application_controller.rb, line 81 def handle_unprocessable_entity render "errors/unprocessable_entity", status: :unprocessable_content end
Source
# File app/controllers/application_controller.rb, line 56 def set_assets_name @assets_name = "application" end
Source
# File app/controllers/application_controller.rb, line 75 def set_disable_cache_headers response.headers["Cache-Control"] = "no-store" response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "0" end
Source
# File app/controllers/application_controller.rb, line 52 def set_header_path @header_path = dashboard_path end
Source
# File app/controllers/application_controller.rb, line 100 def set_privacy_policy_url @privacy_policy_url = nil end
Source
# File app/controllers/application_controller.rb, line 104 def set_sentry_user Sentry.set_user(id: current_user&.id) end
Source
# File app/controllers/application_controller.rb, line 90 def set_service_guide_url base_url = "https://guide.manage-vaccinations-in-schools.nhs.uk" @service_guide_url = if current_team&.has_national_reporting_access? "#{base_url}/national-reporting/" else base_url end end
Source
# File app/controllers/application_controller.rb, line 64 def set_service_name @service_name = "Manage vaccinations in schools" @service_name_with_abbreviation = "Manage vaccinations in schools (Mavis)" @sub_service_name = ("National reporting" if current_team&.has_national_reporting_access?) end
Source
# File app/controllers/application_controller.rb, line 71 def set_service_url @service_url = "https://www.manage-vaccinations-in-schools.nhs.uk" end
Source
# File app/controllers/application_controller.rb, line 60 def set_theme_colour @theme_colour = HostingEnvironment.theme_colour end