diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/views/layouts | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_head.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/_loading_hints.html.haml | 10 | ||||
-rw-r--r-- | app/views/layouts/_mailer.html.haml | 1 | ||||
-rw-r--r-- | app/views/layouts/_page.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/_recaptcha_verification.html.haml | 10 | ||||
-rw-r--r-- | app/views/layouts/header/_default.html.haml | 28 | ||||
-rw-r--r-- | app/views/layouts/header/_service_templates_deprecation_callout.html.haml | 21 | ||||
-rw-r--r-- | app/views/layouts/nav/_dashboard.html.haml | 90 | ||||
-rw-r--r-- | app/views/layouts/nav/_explore.html.haml | 19 | ||||
-rw-r--r-- | app/views/layouts/nav/_top_nav_responsive.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/nav/groups_dropdown/_show.html.haml | 23 | ||||
-rw-r--r-- | app/views/layouts/nav/projects_dropdown/_show.html.haml | 28 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_analytics_links.html.haml | 22 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_group_menus.html.haml | 163 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_wiki_link.html.haml | 11 |
15 files changed, 20 insertions, 413 deletions
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 683d3a6ad1b..a89c621a55c 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -44,7 +44,7 @@ - else = stylesheet_link_tag_defer "application" = yield :page_specific_styles - = stylesheet_link_tag_defer "application_utilities" + = stylesheet_link_tag_defer 'application_utilities' = stylesheet_link_tag "disable_animations", media: "all" if Rails.env.test? || Gitlab.config.gitlab['disable_animations'] = stylesheet_link_tag "test_environment", media: "all" if Rails.env.test? diff --git a/app/views/layouts/_loading_hints.html.haml b/app/views/layouts/_loading_hints.html.haml index c431f05c217..e2189009045 100644 --- a/app/views/layouts/_loading_hints.html.haml +++ b/app/views/layouts/_loading_hints.html.haml @@ -1,11 +1,15 @@ = cache_if(Feature.enabled?(:cached_loading_hints, current_user), [ActionController::Base.asset_host, user_application_theme, user_color_scheme], expires_in: 1.minute) do + - css_crossorigin = ActionController::Base.asset_host ? 'anonymous' : nil + - if ActionController::Base.asset_host %link{ rel: 'dns-prefetch', href: ActionController::Base.asset_host } %link{ rel: 'preconnect', href: ActionController::Base.asset_host, crossorigin: '' } - if user_application_theme == 'gl-dark' - %link{ { rel: 'preload', href: stylesheet_url('application_dark'), as: 'style' }, ActionController::Base.asset_host ? { crossorigin: 'anonymous' } : {} } + = preload_link_tag(path_to_stylesheet('application_utilities_dark'), crossorigin: css_crossorigin) + = preload_link_tag(path_to_stylesheet('application_dark'), crossorigin: css_crossorigin) - else - %link{ { rel: 'preload', href: stylesheet_url('application'), as: 'style' }, ActionController::Base.asset_host ? { crossorigin: 'anonymous' } : {} } - %link{ { rel: 'preload', href: stylesheet_url("highlight/themes/#{user_color_scheme}"), as: 'style' }, ActionController::Base.asset_host ? { crossorigin: 'anonymous' } : {} } + = preload_link_tag(path_to_stylesheet('application_utilities'), crossorigin: css_crossorigin) + = preload_link_tag(path_to_stylesheet('application'), crossorigin: css_crossorigin) + = preload_link_tag(path_to_stylesheet("highlight/themes/#{user_color_scheme}"), crossorigin: css_crossorigin) - if Gitlab::Tracking.enabled? && Gitlab::CurrentSettings.snowplow_collector_hostname %link{ rel: 'preconnect', href: Gitlab::CurrentSettings.snowplow_collector_hostname, crossorigin: '' } diff --git a/app/views/layouts/_mailer.html.haml b/app/views/layouts/_mailer.html.haml index 74d05be7f95..95ebe09a2e6 100644 --- a/app/views/layouts/_mailer.html.haml +++ b/app/views/layouts/_mailer.html.haml @@ -14,6 +14,7 @@ = stylesheet_link_tag 'mailer.css' %body + = yield :preview_text %table#body{ border: "0", cellpadding: "0", cellspacing: "0" } %tbody %tr.line diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 6c959f5e60c..ba2d6aa79eb 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -11,7 +11,6 @@ = render "layouts/broadcast" = render "layouts/header/read_only_banner" = render "layouts/header/registration_enabled_callout" - = render "layouts/header/service_templates_deprecation_callout" = render "layouts/nav/classification_level_banner" = yield :flash_message = render "shared/service_ping_consent" @@ -29,5 +28,7 @@ = yield :before_content = yield = yield :after_content + -# This is needed by [GitLab JH](https://gitlab.com/gitlab-jh/jh-team/gitlab-cn/-/issues/81) + = render_if_exists "shared/footer/global_footer" = render "layouts/nav/top_nav_responsive", class: 'layout-page content-wrapper-margin' diff --git a/app/views/layouts/_recaptcha_verification.html.haml b/app/views/layouts/_recaptcha_verification.html.haml deleted file mode 100644 index 3405fb9d5ef..00000000000 --- a/app/views/layouts/_recaptcha_verification.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -- humanized_resource_name = spammable.class.model_name.human.downcase - -%h3.page-title - = _('Anti-spam verification') -%hr - -%p - = _("We detected potential spam in the %{humanized_resource_name}. Please solve the reCAPTCHA to proceed.") % { humanized_resource_name: humanized_resource_name } - -= render 'shared/recaptcha_form', spammable: spammable diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 87580e57e75..2f6287bdfb3 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -1,12 +1,11 @@ - has_impersonation_link = header_link?(:admin_impersonation) - user_status_data = user_status_properties(current_user) -- use_top_nav_redesign = Feature.enabled?(:combined_menu, current_user, default_enabled: :yaml) %header.navbar.navbar-gitlab.navbar-expand-sm.js-navbar{ data: { qa_selector: 'navbar' } } %a.gl-sr-only.gl-accessibility{ href: "#content-body" } Skip to content .container-fluid .header-content - .title-container.hide-when-menu-expanded + .title-container.hide-when-top-nav-responsive-open %h1.title %span.gl-sr-only GitLab = link_to root_path, title: _('Dashboard'), id: 'logo', **tracking_attrs('main_navigation', 'click_gitlab_logo_link', 'navigation') do @@ -20,24 +19,18 @@ %span.gl-badge.gl-bg-green-500.gl-text-white.gl-rounded-pill.gl-font-weight-bold.gl-py-1 = _('Next') - - if use_top_nav_redesign - .gl-display-none.gl-sm-display-block - = render "layouts/nav/top_nav" - - else - - if current_user - = render "layouts/nav/dashboard" - - else - = render "layouts/nav/explore" + .gl-display-none.gl-sm-display-block + = render "layouts/nav/top_nav" .navbar-collapse.collapse %ul.nav.navbar-nav - if current_user - = render 'layouts/header/new_dropdown', class: ('gl-display-none gl-sm-display-block' if use_top_nav_redesign) + = render 'layouts/header/new_dropdown', class: 'gl-display-none gl-sm-display-block' - if top_nav_show_search - search_menu_item = top_nav_search_menu_item_attrs %li.nav-item.d-none.d-lg-block.m-auto = render 'layouts/search' unless current_controller?(:search) - %li.nav-item{ class: use_top_nav_redesign ? 'd-none d-sm-inline-block d-lg-none' : 'd-inline-block d-lg-none' } + %li.nav-item{ class: 'd-none d-sm-inline-block d-lg-none' } = link_to search_menu_item.fetch(:href), title: search_menu_item.fetch(:title), aria: { label: search_menu_item.fetch(:title) }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = sprite_icon(search_menu_item.fetch(:icon)) - if header_link?(:issues) @@ -118,14 +111,11 @@ - sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in') = link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'gl-button btn btn-default btn-sign-in' - %button.navbar-toggler.d-block.d-sm-none{ type: 'button', class: ('gl-border-none!' if use_top_nav_redesign) } + %button.navbar-toggler.d-block.d-sm-none{ type: 'button', class: 'gl-border-none!', data: { testid: 'top-nav-responsive-toggle' } } %span.sr-only= _('Toggle navigation') - - if use_top_nav_redesign - %span.more-icon.gl-px-3.gl-font-sm.gl-font-weight-bold - %span.gl-pr-2= _('Menu') - = sprite_icon('hamburger', size: 16) - - else - = sprite_icon('ellipsis_h', size: 12, css_class: 'more-icon') + %span.more-icon.gl-px-3.gl-font-sm.gl-font-weight-bold + %span.gl-pr-2= _('Menu') + = sprite_icon('hamburger', size: 16) = sprite_icon('close', size: 12, css_class: 'close-icon') - if display_whats_new? diff --git a/app/views/layouts/header/_service_templates_deprecation_callout.html.haml b/app/views/layouts/header/_service_templates_deprecation_callout.html.haml deleted file mode 100644 index 056d4426d5a..00000000000 --- a/app/views/layouts/header/_service_templates_deprecation_callout.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -- return unless show_service_templates_deprecated_callout? - -- doc_link_start = "<a href=\"#{integrations_help_page_path}\" target='_blank' rel='noopener noreferrer'>".html_safe -- settings_link_start = "<a href=\"#{integrations_admin_application_settings_path}\">".html_safe - -%div{ class: [container_class, @content_class, 'gl-pt-5!'] } - .gl-alert.gl-alert-warning.js-service-templates-deprecated-callout{ role: 'alert', data: { feature_id: UserCalloutsHelper::SERVICE_TEMPLATES_DEPRECATED_CALLOUT, dismiss_endpoint: user_callouts_path } } - = sprite_icon('warning', size: 16, css_class: 'gl-alert-icon') - %button.gl-alert-dismiss.js-close{ type: 'button', aria: { label: _('Close') }, data: { testid: 'close-service-templates-deprecated-callout' } } - = sprite_icon('close', size: 16) - .gl-alert-title - = s_('AdminSettings|Service templates are deprecated and will be removed in GitLab 14.0.') - .gl-alert-body - = html_escape_once(s_('AdminSettings|You should migrate to %{doc_link_start}Project integration management%{link_end}, available at %{settings_link_start}Settings > Integrations.%{link_end}')).html_safe % { doc_link_start: doc_link_start, settings_link_start: settings_link_start, link_end: '</a>'.html_safe } - .gl-alert-actions - = link_to admin_application_settings_services_path, class: 'btn gl-alert-action btn-info btn-md gl-button' do - %span.gl-button-text - = s_('AdminSettings|See affected service templates') - = link_to "https://gitlab.com/gitlab-org/gitlab/-/issues/325905", class: 'btn gl-alert-action btn-default btn-md gl-button', target: '_blank', rel: 'noopener noreferrer' do - %span.gl-button-text - = _('Leave feedback') diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml deleted file mode 100644 index e4cdb4e1b08..00000000000 --- a/app/views/layouts/nav/_dashboard.html.haml +++ /dev/null @@ -1,90 +0,0 @@ --# WARNING! This file is slated to be removed along with the `combined_menu` --# feature flag. The logic here will be migrated to an upcoming `top_nav_helper`. --# Please see [this MR][1] for more context. --# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587 -%ul.list-unstyled.navbar-sub-nav - - if dashboard_nav_link?(:projects) - = nav_link(path: ['root#index', 'projects#trending', 'projects#starred', 'dashboard/projects#index'], html_options: { id: 'nav-projects-dropdown', class: "home dropdown header-projects", data: { track_label: "projects_dropdown", track_event: "click_dropdown" } }) do - %button{ type: 'button', data: { toggle: "dropdown" } } - = _('Projects') - = sprite_icon('chevron-down', css_class: 'caret-down') - .dropdown-menu.frequent-items-dropdown-menu - = render "layouts/nav/projects_dropdown/show" - - - if dashboard_nav_link?(:groups) - = nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { id: 'nav-groups-dropdown', class: "d-none d-md-block home dropdown header-groups", data: { track_label: "groups_dropdown", track_event: "click_dropdown" } }) do - %button{ type: 'button', data: { toggle: "dropdown" } } - = _('Groups') - = sprite_icon('chevron-down', css_class: 'caret-down') - .dropdown-menu.frequent-items-dropdown-menu - = render "layouts/nav/groups_dropdown/show" - - - if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets]) - = nav_link(html_options: { id: 'nav-more-dropdown', class: "header-more dropdown", data: { track_label: "more_dropdown", track_event: "click_more_link" } }) do - %a{ href: "#", data: { toggle: "dropdown" } } - = _('More') - = sprite_icon('chevron-down', css_class: 'caret-down') - .dropdown-menu - %ul - - if dashboard_nav_link?(:groups) - %li.d-md-none - = link_to dashboard_groups_path, class: 'dashboard-shortcuts-groups' do - = _('Groups') - - if dashboard_nav_link?(:activity) - = nav_link(path: 'dashboard#activity') do - = link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity' do - = _('Activity') - - - if dashboard_nav_link?(:milestones) - = nav_link(controller: 'dashboard/milestones') do - = link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones' do - = _('Milestones') - - - if dashboard_nav_link?(:snippets) - = nav_link(controller: 'dashboard/snippets') do - = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets' do - = _('Snippets') - - %li.dropdown - = render_if_exists 'dashboard/nav_link_list' - - - if current_user.admin? - = nav_link(controller: 'admin/dashboard') do - = link_to admin_root_path, class: 'admin-icon d-xl-none' do - = _('Admin Area') - - if Gitlab::CurrentSettings.admin_mode - - if header_link?(:admin_mode) - = nav_link(controller: 'admin/sessions') do - = link_to destroy_admin_session_path, method: :post, class: 'd-lg-none lock-open-icon' do - = _('Leave Admin Mode') - - elsif current_user.admin? - = nav_link(controller: 'admin/sessions') do - = link_to new_admin_session_path, class: 'd-lg-none lock-icon' do - = _('Enter Admin Mode') - - if Gitlab::Sherlock.enabled? - %li - = link_to sherlock_transactions_path, class: 'admin-icon' do - = _('Sherlock Transactions') - - - if current_user.admin? - = nav_link(controller: 'admin/dashboard', html_options: { class: "d-none d-xl-block"}) do - = link_to admin_root_path, class: 'admin-icon', title: _('Admin Area'), aria: { label: _('Admin Area') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = sprite_icon('admin', size: 18) - - - if Gitlab::CurrentSettings.admin_mode - - if header_link?(:admin_mode) - = nav_link(controller: 'admin/sessions', html_options: { class: "d-none d-lg-block"}) do - = link_to destroy_admin_session_path, method: :post, title: _('Leave Admin Mode'), aria: { label: _('Leave Admin Mode') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do - = sprite_icon('lock-open', size: 18) - - elsif current_user.admin? - = nav_link(controller: 'admin/sessions', html_options: { class: "d-none d-lg-block"}) do - = link_to new_admin_session_path, title: _('Enter Admin Mode'), aria: { label: _('Enter Admin Mode') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do - = sprite_icon('lock', size: 18) - - -# Shortcut to Dashboard > Projects - - if dashboard_nav_link?(:projects) - %li.hidden - = link_to dashboard_projects_path, class: 'dashboard-shortcuts-projects' do - = _('Projects') - - = render_if_exists 'layouts/nav/geo_primary_node_url' diff --git a/app/views/layouts/nav/_explore.html.haml b/app/views/layouts/nav/_explore.html.haml deleted file mode 100644 index 5b47eb27b04..00000000000 --- a/app/views/layouts/nav/_explore.html.haml +++ /dev/null @@ -1,19 +0,0 @@ --# WARNING! This file is slated to be removed along with the `combined_menu` --# feature flag. The logic here will be migrated to an upcoming `top_nav_helper`. --# Please see [this MR][1] for more context. --# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587 -%ul.list-unstyled.navbar-sub-nav - - if explore_nav_link?(:projects) - = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do - = link_to explore_root_path, title: _('Projects'), class: 'dashboard-shortcuts-projects' do - = _('Projects') - - if explore_nav_link?(:groups) - = nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do - = link_to explore_groups_path, title: _('Groups'), class: 'dashboard-shortcuts-groups' do - = _('Groups') - - if explore_nav_link?(:snippets) - = nav_link(controller: :snippets) do - = link_to explore_snippets_path, title: _('Snippets'), class: 'dashboard-shortcuts-snippets' do - = _('Snippets') - %li - = link_to _("Help"), help_path, title: _('About GitLab CE') diff --git a/app/views/layouts/nav/_top_nav_responsive.html.haml b/app/views/layouts/nav/_top_nav_responsive.html.haml index 0d122f1adff..86fd8b6d80c 100644 --- a/app/views/layouts/nav/_top_nav_responsive.html.haml +++ b/app/views/layouts/nav/_top_nav_responsive.html.haml @@ -1,5 +1,3 @@ -- return unless Feature.enabled?(:combined_menu, current_user, default_enabled: :yaml) - - top_class = local_assigns.fetch(:class, nil) - view_model = top_nav_responsive_view_model(project: @project, group: @group) diff --git a/app/views/layouts/nav/groups_dropdown/_show.html.haml b/app/views/layouts/nav/groups_dropdown/_show.html.haml deleted file mode 100644 index d7b0c7150d4..00000000000 --- a/app/views/layouts/nav/groups_dropdown/_show.html.haml +++ /dev/null @@ -1,23 +0,0 @@ --# WARNING! This file is slated to be removed along with the `combined_menu` --# feature flag. The logic here will be migrated to an upcoming `top_nav_helper`. --# Please see [this MR][1] for more context. --# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587 -- group_meta = { id: @group.id, name: @group.name, namespace: @group.full_name, web_url: group_path(@group), avatar_url: @group.avatar_url } if @group&.persisted? -.frequent-items-dropdown-container.with-deprecated-styles - .frequent-items-dropdown-sidebar - %ul - = nav_link(path: 'dashboard/groups#index') do - = link_to dashboard_groups_path, data: { track_label: "groups_dropdown_your_groups", track_event: "click_link" } do - = _('Your groups') - = nav_link(path: 'groups#explore') do - = link_to explore_groups_path, data: { track_label: "groups_dropdown_explore_groups", track_event: "click_link" } do - = _('Explore groups') - - if current_user.can_create_group? - = nav_link(path: 'groups/new#create-group-pane', html_options: { class: 'gl-border-0 gl-border-t-1 gl-border-solid gl-border-gray-100' }) do - = link_to new_group_path(anchor: 'create-group-pane'), data: { track_label: "groups_dropdown_create_group", track_event: "click_link" } do - = _('Create group') - = nav_link(path: 'groups/new#import-group-pane') do - = link_to new_group_path(anchor: 'import-group-pane'), data: { track_label: "groups_dropdown_import_group", track_event: "click_link" } do - = _('Import group') - .frequent-items-dropdown-content - #js-groups-dropdown{ data: { user_name: current_user.username, group: group_meta } } diff --git a/app/views/layouts/nav/projects_dropdown/_show.html.haml b/app/views/layouts/nav/projects_dropdown/_show.html.haml deleted file mode 100644 index f16aab92a95..00000000000 --- a/app/views/layouts/nav/projects_dropdown/_show.html.haml +++ /dev/null @@ -1,28 +0,0 @@ --# WARNING! This file is slated to be removed along with the `combined_menu` --# feature flag. The logic here will be migrated to an upcoming `top_nav_helper`. --# Please see [this MR][1] for more context. --# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587 -- project_meta = { id: @project.id, name: @project.name, namespace: @project.full_name, web_url: project_path(@project), avatar_url: @project.avatar_url } if @project&.persisted? -.frequent-items-dropdown-container.with-deprecated-styles - .frequent-items-dropdown-sidebar - %ul - = nav_link(path: 'dashboard/projects#index') do - = link_to dashboard_projects_path, data: { track_label: "projects_dropdown_your_projects", track_event: "click_link" } do - = _('Your projects') - = nav_link(path: 'projects#starred') do - = link_to starred_dashboard_projects_path, data: { track_label: "projects_dropdown_starred_projects", track_event: "click_link" } do - = _('Starred projects') - = nav_link(path: 'projects#trending') do - = link_to explore_root_path, data: { track_label: "projects_dropdown_explore_projects", track_event: "click_link" } do - = _('Explore projects') - = nav_link(path: 'projects/new#blank_project', html_options: { class: 'gl-border-0 gl-border-t-1 gl-border-solid gl-border-gray-100' }) do - = link_to new_project_path(anchor: 'blank_project'), data: { track_label: "projects_dropdown_blank_project", track_event: "click_link", qa_selector: "create_project_link" } do - = _('Create blank project') - = nav_link(path: 'projects/new#import_project') do - = link_to new_project_path(anchor: 'import_project'), data: { track_label: "projects_dropdown_import_project", track_event: "click_link", qa_selector: "import_project_link" } do - = _('Import project') - = nav_link(path: 'projects/new#create_from_template') do - = link_to new_project_path(anchor: 'create_from_template'), data: { track_label: "projects_dropdown_create_from_template", track_event: "click_link" } do - = _('Create from template') - .frequent-items-dropdown-content - #js-projects-dropdown{ data: { user_name: current_user.username, project: project_meta } } diff --git a/app/views/layouts/nav/sidebar/_analytics_links.html.haml b/app/views/layouts/nav/sidebar/_analytics_links.html.haml deleted file mode 100644 index 92a7b97203f..00000000000 --- a/app/views/layouts/nav/sidebar/_analytics_links.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -- navbar_links = links.sort_by(&:title) -- all_paths = navbar_links.map(&:path) -- analytics_link = navbar_links.find { |link| link.title == _('Value stream') } || navbar_links.first - -- if navbar_links.any? - = nav_link(path: all_paths) do - = link_to analytics_link.link, {class: 'shortcuts-analytics has-sub-items', data: { qa_selector: 'analytics_anchor' } } do - .nav-icon-container - = sprite_icon('chart') - %span.nav-item-name{ data: { qa_selector: 'analytics_link' } } - = _('Analytics') - - %ul.sidebar-sub-level-items{ data: { qa_selector: 'analytics_sidebar_submenu' } } - = nav_link(path: analytics_link.path, html_options: { class: "fly-out-top-item" } ) do - = link_to analytics_link.link do - %strong.fly-out-top-item-name - = _('Analytics') - %li.divider.fly-out-top-item - - navbar_links.each do |menu_item| - = nav_link(path: menu_item.path) do - = link_to(menu_item.link, menu_item.link_to_options) do - %span= menu_item.title diff --git a/app/views/layouts/nav/sidebar/_group_menus.html.haml b/app/views/layouts/nav/sidebar/_group_menus.html.haml index 5738c8becd5..25b6c264d92 100644 --- a/app/views/layouts/nav/sidebar/_group_menus.html.haml +++ b/app/views/layouts/nav/sidebar/_group_menus.html.haml @@ -1,166 +1,3 @@ -- issues_count = cached_issuables_count(@group, type: :issues) -- merge_requests_count = cached_issuables_count(@group, type: :merge_requests) - -= render_if_exists 'layouts/nav/sidebar/group_trial_status_widget', group: @group - -- if group_sidebar_link?(:overview) - - paths = group_overview_nav_link_paths - = nav_link(path: paths, unless: -> { current_path?('groups/contribution_analytics#show') }, html_options: { class: 'home' }) do - = link_to activity_group_path(@group), class: 'has-sub-items', data: { qa_selector: 'group_information_link' } do - .nav-icon-container - = sprite_icon('group') - %span.nav-item-name - = group_information_title(@group) - - %ul.sidebar-sub-level-items{ data: { qa_selector: 'group_information_submenu'} } - = nav_link(path: paths, html_options: { class: "fly-out-top-item" } ) do - = link_to activity_group_path(@group) do - %strong.fly-out-top-item-name - = group_information_title(@group) - %li.divider.fly-out-top-item - - - if group_sidebar_link?(:activity) - = nav_link(path: 'groups#activity') do - = link_to activity_group_path(@group), title: _('Activity') do - %span - = _('Activity') - - - if group_sidebar_link?(:labels) - = nav_link(path: 'labels#index') do - = link_to group_labels_path(@group), title: _('Labels') do - %span - = _('Labels') - - - if group_sidebar_link?(:group_members) - = nav_link(path: 'group_members#index') do - = link_to group_group_members_path(@group), title: _('Members'), data: { qa_selector: 'group_members_item' } do - %span - = _('Members') - -= render_if_exists "layouts/nav/ee/epic_link", group: @group - -- if group_sidebar_link?(:issues) - = nav_link(path: group_issues_sub_menu_items, unless: -> { current_path?('issues_analytics#show') }) do - = link_to issues_group_path(@group), data: { qa_selector: 'group_issues_item' }, class: 'has-sub-items' do - .nav-icon-container - = sprite_icon('issues') - %span.nav-item-name - = _('Issues') - %span.badge.badge-pill.count= issues_count - - %ul.sidebar-sub-level-items{ data: { qa_selector: 'group_issues_sidebar_submenu'} } - = nav_link(path: group_issues_sub_menu_items, html_options: { class: "fly-out-top-item" } ) do - = link_to issues_group_path(@group) do - %strong.fly-out-top-item-name - = _('Issues') - %span.badge.badge-pill.count.issue_counter.fly-out-badge= issues_count - - %li.divider.fly-out-top-item - = nav_link(path: 'groups#issues', html_options: { class: 'home' }) do - = link_to issues_group_path(@group), title: _('List') do - %span - = _('List') - - - if group_sidebar_link?(:boards) - = nav_link(path: ['boards#index', 'boards#show']) do - = link_to group_boards_path(@group), title: boards_link_text, data: { qa_selector: 'group_issue_boards_link' } do - %span - = boards_link_text - - - if group_sidebar_link?(:milestones) - = nav_link(path: 'milestones#index') do - = link_to group_milestones_path(@group), title: _('Milestones'), data: { qa_selector: 'group_milestones_link' } do - %span - = _('Milestones') - - = render_if_exists 'layouts/nav/sidebar/group_iterations_link' - -- if group_sidebar_link?(:merge_requests) - = nav_link(path: 'groups#merge_requests') do - = link_to merge_requests_group_path(@group) do - .nav-icon-container - = sprite_icon('git-merge') - %span.nav-item-name - = _('Merge requests') - %span.badge.badge-pill.count= merge_requests_count - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(path: 'groups#merge_requests', html_options: { class: "fly-out-top-item" } ) do - = link_to merge_requests_group_path(@group) do - %strong.fly-out-top-item-name - = _('Merge requests') - %span.badge.badge-pill.count.merge_counter.js-merge-counter.fly-out-badge= merge_requests_count - -= render_if_exists "layouts/nav/ee/security_link" # EE-specific - -= render_if_exists "layouts/nav/ee/push_rules_link" # EE-specific - -- if group_sidebar_link?(:kubernetes) - = nav_link(controller: [:clusters]) do - = link_to group_clusters_path(@group) do - .nav-icon-container - = sprite_icon('cloud-gear') - %span.nav-item-name - = _('Kubernetes') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: [:clusters], html_options: { class: "fly-out-top-item" } ) do - = link_to group_clusters_path(@group), title: _('Kubernetes'), class: 'shortcuts-kubernetes' do - %strong.fly-out-top-item-name - = _('Kubernetes') - -= render 'groups/sidebar/packages' - -= render 'layouts/nav/sidebar/analytics_links', links: group_analytics_navbar_links(@group, current_user) - -- if group_sidebar_link?(:wiki) - = render 'layouts/nav/sidebar/wiki_link', wiki_url: @group.wiki.web_url - -- if group_sidebar_link?(:settings) - = nav_link(path: group_settings_nav_link_paths) do - = link_to edit_group_path(@group), class: 'has-sub-items' do - .nav-icon-container - = sprite_icon('settings') - %span.nav-item-name{ data: { qa_selector: 'group_settings' } } - = _('Settings') - %ul.sidebar-sub-level-items{ data: { testid: 'group-settings-menu', qa_selector: 'group_sidebar_submenu' } } - = nav_link(path: %w[groups#projects groups#edit badges#index ci_cd#show groups/applications#index], html_options: { class: "fly-out-top-item" } ) do - = link_to edit_group_path(@group) do - %strong.fly-out-top-item-name - = _('Settings') - %li.divider.fly-out-top-item - = nav_link(path: 'groups#edit') do - = link_to edit_group_path(@group), title: _('General'), data: { qa_selector: 'general_settings_link' } do - %span - = _('General') - - = nav_link(controller: :integrations) do - = link_to group_settings_integrations_path(@group), title: _('Integrations') do - %span - = _('Integrations') - - = nav_link(path: 'groups#projects') do - = link_to projects_group_path(@group), title: _('Projects') do - %span - = _('Projects') - - = nav_link(controller: :repository) do - = link_to group_settings_repository_path(@group), title: _('Repository') do - %span - = _('Repository') - - = nav_link(controller: [:ci_cd, 'groups/runners']) do - = link_to group_settings_ci_cd_path(@group), title: _('CI/CD') do - %span - = _('CI/CD') - - = nav_link(controller: :applications) do - = link_to group_settings_applications_path(@group), title: _('Applications') do - %span - = _('Applications') - - = render 'groups/sidebar/packages_settings' - - = render_if_exists "groups/ee/settings_nav" - = render_if_exists "groups/ee/administration_nav" = render 'shared/sidebar_toggle_button' diff --git a/app/views/layouts/nav/sidebar/_wiki_link.html.haml b/app/views/layouts/nav/sidebar/_wiki_link.html.haml deleted file mode 100644 index b6b63b75fcc..00000000000 --- a/app/views/layouts/nav/sidebar/_wiki_link.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -= nav_link(controller: :wikis) do - = link_to wiki_url, class: 'shortcuts-wiki', data: { qa_selector: 'wiki_link' } do - .nav-icon-container - = sprite_icon('book') - %span.nav-item-name - = _('Wiki') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :wikis, html_options: { class: "fly-out-top-item" } ) do - = link_to wiki_url do - %strong.fly-out-top-item-name - = _('Wiki') |