diff --git a/CHANGELOG b/CHANGELOG index 4b78d1218ca53f903fdddbb807defe8c67ede133..80399bc0d41f3a5861705b150b2ab6175db57af3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,8 +13,9 @@ v 7.7.0 - - - + - Add alert message in case of outdated browser (IE < 10) + - - - v 7.6.0 @@ -62,7 +63,7 @@ v 7.5.0 - Performance improvements - Fix post-receive issue for projects with deleted forks - New gitlab-shell version with custom hooks support - - Improve code + - Improve code - GitLab CI 5.2+ support (does not support older versions) - Fixed bug when you can not push commits starting with 000000 to protected branches - Added a password strength indicator diff --git a/Gemfile b/Gemfile index ce9b83308f3dc623a122a3d686cdc97df5fc400d..99f14a174c1c267b37a9ab17005b76fe6f1c8e97 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,9 @@ gem 'omniauth-github' gem 'omniauth-shibboleth' gem 'omniauth-kerberos' +# Browser detection +gem "browser" + # Extracting information from a git repository # Provide access to Gitlab::Git library gem "gitlab_git", '7.0.0.rc12' diff --git a/Gemfile.lock b/Gemfile.lock index cf96677f875f1ce5b7adadb34c9844a316d069f2..84156a73d199032d1e667b450219dbc5dfaeffdc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,6 +49,7 @@ GEM debug_inspector (>= 0.0.1) bootstrap-sass (3.0.3.0) sass (~> 3.2) + browser (0.7.2) builder (3.2.2) capybara (2.2.1) mime-types (>= 1.16) @@ -604,6 +605,7 @@ DEPENDENCIES better_errors binding_of_caller bootstrap-sass (~> 3.0) + browser capybara (~> 2.2.1) carrierwave coffee-rails diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 2fc738c18d84669529ff995367b0f3f50747d0fc..f3879defb7758087004d37abd57848e9ba9a0b33 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -227,6 +227,18 @@ li.note { } } +.browser-alert { + padding: 10px; + text-align: center; + background: #C67; + color: #fff; + font-weight: bold; + a { + color: #fff; + text-decoration: underline; + } +} + .warning_message { border-left: 4px solid #ed9; color: #b90; diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 90cc58f44b7de9f463dabbc3f74f8b08ee49bc20..54caaa0f7e54e03a46fc79bb5d76278501ef1a50 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -293,4 +293,8 @@ module ApplicationHelper path << "?#{options.to_param}" path end + + def outdated_browser? + browser.ie? && browser.version.to_i < 10 + end end diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index eda37f8237a07b59960a834d07601941649980fe..e98b8ec631d203fff39c3b5b7259fd4181c1c9ba 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -44,3 +44,5 @@ %li.hidden-xs = link_to current_user, class: "profile-pic", id: 'profile-pic' do = image_tag avatar_icon(current_user.email, 26), alt: 'User activity' + += render 'shared/outdated_browser' diff --git a/app/views/layouts/_public_head_panel.html.haml b/app/views/layouts/_public_head_panel.html.haml index 9bfc14d16c1b6ff6dc3546ba89fe729ec5c477dc..02a5e4868d1c462cbaf8607f861f602d70326f7a 100644 --- a/app/views/layouts/_public_head_panel.html.haml +++ b/app/views/layouts/_public_head_panel.html.haml @@ -20,3 +20,4 @@ %li.visible-xs = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes') += render 'shared/outdated_browser' diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml index 06de03eadad967ba3e8047ae12fb58cfdc2a5718..6539a24119c5eb34ccabfff95eb37656bbebcf4b 100644 --- a/app/views/layouts/devise.html.haml +++ b/app/views/layouts/devise.html.haml @@ -6,6 +6,7 @@ .content .login-title %h1= brand_title + = render 'shared/outdated_browser' %hr .container .content diff --git a/app/views/shared/_outdated_browser.html.haml b/app/views/shared/_outdated_browser.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..0eba1fe075f35762dbe37f0bae29c77dbfe02db7 --- /dev/null +++ b/app/views/shared/_outdated_browser.html.haml @@ -0,0 +1,8 @@ +- if outdated_browser? + - link = "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/requirements.md#supported-web-browsers" + .browser-alert + GitLab may not work properly because you are using an outdated web browser. + %br + Please install a + = link_to 'supported web browser', link + for a better experience.