diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/views/layouts | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/views/layouts')
26 files changed, 55 insertions, 49 deletions
diff --git a/app/views/layouts/_google_analytics.html.haml b/app/views/layouts/_google_analytics.html.haml index e8a5359e791..759e9ef36b9 100644 --- a/app/views/layouts/_google_analytics.html.haml +++ b/app/views/layouts/_google_analytics.html.haml @@ -1,4 +1,4 @@ -= javascript_tag nonce: true do += javascript_tag do :plain var _gaq = _gaq || []; _gaq.push(['_setAccount', '#{extra_config.google_analytics_id}']); diff --git a/app/views/layouts/_google_tag_manager_head.html.haml b/app/views/layouts/_google_tag_manager_head.html.haml index ab03f1e7670..48eb9e40cc4 100644 --- a/app/views/layouts/_google_tag_manager_head.html.haml +++ b/app/views/layouts/_google_tag_manager_head.html.haml @@ -1,5 +1,5 @@ - if google_tag_manager_enabled? - = javascript_tag nonce: true do + = javascript_tag do :plain (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 1d12b30c58c..bdd506ab3be 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -88,5 +88,5 @@ = yield :meta_tags = render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id') - = render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id') + = render 'layouts/matomo' if extra_config.has_key?('matomo_url') && extra_config.has_key?('matomo_site_id') = render 'layouts/snowplow' diff --git a/app/views/layouts/_img_loader.html.haml b/app/views/layouts/_img_loader.html.haml index cddcd6e0af6..f6d7d163e6f 100644 --- a/app/views/layouts/_img_loader.html.haml +++ b/app/views/layouts/_img_loader.html.haml @@ -1,4 +1,4 @@ -= javascript_tag nonce: true do += javascript_tag do :plain if ('loading' in HTMLImageElement.prototype) { document.querySelectorAll('img.lazy').forEach(img => { diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml index 82ec92988eb..509f5be8097 100644 --- a/app/views/layouts/_init_auto_complete.html.haml +++ b/app/views/layouts/_init_auto_complete.html.haml @@ -4,7 +4,7 @@ - datasources = autocomplete_data_sources(object, noteable_type) - if object - = javascript_tag nonce: true do + = javascript_tag do :plain gl = window.gl || {}; gl.GfmAutoComplete = gl.GfmAutoComplete || {}; diff --git a/app/views/layouts/_init_client_detection_flags.html.haml b/app/views/layouts/_init_client_detection_flags.html.haml index 6537b86085f..03967bbbfcf 100644 --- a/app/views/layouts/_init_client_detection_flags.html.haml +++ b/app/views/layouts/_init_client_detection_flags.html.haml @@ -1,7 +1,7 @@ - client = client_js_flags - if client - = javascript_tag nonce: true do + = javascript_tag do :plain gl = window.gl || {}; gl.client = #{client.to_json}; diff --git a/app/views/layouts/_loading_hints.html.haml b/app/views/layouts/_loading_hints.html.haml index a75b602ff6b..0ef50d1b122 100644 --- a/app/views/layouts/_loading_hints.html.haml +++ b/app/views/layouts/_loading_hints.html.haml @@ -6,6 +6,5 @@ - 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' } : {} } -%link{ { rel: 'preload', href: asset_url("fontawesome-webfont.woff2?v=4.7.0"), as: 'font', type: 'font/woff2' }, ActionController::Base.asset_host ? { crossorigin: 'anonymous' } : {} } - if Gitlab::CurrentSettings.snowplow_enabled? && Gitlab::CurrentSettings.snowplow_collector_hostname %link{ rel: 'preconnect', href: Gitlab::CurrentSettings.snowplow_collector_hostname, crossorigin: '' } diff --git a/app/views/layouts/_matomo.html.haml b/app/views/layouts/_matomo.html.haml new file mode 100644 index 00000000000..fcd3156a162 --- /dev/null +++ b/app/views/layouts/_matomo.html.haml @@ -0,0 +1,15 @@ +<!-- Matomo --> += javascript_tag do + :plain + var _paq = window._paq = window._paq || []; + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="//#{extra_config.matomo_url}/"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', "#{extra_config.matomo_site_id}"]); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); + })(); +<noscript><p><img src="//#{extra_config.matomo_url}/matomo.php?idsite=#{extra_config.matomo_site_id}" style="border:0;" alt="" /></p></noscript> +<!-- End Matomo Code --> diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index f6fc49393d8..c552454caa7 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -17,6 +17,7 @@ = render_account_recovery_regular_check = render_if_exists "layouts/header/ee_subscribable_banner" = render_if_exists "shared/namespace_storage_limit_alert" + = render_if_exists "shared/new_user_signups_cap_reached_alert" = yield :customize_homepage_banner - unless @hide_breadcrumbs = render "layouts/nav/breadcrumbs" diff --git a/app/views/layouts/_piwik.html.haml b/app/views/layouts/_piwik.html.haml deleted file mode 100644 index 361a7b03180..00000000000 --- a/app/views/layouts/_piwik.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -<!-- Piwik --> -= javascript_tag nonce: true do - :plain - var _paq = _paq || []; - _paq.push(['trackPageView']); - _paq.push(['enableLinkTracking']); - (function() { - var u="//#{extra_config.piwik_url}/"; - _paq.push(['setTrackerUrl', u+'piwik.php']); - _paq.push(['setSiteId', "#{extra_config.piwik_site_id}"]); - var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; - g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); - })(); -<noscript><p><img src="//#{extra_config.piwik_url}/piwik.php?idsite=#{extra_config.piwik_site_id}" style="border:0;" alt="" /></p></noscript> -<!-- End Piwik Code --> diff --git a/app/views/layouts/_snowplow.html.haml b/app/views/layouts/_snowplow.html.haml index d7ff5ad1094..9d14dfb3786 100644 --- a/app/views/layouts/_snowplow.html.haml +++ b/app/views/layouts/_snowplow.html.haml @@ -1,6 +1,6 @@ - return unless Gitlab::CurrentSettings.snowplow_enabled? -= javascript_tag nonce: true do += javascript_tag do :plain ;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[]; p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments) diff --git a/app/views/layouts/_startup_css_activation.haml b/app/views/layouts/_startup_css_activation.haml index a426d686c34..5fb53385acc 100644 --- a/app/views/layouts/_startup_css_activation.haml +++ b/app/views/layouts/_startup_css_activation.haml @@ -1,6 +1,6 @@ - return unless use_startup_css? -= javascript_tag nonce: true do += javascript_tag do :plain document.querySelectorAll('link[media="print"]').forEach(linkTag => { linkTag.setAttribute('data-startupcss', 'loading'); diff --git a/app/views/layouts/_startup_js.html.haml b/app/views/layouts/_startup_js.html.haml index 9c488e4f40d..35cd191c600 100644 --- a/app/views/layouts/_startup_js.html.haml +++ b/app/views/layouts/_startup_js.html.haml @@ -1,6 +1,6 @@ - return unless page_startup_api_calls.present? || page_startup_graphql_calls.present? -= javascript_tag nonce: true do += javascript_tag do :plain var gl = window.gl || {}; gl.startup_calls = #{page_startup_api_calls.to_json}; diff --git a/app/views/layouts/errors.html.haml b/app/views/layouts/errors.html.haml index dc924a0e25d..25fe4c898ca 100644 --- a/app/views/layouts/errors.html.haml +++ b/app/views/layouts/errors.html.haml @@ -8,7 +8,7 @@ %body .page-container = yield - = javascript_tag nonce: true do + = javascript_tag do :plain (function(){ var goBackElement = document.querySelector('.js-go-back'); diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml index 6d2c5870e43..58fed89dfe7 100644 --- a/app/views/layouts/group.html.haml +++ b/app/views/layouts/group.html.haml @@ -8,7 +8,7 @@ - content_for :page_specific_javascripts do - if current_user - = javascript_tag nonce: true do + = javascript_tag do :plain window.uploads_path = "#{group_uploads_path(@group)}"; diff --git a/app/views/layouts/header/_current_user_dropdown.html.haml b/app/views/layouts/header/_current_user_dropdown.html.haml index addf2375222..d7ca93a296b 100644 --- a/app/views/layouts/header/_current_user_dropdown.html.haml +++ b/app/views/layouts/header/_current_user_dropdown.html.haml @@ -18,7 +18,7 @@ - if can?(current_user, :update_user_status, current_user) %li %button.btn.menu-item.js-set-status-modal-trigger{ type: 'button' } - - if current_user.status.present? + - if show_status_emoji?(current_user.status) || user_status_set_to_busy?(current_user.status) = s_('SetStatusModal|Edit status') - else = s_('SetStatusModal|Set status') diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 794d1589172..70ab0a56581 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -74,6 +74,7 @@ %span.gl-sr-only = s_('Nav|Help') = sprite_icon('question') + %span.notification-dot.rounded-circle.gl-absolute = sprite_icon('chevron-down', css_class: 'caret-down') .dropdown-menu.dropdown-menu-right = render 'layouts/header/help_dropdown' @@ -101,7 +102,7 @@ = sprite_icon('close', size: 12, css_class: 'close-icon js-navbar-toggle-left') - if ::Feature.enabled?(:whats_new_drawer, current_user) - #whats-new-app{ data: { storage_key: whats_new_storage_key } } + #whats-new-app{ data: { storage_key: whats_new_storage_key, versions: whats_new_versions, gitlab_dot_com: Gitlab.dev_env_org_or_com? } } - if can?(current_user, :update_user_status, current_user) .js-set-status-modal-wrapper{ data: user_status_data } diff --git a/app/views/layouts/jira_connect.html.haml b/app/views/layouts/jira_connect.html.haml index 17f6e9af61a..0d4ecfc5a10 100644 --- a/app/views/layouts/jira_connect.html.haml +++ b/app/views/layouts/jira_connect.html.haml @@ -5,9 +5,11 @@ GitLab = stylesheet_link_tag 'https://unpkg.com/@atlaskit/css-reset@3.0.6/dist/bundle.css' = stylesheet_link_tag 'https://unpkg.com/@atlaskit/reduced-ui-pack@10.5.5/dist/bundle.css' + = yield :page_specific_styles + = javascript_include_tag 'https://connect-cdn.atl-paas.net/all.js' = javascript_include_tag 'https://unpkg.com/jquery@3.3.1/dist/jquery.min.js' - = yield :page_specific_styles + = Gon::Base.render_data(nonce: content_security_policy_nonce) = yield :head %body .ac-content diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml index f0cdb3d1a51..43f1011a85b 100644 --- a/app/views/layouts/nav/_breadcrumbs.html.haml +++ b/app/views/layouts/nav/_breadcrumbs.html.haml @@ -1,6 +1,7 @@ - container = @no_breadcrumb_container ? 'container-fluid' : container_class - hide_top_links = @hide_top_links || false -- push_to_schema_breadcrumb(@breadcrumb_title, breadcrumb_title_link) +- unless @skip_current_level_breadcrumb + - push_to_schema_breadcrumb(@breadcrumb_title, breadcrumb_title_link) %nav.breadcrumbs{ role: "navigation", class: [container, @content_class] } .breadcrumbs-container{ class: ("border-bottom-0" if @no_breadcrumb_border) } @@ -16,8 +17,10 @@ - @breadcrumbs_extra_links.each do |extra| = breadcrumb_list_item link_to(extra[:text], extra[:link]) = render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after - %li - %h2.breadcrumbs-sub-title= link_to @breadcrumb_title, breadcrumb_title_link + - unless @skip_current_level_breadcrumb + %li + %h2.breadcrumbs-sub-title + = link_to @breadcrumb_title, breadcrumb_title_link %script{ type:'application/ld+json' } :plain #{schema_breadcrumb_json} diff --git a/app/views/layouts/nav/groups_dropdown/_show.html.haml b/app/views/layouts/nav/groups_dropdown/_show.html.haml index 3ce1fa6bcca..d0394451a61 100644 --- a/app/views/layouts/nav/groups_dropdown/_show.html.haml +++ b/app/views/layouts/nav/groups_dropdown/_show.html.haml @@ -3,10 +3,10 @@ .frequent-items-dropdown-sidebar.qa-groups-dropdown-sidebar %ul = nav_link(path: 'dashboard/groups#index') do - = link_to dashboard_groups_path, class: 'qa-your-groups-link' do + = link_to dashboard_groups_path, class: 'qa-your-groups-link', 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 do + = link_to explore_groups_path, data: { track_label: "groups_dropdown_explore_groups", track_event: "click_link" } do = _('Explore groups') .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 index f2170f71532..91f999a9a74 100644 --- a/app/views/layouts/nav/projects_dropdown/_show.html.haml +++ b/app/views/layouts/nav/projects_dropdown/_show.html.haml @@ -3,13 +3,13 @@ .frequent-items-dropdown-sidebar.qa-projects-dropdown-sidebar %ul = nav_link(path: 'dashboard/projects#index') do - = link_to dashboard_projects_path, class: 'qa-your-projects-link' do + = link_to dashboard_projects_path, class: 'qa-your-projects-link', 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 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 do + = link_to explore_root_path, data: { track_label: "projects_dropdown_explore_projects", track_event: "click_link" } do = _('Explore projects') .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 index a99eb8cf457..970a1d5f2c7 100644 --- a/app/views/layouts/nav/sidebar/_analytics_links.html.haml +++ b/app/views/layouts/nav/sidebar/_analytics_links.html.haml @@ -4,7 +4,7 @@ - if navbar_links.any? = nav_link(path: all_paths) do - = link_to analytics_link.link, { data: { qa_selector: 'analytics_anchor' } } do + = link_to analytics_link.link, {class: 'shortcuts-analytics', data: { qa_selector: 'analytics_anchor' } } do .nav-icon-container = sprite_icon('chart') %span.nav-item-name{ data: { qa_selector: 'analytics_link' } } diff --git a/app/views/layouts/nav/sidebar/_group.html.haml b/app/views/layouts/nav/sidebar/_group.html.haml index 5f4b1f8ad45..efe8e57cadf 100644 --- a/app/views/layouts/nav/sidebar/_group.html.haml +++ b/app/views/layouts/nav/sidebar/_group.html.haml @@ -159,11 +159,10 @@ %span = _('General') - - if group_level_integrations? - = nav_link(controller: :integrations) do - = link_to group_settings_integrations_path(@group), title: _('Integrations') do - %span - = _('Integrations') + = 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 diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml index 5ff774d5d9c..5cadabd5f90 100644 --- a/app/views/layouts/nav/sidebar/_project.html.haml +++ b/app/views/layouts/nav/sidebar/_project.html.haml @@ -262,6 +262,8 @@ %span = _('Incidents') + = render_if_exists 'projects/sidebar/oncall_schedules' + - if project_nav_tab? :serverless = nav_link(controller: :functions) do = link_to project_serverless_functions_path(@project), title: _('Serverless') do @@ -322,7 +324,8 @@ = render_if_exists 'layouts/nav/sidebar/project_packages_link' - = render 'layouts/nav/sidebar/analytics_links', links: project_analytics_navbar_links(@project, current_user) + - if project_nav_tab? :analytics + = render 'layouts/nav/sidebar/analytics_links', links: project_analytics_navbar_links(@project, current_user) - if project_nav_tab?(:confluence) - confluence_url = project_wikis_confluence_path(@project) @@ -435,8 +438,6 @@ %span = _('Pages') - = render_if_exists 'projects/sidebar/settings_audit_events' - = render 'shared/sidebar_toggle_button' -# Shortcut to Project > Activity diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 62e5431e290..2df502d2899 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -10,7 +10,7 @@ - content_for :project_javascripts do - project = @target_project || @project - if current_user - = javascript_tag nonce: true do + = javascript_tag do :plain window.uploads_path = "#{project_uploads_path(project)}"; diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml index 6cc53ba3342..54b5ec85ccc 100644 --- a/app/views/layouts/snippets.html.haml +++ b/app/views/layouts/snippets.html.haml @@ -4,7 +4,7 @@ - content_for :page_specific_javascripts do - if snippets_upload_path - = javascript_tag nonce: true do + = javascript_tag do :plain window.uploads_path = "#{snippets_upload_path}"; |