summaryrefslogtreecommitdiff
path: root/app/views/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/layouts')
-rw-r--r--app/views/layouts/_head.html.haml3
-rw-r--r--app/views/layouts/_img_loader.html.haml17
-rw-r--r--app/views/layouts/_page.html.haml1
-rw-r--r--app/views/layouts/_search.html.haml5
-rw-r--r--app/views/layouts/_startup_js.html.haml13
-rw-r--r--app/views/layouts/application.html.haml2
-rw-r--r--app/views/layouts/header/_current_user_dropdown.html.haml1
-rw-r--r--app/views/layouts/header/_help_dropdown.html.haml1
-rw-r--r--app/views/layouts/header/_new_dropdown.haml1
-rw-r--r--app/views/layouts/nav/_dashboard.html.haml6
-rw-r--r--app/views/layouts/nav/sidebar/_admin.html.haml8
-rw-r--r--app/views/layouts/nav/sidebar/_group.html.haml5
-rw-r--r--app/views/layouts/nav/sidebar/_project.html.haml65
-rw-r--r--app/views/layouts/nav/sidebar/_wiki_link.html.haml11
-rw-r--r--app/views/layouts/service_desk.html.haml24
-rw-r--r--app/views/layouts/snippets.html.haml1
16 files changed, 122 insertions, 42 deletions
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 886d4109ff5..d1311f17b72 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -25,6 +25,8 @@
%meta{ 'http-equiv' => 'X-UA-Compatible', content: 'IE=edge' }
+ = render 'layouts/startup_js'
+
-# Open Graph - http://ogp.me/
%meta{ property: 'og:type', content: "object" }
%meta{ property: 'og:site_name', content: site_name }
@@ -51,7 +53,6 @@
= stylesheet_link_tag "application_dark", media: "all"
- else
= stylesheet_link_tag "application", media: "all"
- = stylesheet_link_tag "print", media: "print"
= stylesheet_link_tag "disable_animations", media: "all" if Rails.env.test? || Gitlab.config.gitlab['disable_animations']
= stylesheet_link_tag 'performance_bar' if performance_bar_enabled?
diff --git a/app/views/layouts/_img_loader.html.haml b/app/views/layouts/_img_loader.html.haml
new file mode 100644
index 00000000000..cddcd6e0af6
--- /dev/null
+++ b/app/views/layouts/_img_loader.html.haml
@@ -0,0 +1,17 @@
+= javascript_tag nonce: true do
+ :plain
+ if ('loading' in HTMLImageElement.prototype) {
+ document.querySelectorAll('img.lazy').forEach(img => {
+ img.loading = 'lazy';
+ let imgUrl = img.dataset.src;
+ // Only adding width + height for avatars for now
+ if (imgUrl.indexOf('/avatar/') > -1 && imgUrl.indexOf('?') === -1) {
+ const targetWidth = img.getAttribute('width') || img.width;
+ imgUrl += `?width=${targetWidth}`;
+ }
+ img.src = imgUrl;
+ img.removeAttribute('data-src');
+ img.classList.remove('lazy');
+ img.classList.add('js-lazy-loaded', 'qa-js-lazy-loaded');
+ });
+ }
diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml
index d1cf83b2a9f..72b88fa8f7f 100644
--- a/app/views/layouts/_page.html.haml
+++ b/app/views/layouts/_page.html.haml
@@ -7,6 +7,7 @@
= render 'shared/outdated_browser'
= render_if_exists 'layouts/header/users_over_license_banner'
= render_if_exists "layouts/header/licensed_user_count_threshold"
+ = render_if_exists "layouts/header/token_expiry_notification"
= render "layouts/broadcast"
= render "layouts/header/read_only_banner"
= render "layouts/nav/classification_level_banner"
diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml
index 97d00bce11b..81fe0798bd1 100644
--- a/app/views/layouts/_search.html.haml
+++ b/app/views/layouts/_search.html.haml
@@ -2,7 +2,7 @@
= form_tag search_path, method: :get, class: 'form-inline' do |f|
.search-input-container
.search-input-wrap
- .dropdown
+ .dropdown{ data: { url: search_autocomplete_path } }
= search_field_tag 'search', nil, placeholder: _('Search or jump to…'),
class: 'search-input dropdown-menu-toggle no-outline js-search-dashboard-options',
spellcheck: false,
@@ -37,3 +37,6 @@
-# workaround for non-JS feature specs, see spec/support/helpers/search_helpers.rb
- if ENV['RAILS_ENV'] == 'test'
%noscript= button_tag 'Search'
+ .search-autocomplete-opts.hide{ :'data-autocomplete-path' => search_autocomplete_path,
+ :'data-autocomplete-project-id' => search_context.project.try(:id),
+ :'data-autocomplete-project-ref' => search_context.ref }
diff --git a/app/views/layouts/_startup_js.html.haml b/app/views/layouts/_startup_js.html.haml
new file mode 100644
index 00000000000..3eb68df07c6
--- /dev/null
+++ b/app/views/layouts/_startup_js.html.haml
@@ -0,0 +1,13 @@
+- return unless page_startup_api_calls.present?
+
+= javascript_tag nonce: true do
+ :plain
+ var gl = window.gl || {};
+ gl.startup_calls = #{page_startup_api_calls.to_json};
+ if (gl.startup_calls && window.fetch) {
+ Object.keys(gl.startup_calls).forEach(apiCall => {
+ gl.startup_calls[apiCall] = {
+ fetchCall: fetch(apiCall)
+ };
+ });
+ }
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index eb58115451d..58408ec822c 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -13,6 +13,6 @@
= render 'layouts/page', sidebar: sidebar, nav: nav
= footer_message
- = render_if_exists "shared/onboarding_guide"
+ = render 'layouts/img_loader'
= yield :scripts_body
diff --git a/app/views/layouts/header/_current_user_dropdown.html.haml b/app/views/layouts/header/_current_user_dropdown.html.haml
index d568086f4a4..4c659241f99 100644
--- a/app/views/layouts/header/_current_user_dropdown.html.haml
+++ b/app/views/layouts/header/_current_user_dropdown.html.haml
@@ -35,7 +35,6 @@
= link_to _("Help"), help_path
%li.d-md-none
= link_to _("Support"), support_url
- = render_if_exists "shared/learn_gitlab_menu_item"
%li.d-md-none
= link_to _("Submit feedback"), "https://about.gitlab.com/submit-feedback"
- if current_user_menu?(:help) || current_user_menu?(:settings) || current_user_menu?(:profile)
diff --git a/app/views/layouts/header/_help_dropdown.html.haml b/app/views/layouts/header/_help_dropdown.html.haml
index 2b3f5d266b0..ad4e0f1f4b2 100644
--- a/app/views/layouts/header/_help_dropdown.html.haml
+++ b/app/views/layouts/header/_help_dropdown.html.haml
@@ -9,7 +9,6 @@
%button.js-shortcuts-modal-trigger{ type: "button" }
= _("Keyboard shortcuts")
%span.text-secondary.float-right{ "aria-hidden": true }= '?'.html_safe
- = render_if_exists "shared/learn_gitlab_menu_item"
%li.divider
%li
= link_to _("Submit feedback"), "https://about.gitlab.com/submit-feedback"
diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml
index 3cbfb24a868..4bfac76ec5b 100644
--- a/app/views/layouts/header/_new_dropdown.haml
+++ b/app/views/layouts/header/_new_dropdown.haml
@@ -15,6 +15,7 @@
%li= link_to _('New project'), new_project_path(namespace_id: @group.id)
- if create_group_subgroup
%li= link_to _('New subgroup'), new_group_path(parent_id: @group.id)
+ = render_if_exists 'layouts/header/create_epic_new_dropdown_item'
%li.divider
%li.dropdown-bold-header GitLab
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
index 0b23a06f5a9..e6cfd7d56bb 100644
--- a/app/views/layouts/nav/_dashboard.html.haml
+++ b/app/views/layouts/nav/_dashboard.html.haml
@@ -26,16 +26,16 @@
%ul
- if dashboard_nav_link?(:groups)
%li.d-md-none
- = link_to dashboard_groups_path, class: 'dashboard-shortcuts-groups' do
+ = link_to dashboard_groups_path, class: 'dashboard-shortcuts-groups', data: { qa_selector: 'groups_link' } do
= _('Groups')
- if dashboard_nav_link?(:activity)
= nav_link(path: 'dashboard#activity') do
- = link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity' do
+ = link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity', data: { qa_selector: 'activity_link' } do
= _('Activity')
- if dashboard_nav_link?(:milestones)
= nav_link(controller: 'dashboard/milestones') do
- = link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones' do
+ = link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones', data: { qa_selector: 'milestones_link' } do
= _('Milestones')
- if dashboard_nav_link?(:snippets)
diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml
index 28e52dc85db..e72535b8824 100644
--- a/app/views/layouts/nav/sidebar/_admin.html.haml
+++ b/app/views/layouts/nav/sidebar/_admin.html.haml
@@ -8,7 +8,7 @@
= _('Admin Area')
%ul.sidebar-top-level-items{ data: { qa_selector: 'admin_sidebar_overview_submenu_content' } }
= nav_link(controller: %w(dashboard admin admin/projects users groups jobs runners gitaly_servers), html_options: {class: 'home'}) do
- = link_to admin_root_path, class: 'shortcuts-tree' do
+ = link_to admin_root_path do
.nav-icon-container
= sprite_icon('overview')
%span.nav-item-name
@@ -216,7 +216,7 @@
%strong.fly-out-top-item-name
= _('Appearance')
- = nav_link(controller: :application_settings) do
+ = nav_link(controller: [:application_settings, :integrations]) do
= link_to general_admin_application_settings_path do
.nav-icon-container
= sprite_icon('settings')
@@ -224,7 +224,7 @@
= _('Settings')
%ul.sidebar-sub-level-items.qa-admin-sidebar-settings-submenu
- = nav_link(controller: :application_settings, html_options: { class: "fly-out-top-item" } ) do
+ = nav_link(controller: [:application_settings, :integrations], html_options: { class: "fly-out-top-item" } ) do
= link_to general_admin_application_settings_path do
%strong.fly-out-top-item-name
= _('Settings')
@@ -233,7 +233,7 @@
= link_to general_admin_application_settings_path, title: _('General'), class: 'qa-admin-settings-general-item' do
%span
= _('General')
- = nav_link(path: 'application_settings#integrations') do
+ = nav_link(path: ['application_settings#integrations', 'integrations#edit']) do
= link_to integrations_admin_application_settings_path, title: _('Integrations'), data: { qa_selector: 'integration_settings_link' } do
%span
= _('Integrations')
diff --git a/app/views/layouts/nav/sidebar/_group.html.haml b/app/views/layouts/nav/sidebar/_group.html.haml
index cd9765289a4..909d72edb31 100644
--- a/app/views/layouts/nav/sidebar/_group.html.haml
+++ b/app/views/layouts/nav/sidebar/_group.html.haml
@@ -81,7 +81,7 @@
- if group_sidebar_link?(:milestones)
= nav_link(path: 'milestones#index') do
- = link_to group_milestones_path(@group), title: _('Milestones') do
+ = link_to group_milestones_path(@group), title: _('Milestones'), data: { qa_selector: 'group_milestones_link' } do
%span
= _('Milestones')
@@ -123,6 +123,9 @@
= 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?(:group_members)
= nav_link(path: 'group_members#index') do
= link_to group_group_members_path(@group) do
diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml
index 16902ebe1d4..d59c75de6d2 100644
--- a/app/views/layouts/nav/sidebar/_project.html.haml
+++ b/app/views/layouts/nav/sidebar/_project.html.haml
@@ -37,7 +37,7 @@
- if project_nav_tab? :files
= nav_link(controller: sidebar_repository_paths, unless: -> { current_path?('projects/graphs#charts') }) do
- = link_to project_tree_path(@project), class: 'shortcuts-tree qa-project-menu-repo' do
+ = link_to project_tree_path(@project), class: 'shortcuts-tree', data: { qa_selector: "repository_link" } do
.nav-icon-container
= sprite_icon('doc-text')
%span.nav-item-name#js-onboarding-repo-link
@@ -58,11 +58,11 @@
= _('Commits')
= nav_link(html_options: {class: branches_tab_class}) do
- = link_to project_branches_path(@project), class: 'qa-branches-link', id: 'js-onboarding-branches-link' do
+ = link_to project_branches_path(@project), data: { qa_selector: "branches_link" }, id: 'js-onboarding-branches-link' do
= _('Branches')
= nav_link(controller: [:tags]) do
- = link_to project_tags_path(@project) do
+ = link_to project_tags_path(@project), data: { qa_selector: "tags_link" } do
= _('Tags')
= nav_link(path: 'graphs#show') do
@@ -80,7 +80,7 @@
= render_if_exists 'projects/sidebar/repository_locked_files'
- if project_nav_tab? :issues
- = nav_link(controller: @project.issues_enabled? ? [:issues, :labels, :milestones, :boards] : :issues) do
+ = nav_link(controller: @project.issues_enabled? ? ['projects/issues', :labels, :milestones, :boards] : 'projects/issues') do
= link_to project_issues_path(@project), class: 'shortcuts-issues qa-issues-item' do
.nav-icon-container
= sprite_icon('issues')
@@ -91,7 +91,7 @@
= number_with_delimiter(@project.open_issues_count(current_user))
%ul.sidebar-sub-level-items
- = nav_link(controller: :issues, action: :index, html_options: { class: "fly-out-top-item" } ) do
+ = nav_link(controller: 'projects/issues', action: :index, html_options: { class: "fly-out-top-item" } ) do
= link_to project_issues_path(@project) do
%strong.fly-out-top-item-name
= _('Issues')
@@ -114,25 +114,29 @@
%span
= _('Labels')
- = render_if_exists 'projects/sidebar/issues_service_desk'
+ = render 'projects/sidebar/issues_service_desk'
= nav_link(controller: :milestones) do
= link_to project_milestones_path(@project), title: _('Milestones'), class: 'qa-milestones-link' do
%span
= _('Milestones')
- - if project_nav_tab? :external_issue_tracker
- = nav_link do
- - issue_tracker = @project.external_issue_tracker
- = link_to issue_tracker.issue_tracker_path, class: 'shortcuts-external_tracker' do
- .nav-icon-container
- = sprite_icon('external-link')
- %span.nav-item-name
- = issue_tracker.title
- %ul.sidebar-sub-level-items.is-fly-out-only
- = nav_link(html_options: { class: "fly-out-top-item" } ) do
- = link_to issue_tracker.issue_tracker_path do
- %strong.fly-out-top-item-name
- = issue_tracker.title
+
+ - if project_nav_tab?(:external_issue_tracker)
+ - issue_tracker = @project.external_issue_tracker
+ - if issue_tracker.is_a?(JiraService) && project_jira_issues_integration?
+ = render_if_exists 'layouts/nav/sidebar/project_jira_issues_link', issue_tracker: issue_tracker
+ - else
+ = nav_link do
+ = link_to issue_tracker.issue_tracker_path, target: '_blank', rel: 'noopener noreferrer', class: 'shortcuts-external_tracker' do
+ .nav-icon-container
+ = sprite_icon('external-link')
+ %span.nav-item-name
+ = issue_tracker.title
+ %ul.sidebar-sub-level-items.is-fly-out-only
+ = nav_link(html_options: { class: "fly-out-top-item" } ) do
+ = link_to issue_tracker.issue_tracker_path, target: '_blank', rel: 'noopener noreferrer' do
+ %strong.fly-out-top-item-name
+ = issue_tracker.title
- if (project_nav_tab? :labels) && !@project.issues_enabled?
= nav_link(controller: [:labels]) do
@@ -289,19 +293,22 @@
= render 'layouts/nav/sidebar/analytics_links', links: project_analytics_navbar_links(@project, current_user)
- - if project_nav_tab? :wiki
- - wiki_url = wiki_path(@project.wiki)
- = nav_link(controller: :wikis) do
- = link_to wiki_url, class: 'shortcuts-wiki', data: { qa_selector: 'wiki_link' } do
+ - if project_nav_tab?(:confluence)
+ - confluence_url = project_wikis_confluence_path(@project)
+ = nav_link do
+ = link_to confluence_url, class: 'shortcuts-confluence' do
.nav-icon-container
- = sprite_icon('book')
+ = image_tag 'confluence.svg', alt: _('Confluence')
%span.nav-item-name
- = _('Wiki')
+ = _('Confluence')
%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
+ = nav_link(html_options: { class: 'fly-out-top-item' } ) do
+ = link_to confluence_url, target: '_blank', rel: 'noopener noreferrer' do
%strong.fly-out-top-item-name
- = _('Wiki')
+ = _('Confluence')
+
+ - if project_nav_tab? :wiki
+ = render 'layouts/nav/sidebar/wiki_link', wiki_url: wiki_path(@project.wiki)
- if project_nav_tab?(:external_wiki)
- external_wiki_url = @project.external_wiki.external_wiki_url
@@ -344,7 +351,7 @@
- if project_nav_tab? :settings
= nav_link(path: sidebar_settings_paths) do
- = link_to edit_project_path(@project), class: 'shortcuts-tree' do
+ = link_to edit_project_path(@project) do
.nav-icon-container
= sprite_icon('settings')
%span.nav-item-name.qa-settings-item#js-onboarding-settings-link
diff --git a/app/views/layouts/nav/sidebar/_wiki_link.html.haml b/app/views/layouts/nav/sidebar/_wiki_link.html.haml
new file mode 100644
index 00000000000..b6b63b75fcc
--- /dev/null
+++ b/app/views/layouts/nav/sidebar/_wiki_link.html.haml
@@ -0,0 +1,11 @@
+= 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')
diff --git a/app/views/layouts/service_desk.html.haml b/app/views/layouts/service_desk.html.haml
new file mode 100644
index 00000000000..26d15a74403
--- /dev/null
+++ b/app/views/layouts/service_desk.html.haml
@@ -0,0 +1,24 @@
+%html{ lang: "en" }
+ %head
+ %meta{ content: "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
+ -# haml-lint:disable NoPlainNodes
+ %title
+ GitLab
+ -# haml-lint:enable NoPlainNodes
+ = stylesheet_link_tag 'notify'
+ = yield :head
+ %body
+ .content
+ = yield
+ .footer{ style: "margin-top: 10px;" }
+ %p
+ —
+ %br
+ = link_to "Unsubscribe", @unsubscribe_url
+
+ -# EE-specific start
+ - if Gitlab::CurrentSettings.email_additional_text.present?
+ %br
+ %br
+ = Gitlab::Utils.nlbr(Gitlab::CurrentSettings.email_additional_text)
+ -# EE-specific end
diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml
index cde2b467392..6cc53ba3342 100644
--- a/app/views/layouts/snippets.html.haml
+++ b/app/views/layouts/snippets.html.haml
@@ -1,3 +1,4 @@
+- page_title _("Snippets")
- header_title _("Snippets"), snippets_path
- snippets_upload_path = snippets_upload_path(@snippet, current_user)