diff options
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_head.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/_loading_hints.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/_page.html.haml | 10 | ||||
-rw-r--r-- | app/views/layouts/component_preview.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/dashboard.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/explore.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/group.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/header/_new_dropdown.html.haml | 15 | ||||
-rw-r--r-- | app/views/layouts/nav/_breadcrumbs.html.haml | 45 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_explore.html.haml | 1 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_group.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_profile.html.haml | 170 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_user_profile.html.haml | 1 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_your_work.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/project.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/snippets.html.haml | 5 |
16 files changed, 67 insertions, 215 deletions
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index dd441d0d155..2dd6eab2e17 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -10,6 +10,7 @@ %meta{ 'http-equiv' => 'X-UA-Compatible', content: 'IE=edge' } = render 'layouts/startup_js' + = yield :startup_js - if page_canonical_link %link{ rel: 'canonical', href: page_canonical_link } @@ -57,6 +58,8 @@ = yield :page_specific_javascripts + = webpack_bundle_tag 'super_sidebar' if show_super_sidebar? + = webpack_controller_bundle_tags = yield :project_javascripts diff --git a/app/views/layouts/_loading_hints.html.haml b/app/views/layouts/_loading_hints.html.haml index 9026bec84c3..b20b95cade8 100644 --- a/app/views/layouts/_loading_hints.html.haml +++ b/app/views/layouts/_loading_hints.html.haml @@ -12,7 +12,8 @@ = 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::Tracking.collector_hostname - %link{ rel: 'preconnect', href: "https://#{Gitlab::Tracking.collector_hostname}", crossorigin: '' } + - unless Rails.env.development? + %link{ rel: 'preconnect', href: "https://#{Gitlab::Tracking.collector_hostname}", crossorigin: '' } -# Do not use preload_link_tag for fonts, to work around Firefox double-fetch bug. -# See https://github.com/web-platform-tests/wpt/pull/36930 %link{ rel: 'preload', href: font_path('gitlab-sans/GitLabSans.woff2'), as: 'font', crossorigin: css_crossorigin } diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index d2ed70d6b48..74567af3554 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -2,8 +2,12 @@ - @left_sidebar = true .layout-page.hide-when-top-nav-responsive-open{ class: page_with_sidebar_class } - if show_super_sidebar? - - sidebar_data = super_sidebar_context(current_user, group: @group, project: @project).to_json - %aside.js-super-sidebar.nav-sidebar{ data: { root_path: root_path, sidebar: sidebar_data, toggle_new_nav_endpoint: profile_preferences_url } } + -# Render the parent group sidebar while creating a new subgroup/project, see GroupsController#new. + - group = @parent_group || @group + + - sidebar_panel = super_sidebar_nav_panel(nav: nav, user: current_user, group: group, project: @project, current_ref: current_ref, ref_type: @ref_type, viewed_user: @user) + - sidebar_data = super_sidebar_context(current_user, group: group, project: @project, panel: sidebar_panel).to_json + %aside.js-super-sidebar.super-sidebar.super-sidebar-loading{ data: { root_path: root_path, sidebar: sidebar_data, toggle_new_nav_endpoint: profile_preferences_url } } - if display_whats_new? #whats-new-app{ data: { version_digest: whats_new_version_digest } } @@ -44,4 +48,4 @@ -# 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' += render "layouts/nav/top_nav_responsive", class: 'layout-page content-wrapper-margin' unless show_super_sidebar? diff --git a/app/views/layouts/component_preview.html.haml b/app/views/layouts/component_preview.html.haml index a1b1304f994..8217ac13c52 100644 --- a/app/views/layouts/component_preview.html.haml +++ b/app/views/layouts/component_preview.html.haml @@ -1,12 +1,12 @@ %head - - if params[:lookbook][:display][:theme] == 'light' + - if params[:lookbook][:display][:theme] == "light" = stylesheet_link_tag "application" = stylesheet_link_tag "application_utilities" - else = stylesheet_link_tag "application_dark" = stylesheet_link_tag "application_utilities_dark" %body - .container.gl-mt-6 + .gl-mt-6{ class: (params[:lookbook][:display][:layout] == "fluid" ? "container-fluid" : "container") } - if params[:lookbook][:display][:bg_dark] .bg-dark.rounded.shadow.p-4 = yield diff --git a/app/views/layouts/dashboard.html.haml b/app/views/layouts/dashboard.html.haml index 89f238eb6b3..1ac5f0a8497 100644 --- a/app/views/layouts/dashboard.html.haml +++ b/app/views/layouts/dashboard.html.haml @@ -2,6 +2,6 @@ - header_title _("Dashboard"), root_path unless header_title - @left_sidebar = true -- nav "your_work" +- nav (@parent_group ? "group" : "your_work") = render template: "layouts/application" diff --git a/app/views/layouts/explore.html.haml b/app/views/layouts/explore.html.haml index c495bab4547..02c00a53316 100644 --- a/app/views/layouts/explore.html.haml +++ b/app/views/layouts/explore.html.haml @@ -1,11 +1,6 @@ -- page_title _("Explore") +- header_title _("Explore"), explore_root_path -- if current_user - - @left_sidebar = true - - nav "your_work" - -- unless current_user - - @hide_breadcrumbs = true - - header_title _("Explore GitLab"), explore_root_path +- @left_sidebar = true +- nav "explore" = render template: "layouts/application" diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml index 95934f43a51..40ec1ff199b 100644 --- a/app/views/layouts/group.html.haml +++ b/app/views/layouts/group.html.haml @@ -16,6 +16,10 @@ :plain window.uploads_path = "#{group_uploads_path(@group)}"; +- content_for :before_content do + = render 'groups/invite_members_modal', group: @group + += dispensable_render_if_exists "shared/web_hooks/group_web_hook_disabled_alert" = dispensable_render_if_exists "shared/free_user_cap_alert", source: @group = render template: base_layout || "layouts/application" diff --git a/app/views/layouts/header/_new_dropdown.html.haml b/app/views/layouts/header/_new_dropdown.html.haml index 372babea18e..50a2b45aa7e 100644 --- a/app/views/layouts/header/_new_dropdown.html.haml +++ b/app/views/layouts/header/_new_dropdown.html.haml @@ -26,8 +26,13 @@ = section.fetch(:title) - section.fetch(:menu_items).each do |menu_item| %li< - = link_to menu_item.fetch(:href), class: menu_item.fetch(:css_class), data: menu_item.fetch(:data) do - = menu_item.fetch(:title) - - if menu_item.fetch(:emoji) - -# We need to insert a space between the title and emoji - = " #{emoji_icon(menu_item.fetch(:emoji), 'aria-hidden': true, class: 'gl-font-base gl-vertical-align-baseline')}".html_safe + - if menu_item.fetch(:partial).present? + = render partial: menu_item.fetch(:partial), + locals: { display_text: menu_item.fetch(:title), + icon: menu_item.fetch(:icon), + data: menu_item.fetch(:data) } + - else + = link_to menu_item.fetch(:title), + menu_item.fetch(:href), + class: menu_item.fetch(:css_class), + data: menu_item.fetch(:data) diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml index 98d6af28cf5..06dff99718c 100644 --- a/app/views/layouts/nav/_breadcrumbs.html.haml +++ b/app/views/layouts/nav/_breadcrumbs.html.haml @@ -3,25 +3,26 @@ - unless @skip_current_level_breadcrumb - push_to_schema_breadcrumb(@breadcrumb_title, breadcrumb_title_link) -%nav.breadcrumbs{ class: [container, @content_class], 'aria-label': _('Breadcrumbs') } - .breadcrumbs-container{ class: ("border-bottom-0" if @no_breadcrumb_border) } - - if defined?(@left_sidebar) - = button_tag class: 'toggle-mobile-nav', data: { qa_selector: 'toggle_mobile_nav_button' }, type: 'button' do - %span.sr-only= _("Open sidebar") - = sprite_icon('sidebar', size: 18) - .breadcrumbs-links{ data: { testid: 'breadcrumb-links', qa_selector: 'breadcrumb_links_content' } } - %ul.list-unstyled.breadcrumbs-list.js-breadcrumbs-list - - unless hide_top_links - = header_title - - if @breadcrumbs_extra_links - - @breadcrumbs_extra_links.each do |extra| - = breadcrumb_list_item link_to(extra[:text], extra[:link]) - = render "layouts/nav/breadcrumbs/collapsed_inline_list", location: :after - - unless @skip_current_level_breadcrumb - %li{ data: { testid: 'breadcrumb-current-link', qa_selector: 'breadcrumb_current_link' } } - = link_to @breadcrumb_title, breadcrumb_title_link - -# haml-lint:disable InlineJavaScript - %script{ type: 'application/ld+json' } - :plain - #{schema_breadcrumb_json} - = yield :header_content +.gl-relative + .breadcrumbs{ class: [container, @content_class] } + .breadcrumbs-container{ class: ("border-bottom-0" if @no_breadcrumb_border) } + - if show_super_sidebar? + = render Pajamas::ButtonComponent.new(icon: 'sidebar', category: :tertiary, button_options: { class: 'js-super-sidebar-toggle super-sidebar-toggle gl-ml-n3 gl-mr-2', title: _('Expand sidebar'), aria: { label: _('Expand sidebar') }, data: {toggle: 'tooltip', placement: 'right' } }) + - elsif defined?(@left_sidebar) + = render Pajamas::ButtonComponent.new(icon: 'sidebar', category: :tertiary, button_options: { class: 'toggle-mobile-nav gl-ml-n3 gl-mr-2', data: { qa_selector: 'toggle_mobile_nav_button' }, aria: { label: _('Open sidebar') } }) + %nav.breadcrumbs-links{ 'aria-label': _('Breadcrumbs'), data: { testid: 'breadcrumb-links', qa_selector: 'breadcrumb_links_content' } } + %ul.list-unstyled.breadcrumbs-list.js-breadcrumbs-list + - unless hide_top_links + = header_title + - if @breadcrumbs_extra_links + - @breadcrumbs_extra_links.each do |extra| + = breadcrumb_list_item link_to(extra[:text], extra[:link]) + = render "layouts/nav/breadcrumbs/collapsed_inline_list", location: :after + - unless @skip_current_level_breadcrumb + %li{ data: { testid: 'breadcrumb-current-link', qa_selector: 'breadcrumb_current_link' } } + = link_to @breadcrumb_title, breadcrumb_title_link + -# haml-lint:disable InlineJavaScript + %script{ type: 'application/ld+json' } + :plain + #{schema_breadcrumb_json} + = yield :header_content diff --git a/app/views/layouts/nav/sidebar/_explore.html.haml b/app/views/layouts/nav/sidebar/_explore.html.haml new file mode 100644 index 00000000000..ccbcb434af1 --- /dev/null +++ b/app/views/layouts/nav/sidebar/_explore.html.haml @@ -0,0 +1 @@ += render partial: 'shared/nav/sidebar', object: Sidebars::Explore::Panel.new(Sidebars::Context.new(current_user: current_user, container: nil)) diff --git a/app/views/layouts/nav/sidebar/_group.html.haml b/app/views/layouts/nav/sidebar/_group.html.haml index c2b50bc0e52..fd0e47b543f 100644 --- a/app/views/layouts/nav/sidebar/_group.html.haml +++ b/app/views/layouts/nav/sidebar/_group.html.haml @@ -1 +1,2 @@ -= render partial: 'shared/nav/sidebar', object: Sidebars::Groups::Panel.new(group_sidebar_context(@group, current_user)) +- group = @parent_group || @group += render partial: 'shared/nav/sidebar', object: Sidebars::Groups::Panel.new(group_sidebar_context(group, current_user)) diff --git a/app/views/layouts/nav/sidebar/_profile.html.haml b/app/views/layouts/nav/sidebar/_profile.html.haml index 087eca3ba35..d53316442f8 100644 --- a/app/views/layouts/nav/sidebar/_profile.html.haml +++ b/app/views/layouts/nav/sidebar/_profile.html.haml @@ -1,169 +1 @@ -%aside.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), **sidebar_tracking_attributes_by_object(current_user), 'aria-label': _('User settings') } - .nav-sidebar-inner-scroll - .context-header - = link_to profile_path, title: _('Profile Settings'), class: 'has-tooltip', data: { container: 'body', placement: 'right' } do - = render Pajamas::AvatarComponent.new(current_user, size: 32, alt: current_user.name, class: 'gl-mr-3 js-sidebar-user-avatar', avatar_options: { data: { testid: 'sidebar-user-avatar' } }) - %span.sidebar-context-title= _('User Settings') - %ul.sidebar-top-level-items - = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do - = link_to profile_path do - .nav-icon-container - = sprite_icon('profile') - %span.nav-item-name - = _('Profile') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(path: 'profiles#show', html_options: { class: "fly-out-top-item" }) do - = link_to profile_path do - %strong.fly-out-top-item-name - = _('Profile') - = nav_link(controller: [:accounts, :two_factor_auths]) do - = link_to profile_account_path, data: { qa_selector: 'profile_account_link' } do - .nav-icon-container - = sprite_icon('account') - %span.nav-item-name - = _('Account') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: [:accounts, :two_factor_auths], html_options: { class: "fly-out-top-item" }) do - = link_to profile_account_path do - %strong.fly-out-top-item-name - = _('Account') - - = render_if_exists 'layouts/nav/sidebar/profile_billing_link' - = nav_link(controller: 'oauth/applications') do - = link_to applications_profile_path do - .nav-icon-container - = sprite_icon('applications') - %span.nav-item-name - = _('Applications') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: 'oauth/applications', html_options: { class: "fly-out-top-item" }) do - = link_to applications_profile_path do - %strong.fly-out-top-item-name - = _('Applications') - = nav_link(controller: :chat_names) do - = link_to profile_chat_names_path do - .nav-icon-container - = sprite_icon('comment') - %span.nav-item-name - = _('Chat') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :chat_names, html_options: { class: "fly-out-top-item" }) do - = link_to profile_chat_names_path do - %strong.fly-out-top-item-name - = _('Chat') - - unless Gitlab::CurrentSettings.personal_access_tokens_disabled? - = nav_link(controller: :personal_access_tokens) do - = link_to profile_personal_access_tokens_path do - .nav-icon-container - = sprite_icon('token') - %span.nav-item-name - = _('Access Tokens') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :personal_access_tokens, html_options: { class: "fly-out-top-item" }) do - = link_to profile_personal_access_tokens_path do - %strong.fly-out-top-item-name - = _('Access Tokens') - = nav_link(controller: :emails) do - = link_to profile_emails_path, data: { qa_selector: 'profile_emails_link' } do - .nav-icon-container - = sprite_icon('mail') - %span.nav-item-name - = _('Emails') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :emails, html_options: { class: "fly-out-top-item" }) do - = link_to profile_emails_path do - %strong.fly-out-top-item-name - = _('Emails') - - if current_user.allow_password_authentication? - = nav_link(controller: :passwords) do - = link_to edit_profile_password_path , data: { qa_selector: 'profile_password_link' } do - .nav-icon-container - = sprite_icon('lock') - %span.nav-item-name - = _('Password') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :passwords, html_options: { class: "fly-out-top-item" }) do - = link_to edit_profile_password_path do - %strong.fly-out-top-item-name - = _('Password') - = nav_link(controller: :notifications) do - = link_to profile_notifications_path do - .nav-icon-container - = sprite_icon('notifications') - %span.nav-item-name - = _('Notifications') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :notifications, html_options: { class: "fly-out-top-item" }) do - = link_to profile_notifications_path do - %strong.fly-out-top-item-name - = _('Notifications') - = nav_link(controller: :keys) do - = link_to profile_keys_path do - .nav-icon-container - = sprite_icon('key') - %span.nav-item-name - = _('SSH Keys') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :keys, html_options: { class: "fly-out-top-item" }) do - = link_to profile_keys_path do - %strong.fly-out-top-item-name - = _('SSH Keys') - = nav_link(controller: :gpg_keys) do - = link_to profile_gpg_keys_path do - .nav-icon-container - = sprite_icon('key') - %span.nav-item-name - = _('GPG Keys') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :gpg_keys, html_options: { class: "fly-out-top-item" }) do - = link_to profile_gpg_keys_path do - %strong.fly-out-top-item-name - = _('GPG Keys') - = nav_link(controller: :preferences) do - = link_to profile_preferences_path do - .nav-icon-container - = sprite_icon('preferences') - %span.nav-item-name - = _('Preferences') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :preferences, html_options: { class: "fly-out-top-item" }) do - = link_to profile_preferences_path do - %strong.fly-out-top-item-name - = _('Preferences') - - if saved_replies_enabled? - = nav_link(controller: :saved_replies) do - = link_to profile_saved_replies_path do - .nav-icon-container - = sprite_icon('symlink') - %span.nav-item-name - = _('Saved Replies') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :saved_replies, html_options: { class: "fly-out-top-item" }) do - = link_to profile_saved_replies_path do - %strong.fly-out-top-item-name - = _('Saved Replies') - = nav_link(controller: :active_sessions) do - = link_to profile_active_sessions_path do - .nav-icon-container - = sprite_icon('monitor-lines') - %span.nav-item-name - = _('Active Sessions') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :active_sessions, html_options: { class: "fly-out-top-item" }) do - = link_to profile_active_sessions_path do - %strong.fly-out-top-item-name - = _('Active Sessions') - = nav_link(path: 'profiles#audit_log') do - = link_to audit_log_profile_path do - .nav-icon-container - = sprite_icon('log') - %span.nav-item-name - = _('Authentication log') - %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(path: 'profiles#audit_log', html_options: { class: "fly-out-top-item" }) do - = link_to audit_log_profile_path do - %strong.fly-out-top-item-name - = _('Authentication Log') - = render_if_exists 'layouts/nav/sidebar/profile_usage_quotas_link' - - = render 'shared/sidebar_toggle_button' += render partial: 'shared/nav/sidebar', object: Sidebars::UserSettings::Panel.new(Sidebars::Context.new(current_user: current_user, container: current_user)) diff --git a/app/views/layouts/nav/sidebar/_user_profile.html.haml b/app/views/layouts/nav/sidebar/_user_profile.html.haml new file mode 100644 index 00000000000..b24334f48c4 --- /dev/null +++ b/app/views/layouts/nav/sidebar/_user_profile.html.haml @@ -0,0 +1 @@ += render partial: 'shared/nav/sidebar', object: Sidebars::UserProfile::Panel.new(Sidebars::Context.new(current_user: current_user, container: @user)) diff --git a/app/views/layouts/nav/sidebar/_your_work.html.haml b/app/views/layouts/nav/sidebar/_your_work.html.haml index 0eba5045ab1..0da66c2e14e 100644 --- a/app/views/layouts/nav/sidebar/_your_work.html.haml +++ b/app/views/layouts/nav/sidebar/_your_work.html.haml @@ -1 +1 @@ -= render partial: 'shared/nav/sidebar', object: Sidebars::YourWork::Panel.new(Sidebars::Context.new(current_user: current_user, container: nil)) += render partial: 'shared/nav/sidebar', object: Sidebars::YourWork::Panel.new(your_work_sidebar_context(current_user)) diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 6ad6696b313..09fa8575106 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -18,6 +18,9 @@ :plain window.uploads_path = "#{project_uploads_path(project)}"; +- content_for :before_content do + = render 'projects/invite_members_modal', project: @project + = dispensable_render_if_exists "shared/web_hooks/web_hook_disabled_alert" = dispensable_render_if_exists "projects/free_user_cap_alert", project: @project diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml index 95a204a3319..e396f38499a 100644 --- a/app/views/layouts/snippets.html.haml +++ b/app/views/layouts/snippets.html.haml @@ -1,9 +1,10 @@ - page_title _("Snippets") -- header_title _("Snippets"), snippets_path +- header_title _("Snippets"), dashboard_snippets_path - snippets_upload_path = snippets_upload_path(@snippet, current_user) +- @left_sidebar = true + - if current_user - - @left_sidebar = true - nav "your_work" - content_for :page_specific_javascripts do |