diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 761f42f2f0f257670865d7ac1b308aa1cebd63eb..a7fe8c3d59c43e1a6cddc88ce2304acb8b040405 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -19,10 +19,7 @@ def page_with_sidebar_class end def page_gutter_class - if current_path?('merge_requests#show') || - current_path?('projects/merge_requests/conflicts#show') || - current_path?('issues#show') || - current_path?('milestones#show') + if page_has_markdown? if cookies[:collapsed_gutter] == 'true' %w[page-gutter right-sidebar-collapsed] @@ -50,6 +47,17 @@ def user_dropdown_class class_names end + def show_separator? + Gitlab::Sherlock.enabled? || can?(current_user, :read_instance_statistics) + end + + def page_has_markdown? + current_path?('merge_requests#show') || + current_path?('projects/merge_requests/conflicts#show') || + current_path?('issues#show') || + current_path?('milestones#show') + end + private def get_header_links diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml index 8f8b6b454d9e78a639bd8df85de19f7fae6d4cce..ea5f2b166b4b5c77108fdb955a63f01d49168305 100644 --- a/app/views/layouts/nav/_dashboard.html.haml +++ b/app/views/layouts/nav/_dashboard.html.haml @@ -64,7 +64,7 @@ = link_to '#', class: 'dashboard-shortcuts-web-ide', title: _('Web IDE') do = _('Web IDE') - - if Gitlab::Sherlock.enabled? || can?(current_user, :read_instance_statistics) + - if show_separator? %li.line-separator.d-none.d-sm-block = render_if_exists 'dashboard/operations/nav_link' - if can?(current_user, :read_instance_statistics)