From 9cce812af9e409d83f3c50b9453f3cd63bcfbe71 Mon Sep 17 00:00:00 2001 From: Kushal Pandya Date: Mon, 24 Dec 2018 15:55:21 +0530 Subject: Add `client_detection` helper to add browser and plaform flags --- app/helpers/application_helper.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/helpers/application_helper.rb') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 82bb2d1a805..9efa84b02f0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -268,6 +268,17 @@ module ApplicationHelper _('You are on a read-only GitLab instance.') end + def client_class_list + "gl-browser-#{browser.id} gl-platform-#{browser.platform.id}" + end + + def client_js_flags + { + "is#{browser.id.to_s.titlecase}": true, + "is#{browser.platform.id.to_s.titlecase}": true + } + end + def autocomplete_data_sources(object, noteable_type) return {} unless object && noteable_type -- cgit v1.2.3