diff options
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_google_tag_manager_head.html.haml | 19 | ||||
-rw-r--r-- | app/views/layouts/_snowplow.html.haml | 7 | ||||
-rw-r--r-- | app/views/layouts/component_preview.html.haml | 5 | ||||
-rw-r--r-- | app/views/layouts/devise.html.haml | 78 | ||||
-rw-r--r-- | app/views/layouts/group.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/header/_current_user_dropdown.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/header/_current_user_dropdown_item.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/header/_default.html.haml | 23 | ||||
-rw-r--r-- | app/views/layouts/header/_storage_enforcement_banner.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_admin.html.haml | 6 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_profile.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/profile.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/project.html.haml | 4 |
13 files changed, 103 insertions, 65 deletions
diff --git a/app/views/layouts/_google_tag_manager_head.html.haml b/app/views/layouts/_google_tag_manager_head.html.haml index 25af51ca9cb..f5c823465be 100644 --- a/app/views/layouts/_google_tag_manager_head.html.haml +++ b/app/views/layouts/_google_tag_manager_head.html.haml @@ -1,4 +1,23 @@ - return unless google_tag_manager_enabled? +- if Feature.enabled?(:gitlab_gtm_datalayer, type: :ops) + = javascript_tag do + :plain + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + + gtag('consent', 'default', { + 'analytics_storage': 'denied', + 'ad_storage': 'denied', + 'functionality_storage': 'denied', + 'region': ['EU', 'UK', 'PE', 'RU'], + 'wait_for_update': 500 + }); + gtag('consent', 'default', { + 'analytics_storage': 'granted', + 'ad_storage': 'granted', + 'functionality_storage': 'granted', + 'wait_for_update': 500 + }); - if Feature.enabled?(:gtm_nonce, type: :ops) = javascript_tag nonce: content_security_policy_nonce do diff --git a/app/views/layouts/_snowplow.html.haml b/app/views/layouts/_snowplow.html.haml index 0dad6d367c3..22cc8027202 100644 --- a/app/views/layouts/_snowplow.html.haml +++ b/app/views/layouts/_snowplow.html.haml @@ -12,6 +12,9 @@ window.snowplowOptions = #{Gitlab::Tracking.options(@group).to_json} gl = window.gl || {}; - gl.snowplowStandardContext = #{Gitlab::Tracking::StandardContext.new(namespace: namespace, - project: @project, user: current_user).to_context.to_json.to_json} + gl.snowplowStandardContext = #{Gitlab::Tracking::StandardContext.new( + namespace: namespace, + project: @project, + user: current_user + ).to_context.to_json.to_json} gl.snowplowPseudonymizedPageUrl = #{masked_page_url(group: namespace, project: @project).to_json}; diff --git a/app/views/layouts/component_preview.html.haml b/app/views/layouts/component_preview.html.haml new file mode 100644 index 00000000000..ec12395a5d4 --- /dev/null +++ b/app/views/layouts/component_preview.html.haml @@ -0,0 +1,5 @@ +%head + = stylesheet_link_tag "application" + = stylesheet_link_tag "application_utilities" +%body{ style: "background-color: #{params.dig(:lookbook, :display, :bg_color) || 'white'}" } + .container.gl-mt-6= yield diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml index cb1a2a8c690..87a8b6dd870 100644 --- a/app/views/layouts/devise.html.haml +++ b/app/views/layouts/devise.html.haml @@ -4,39 +4,61 @@ %body.login-page.application.navless{ class: "#{user_application_theme} #{client_class_list}", data: { page: body_data_page, qa_selector: 'login_page' } } = header_message = render "layouts/init_client_detection_flags" - .page-wrap - = render "layouts/header/empty" - .login-page-broadcast - = render "layouts/broadcast" - .container.navless-container - .content - = render "layouts/flash" - .row.mt-3 - .col-sm-12 - %h1.mb-3.font-weight-normal - = current_appearance&.title.presence || _('GitLab') - .row.mb-3 - .col-md-6.order-12.order-sm-1.brand-holder - - unless recently_confirmed_com? - = brand_image + - if Feature.enabled?(:restyle_login_page, @project) + .page-wrap.borderless + .login-page-broadcast + = render "layouts/broadcast" + .container.navless-container + .content + = render "layouts/flash" + .mt-3 + .col-sm-12.gl-text-center + %img.gl-w-10{ :alt => _("GitLab Logo"), :src => image_path('logo.svg') } + %h1.mb-3.gl-font-size-h2 + = current_appearance&.title.presence || _('GitLab') - if current_appearance&.description? = brand_text - - else - %h3.gl-sm-mt-0 - = _('A complete DevOps platform') + .mb-3 + .gl-w-half.gl-xs-w-full.gl-ml-auto.gl-mr-auto.bar + = yield + = render_if_exists 'layouts/devise_help_text' - %p - = _('GitLab is a single application for the entire software development lifecycle. From project planning and source code management to CI/CD, monitoring, and security.') - %p - = _('This is a self-managed instance of GitLab.') + = render 'devise/shared/footer', footer_message: footer_message + - else + .page-wrap + = render "layouts/header/empty" + .login-page-broadcast + = render "layouts/broadcast" + .container.navless-container + .content + = render "layouts/flash" + .row.mt-3 + .col-sm-12 + %h1.mb-3.font-weight-normal + = current_appearance&.title.presence || _('GitLab') + .row.mb-3 + .col-md-6.order-12.order-sm-1.brand-holder + - unless recently_confirmed_com? + = brand_image + - if current_appearance&.description? + = brand_text + - else + %h3.gl-sm-mt-0 + = _('A complete DevOps platform') - - if Gitlab::CurrentSettings.sign_in_text.present? - = markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text) + %p + = _('GitLab is a single application for the entire software development lifecycle. From project planning and source code management to CI/CD, monitoring, and security.') - = render_if_exists 'layouts/devise_help_text' + %p + = _('This is a self-managed instance of GitLab.') - .col-md-6.order-1.new-session-forms-container{ class: recently_confirmed_com? ? 'order-sm-first' : 'order-sm-12' } - = yield + - if Gitlab::CurrentSettings.sign_in_text.present? + = markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text) - = render 'devise/shared/footer', footer_message: footer_message + = render_if_exists 'layouts/devise_help_text' + + .col-md-6.order-1.new-session-forms-container{ class: recently_confirmed_com? ? 'order-sm-first' : 'order-sm-12' } + = yield + + = render 'devise/shared/footer', footer_message: footer_message diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml index 1c2ab8cf008..67809cbc608 100644 --- a/app/views/layouts/group.html.haml +++ b/app/views/layouts/group.html.haml @@ -6,8 +6,8 @@ - @left_sidebar = true - content_for :flash_message do - = render "layouts/header/storage_enforcement_banner", namespace: @group - = dispensable_render_if_exists "shared/namespace_storage_limit_alert" + = render "layouts/header/storage_enforcement_banner", context: @group + = dispensable_render_if_exists "shared/namespace_storage_limit_alert", context: @group - content_for :page_specific_javascripts do - if current_user diff --git a/app/views/layouts/header/_current_user_dropdown.html.haml b/app/views/layouts/header/_current_user_dropdown.html.haml index 11dd8ba6c08..353f07c07c5 100644 --- a/app/views/layouts/header/_current_user_dropdown.html.haml +++ b/app/views/layouts/header/_current_user_dropdown.html.haml @@ -12,7 +12,7 @@ - if can?(current_user, :update_user_status, current_user) %li %button.gl-button.btn.btn-link.menu-item.js-set-status-modal-trigger{ type: 'button' } - - if show_status_emoji?(current_user.status) || user_status_set_to_busy?(current_user.status) + - if current_user.status&.busy? || current_user.status&.customized? = s_('SetStatusModal|Edit status') - else = s_('SetStatusModal|Set status') diff --git a/app/views/layouts/header/_current_user_dropdown_item.html.haml b/app/views/layouts/header/_current_user_dropdown_item.html.haml index 06c597b4932..3fded43ee4f 100644 --- a/app/views/layouts/header/_current_user_dropdown_item.html.haml +++ b/app/views/layouts/header/_current_user_dropdown_item.html.haml @@ -1,11 +1,11 @@ .gl-font-weight-bold = current_user.name - - if current_user&.status && user_status_set_to_busy?(current_user.status) + - if current_user.status&.busy? %span.gl-font-weight-normal.gl-text-gray-500= s_("UserProfile|(Busy)") = current_user.to_reference - if current_user.status .user-status.d-flex.align-items-center.gl-mt-2.gl-mr-0.gl-font-sm.has-tooltip{ title: current_user.status.message_html, data: { html: 'true', placement: 'bottom' } } - - if show_status_emoji?(current_user.status) + - if current_user.status.customized? .user-status-emoji.d-flex.align-items-center = emoji_icon current_user.status.emoji %span.user-status-message.str-truncated diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 911cb85de53..783733bb313 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -8,7 +8,7 @@ .title-container.hide-when-top-nav-responsive-open.gl-transition-medium.gl-display-flex.gl-align-items-stretch.gl-pt-0 .title %span.gl-sr-only GitLab - = link_to root_path, title: _('Dashboard'), id: 'logo', **tracking_attrs('main_navigation', 'click_gitlab_logo_link', 'navigation') do + = link_to root_path, title: _('Dashboard'), id: 'logo', class: 'has-tooltip', **tracking_attrs('main_navigation', 'click_gitlab_logo_link', 'navigation') do = brand_header_logo - if Gitlab.com_and_canary? = link_to Gitlab::Saas.canary_toggle_com_url, class: 'canary-badge bg-transparent', data: { qa_selector: 'canary_badge_link' }, target: :_blank, rel: 'noopener noreferrer' do @@ -57,8 +57,8 @@ = number_with_delimiter(issues_count) - if header_link?(:merge_requests) = nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter dropdown" }) do - - top_level_link = current_user.mr_attention_requests_enabled? ? attention_requested_mrs_dashboard_path : assigned_mrs_dashboard_path - = link_to top_level_link, class: 'dashboard-shortcuts-merge_requests', title: _('Merge requests'), aria: { label: _('Merge requests') }, + - top_level_link = assigned_mrs_dashboard_path + = link_to top_level_link, class: 'dashboard-shortcuts-merge_requests has-tooltip', title: _('Merge requests'), aria: { label: _('Merge requests') }, data: { qa_selector: 'merge_requests_shortcut_button', toggle: "dropdown", placement: 'bottom', @@ -74,27 +74,14 @@ %ul %li.dropdown-header = _('Merge requests') - - if current_user.mr_attention_requests_enabled? - %li#js-need-attention-nav - #js-need-attention-nav-onboarding - = link_to attention_requested_mrs_dashboard_path, class: 'gl-display-flex! gl-align-items-center js-prefetch-document' do - = _('Need your attention') - = gl_badge_tag user_merge_requests_counts[:attention_requested_count], { size: :sm, variant: user_merge_requests_counts[:attention_requested_count] == 0 ? :neutral : :warning }, { class: 'merge-request-badge gl-ml-auto js-attention-count' } - %li.divider %li = link_to assigned_mrs_dashboard_path, class: 'gl-display-flex! gl-align-items-center js-prefetch-document' do - - if current_user.mr_attention_requests_enabled? - = _('Assignee') - - else - = _('Assigned to you') + = _('Assigned to you') = gl_badge_tag({ variant: :neutral, size: :sm }, { class: "js-assigned-mr-count gl-ml-auto" }) do = user_merge_requests_counts[:assigned] %li = link_to reviewer_mrs_dashboard_path, class: 'gl-display-flex! gl-align-items-center js-prefetch-document' do - - if current_user.mr_attention_requests_enabled? - = _('Reviewer') - - else - = _('Review requests for you') + = _('Review requests for you') = gl_badge_tag({ variant: :neutral, size: :sm }, { class: "js-reviewer-mr-count gl-ml-auto" }) do = user_merge_requests_counts[:review_requested] - if header_link?(:todos) diff --git a/app/views/layouts/header/_storage_enforcement_banner.html.haml b/app/views/layouts/header/_storage_enforcement_banner.html.haml index c117f22a402..1f7060f8235 100644 --- a/app/views/layouts/header/_storage_enforcement_banner.html.haml +++ b/app/views/layouts/header/_storage_enforcement_banner.html.haml @@ -1,14 +1,15 @@ - return unless current_user -- namespace = local_assigns.fetch(:namespace) -- banner_info = storage_enforcement_banner_info(namespace) +- context = local_assigns.fetch(:context) +- banner_info = storage_enforcement_banner_info(context) - return unless banner_info.present? = render Pajamas::AlertComponent.new(variant: :warning, alert_options: { class: 'js-storage-enforcement-banner', data: { feature_id: banner_info[:callouts_feature_name], dismiss_endpoint: banner_info[:callouts_path], - group_id: namespace.id, + group_id: banner_info[:namespace_id], defer_links: "true" }}) do |c| = c.body do - = banner_info[:text] - = banner_info[:learn_more_link] + %p= banner_info[:text_paragraph_1] + %p= banner_info[:text_paragraph_2] + %p= banner_info[:text_paragraph_3] diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index 02565a8f573..f3f79750643 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -7,14 +7,14 @@ %span.sidebar-context-title = _('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 admin/topics jobs runners gitaly_servers cohorts), html_options: {class: 'home'}) do + = nav_link(controller: %w[dashboard admin admin/projects users groups admin/topics jobs runners gitaly_servers cohorts], html_options: {class: 'home'}) do = link_to admin_root_path, class: 'has-sub-items' do .nav-icon-container = sprite_icon('overview') %span.nav-item-name = _('Overview') %ul.sidebar-sub-level-items - = nav_link(controller: %w(dashboard admin admin/projects users groups jobs runners gitaly_servers cohorts), html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: %w[dashboard admin admin/projects users groups jobs runners gitaly_servers cohorts], html_options: { class: "fly-out-top-item" } ) do = link_to admin_root_path do %strong.fly-out-top-item-name = _('Overview') @@ -27,7 +27,7 @@ = link_to admin_projects_path, title: _('Projects') do %span = _('Projects') - = nav_link(controller: %w(users cohorts)) do + = nav_link(controller: %w[users cohorts]) do = link_to admin_users_path, title: _('Users'), data: { qa_selector: 'users_overview_link' } do %span = _('Users') diff --git a/app/views/layouts/nav/sidebar/_profile.html.haml b/app/views/layouts/nav/sidebar/_profile.html.haml index 16c0c00ad3f..cf1f84790a2 100644 --- a/app/views/layouts/nav/sidebar/_profile.html.haml +++ b/app/views/layouts/nav/sidebar/_profile.html.haml @@ -3,7 +3,7 @@ .context-header = link_to profile_path, title: _('Profile Settings'), class: 'has-tooltip', data: { container: 'body', placement: 'right' } do %span{ class: ['avatar-container', 'settings-avatar', 's32'] } - = image_tag avatar_icon_for_user(current_user, 32), class: ['avatar', 'avatar-tile', 'js-sidebar-user-avatar', 's32'], alt: current_user.name, data: { testid: 'sidebar-user-avatar' } + = image_tag avatar_icon_for_user(current_user, 32), class: ['avatar', 'avatar-tile', 'js-sidebar-user-avatar', 's32', 'gl-rounded-full!'], alt: current_user.name, 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 diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index 322a77116c8..1ec839ef642 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -7,6 +7,7 @@ - enable_search_settings locals: { container_class: 'gl-my-5' } - content_for :flash_message do - = render "layouts/header/storage_enforcement_banner", namespace: current_user.namespace + = render "layouts/header/storage_enforcement_banner", context: current_user.namespace + = dispensable_render_if_exists "shared/namespace_storage_limit_alert", context: current_user.namespace = render template: "layouts/application" diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 86b4c4eabe3..9503e874fd0 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -8,8 +8,8 @@ - @content_class = [@content_class, project_classes(@project)].compact.join(" ") - content_for :flash_message do - = render "layouts/header/storage_enforcement_banner", namespace: @project.namespace - = dispensable_render_if_exists "shared/namespace_storage_limit_alert" + = render "layouts/header/storage_enforcement_banner", context: @project + = dispensable_render_if_exists "shared/namespace_storage_limit_alert", context: @project - content_for :project_javascripts do - project = @target_project || @project |