diff options
Diffstat (limited to 'app/views/layouts/header')
5 files changed, 47 insertions, 41 deletions
diff --git a/app/views/layouts/header/_current_user_dropdown.html.haml b/app/views/layouts/header/_current_user_dropdown.html.haml index d7ca93a296b..5ac0db4137f 100644 --- a/app/views/layouts/header/_current_user_dropdown.html.haml +++ b/app/views/layouts/header/_current_user_dropdown.html.haml @@ -2,18 +2,12 @@ %ul %li.current-user - .user-name.gl-font-weight-bold - = current_user.name - - if current_user&.status && user_status_set_to_busy?(current_user.status) - %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.has-tooltip{ title: current_user.status.message_html, data: { html: 'true', placement: 'bottom' } } - - if show_status_emoji?(current_user.status) - .user-status-emoji.d-flex.align-items-center - = emoji_icon current_user.status.emoji - %span.user-status-message.str-truncated - = current_user.status.message_html.html_safe + - if current_user_menu?(:profile) + = link_to current_user, class: 'gl-line-height-20!', data: { user: current_user.username, testid: 'user-profile-link' } do + = render 'layouts/header/current_user_dropdown_item' + - else + .gl-py-3.gl-px-4 + = render 'layouts/header/current_user_dropdown_item' %li.divider - if can?(current_user, :update_user_status, current_user) %li @@ -22,17 +16,16 @@ = s_('SetStatusModal|Edit status') - else = s_('SetStatusModal|Set status') - - if current_user_menu?(:profile) - %li - = link_to s_("CurrentUser|Profile"), current_user, class: 'profile-link', data: { user: current_user.username } - if current_user_menu?(:start_trial) %li %a.trial-link{ href: trials_link_url } - = s_("CurrentUser|Start a Gold trial") + = s_("CurrentUser|Start an Ultimate trial") = emoji_icon('rocket') - if current_user_menu?(:settings) %li - = link_to s_("CurrentUser|Settings"), profile_path, data: { qa_selector: 'settings_link' } + = link_to s_("CurrentUser|Edit profile"), profile_path, data: { qa_selector: 'edit_profile_link' } + %li + = link_to s_("CurrentUser|Preferences"), profile_preferences_path = render_if_exists 'layouts/header/buy_pipeline_minutes', project: @project, namespace: @group = render_if_exists 'layouts/header/upgrade' diff --git a/app/views/layouts/header/_current_user_dropdown_item.html.haml b/app/views/layouts/header/_current_user_dropdown_item.html.haml new file mode 100644 index 00000000000..06c597b4932 --- /dev/null +++ b/app/views/layouts/header/_current_user_dropdown_item.html.haml @@ -0,0 +1,12 @@ +.gl-font-weight-bold + = current_user.name + - if current_user&.status && user_status_set_to_busy?(current_user.status) + %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) + .user-status-emoji.d-flex.align-items-center + = emoji_icon current_user.status.emoji + %span.user-status-message.str-truncated + = current_user.status.message_html.html_safe diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index f7e93182ca2..c54ad23c094 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -15,7 +15,7 @@ %span.logo-text.d-none.d-lg-block.gl-ml-3 = logo_text - if Gitlab.com_and_canary? - = link_to 'https://next.gitlab.com', class: 'canary-badge bg-transparent', target: :_blank do + = link_to 'https://next.gitlab.com', class: 'canary-badge bg-transparent', target: :_blank, rel: :_noopener do %span.gl-badge.gl-bg-green-500.gl-text-white.gl-rounded-pill.gl-font-weight-bold.gl-py-1 = _('Next') @@ -47,11 +47,10 @@ %span.badge.badge-pill.issues-count.green-badge{ class: ('hidden' if issues_count == 0) } = number_with_delimiter(issues_count) - if header_link?(:merge_requests) - - reviewers_enabled = merge_request_reviewers_enabled? - = nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter #{reviewers_enabled ? 'dropdown' : ''}" }) do + = nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter dropdown" }) do = link_to assigned_mrs_dashboard_path, class: 'dashboard-shortcuts-merge_requests', title: _('Merge requests'), aria: { label: _('Merge requests') }, data: { qa_selector: 'merge_requests_shortcut_button', - toggle: reviewers_enabled ? "dropdown" : "tooltip", + toggle: "dropdown", placement: 'bottom', track_label: 'main_navigation', track_event: 'click_merge_link', @@ -60,23 +59,21 @@ = sprite_icon('git-merge') %span.badge.badge-pill.merge-requests-count.js-merge-requests-count{ class: ('hidden' if user_merge_requests_counts[:total] == 0) } = number_with_delimiter(user_merge_requests_counts[:total]) - - if reviewers_enabled - = sprite_icon('chevron-down', css_class: 'caret-down gl-mx-0!') - - if reviewers_enabled - .dropdown-menu.dropdown-menu-right - %ul - %li.dropdown-header - = _('Merge requests') - %li - = link_to assigned_mrs_dashboard_path, class: 'gl-display-flex! gl-align-items-center' do - = _('Assigned to you') - %span.badge.gl-badge.badge-pill.badge-muted.merge-request-badge.gl-ml-auto.js-assigned-mr-count{ class: "" } - = user_merge_requests_counts[:assigned] - %li - = link_to reviewer_mrs_dashboard_path, class: 'gl-display-flex! gl-align-items-center' do - = _('Review requests for you') - %span.badge.gl-badge.badge-pill.badge-muted.merge-request-badge.gl-ml-auto.js-reviewer-mr-count{ class: "" } - = user_merge_requests_counts[:review_requested] + = sprite_icon('chevron-down', css_class: 'caret-down gl-mx-0!') + .dropdown-menu.dropdown-menu-right + %ul + %li.dropdown-header + = _('Merge requests') + %li + = link_to assigned_mrs_dashboard_path, class: 'gl-display-flex! gl-align-items-center' do + = _('Assigned to you') + %span.badge.gl-badge.badge-pill.badge-muted.merge-request-badge.gl-ml-auto.js-assigned-mr-count{ class: "" } + = user_merge_requests_counts[:assigned] + %li + = link_to reviewer_mrs_dashboard_path, class: 'gl-display-flex! gl-align-items-center' do + = _('Review requests for you') + %span.badge.gl-badge.badge-pill.badge-muted.merge-request-badge.gl-ml-auto.js-reviewer-mr-count{ class: "" } + = user_merge_requests_counts[:review_requested] - if header_link?(:todos) = nav_link(controller: 'dashboard/todos', html_options: { class: "user-counter" }) do = link_to dashboard_todos_path, title: _('To-Do List'), aria: { label: _('To-Do List') }, class: 'shortcuts-todos', @@ -120,8 +117,7 @@ = sprite_icon('ellipsis_h', size: 12, css_class: 'more-icon js-navbar-toggle-right') = 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, versions: whats_new_versions, gitlab_dot_com: Gitlab.dev_env_org_or_com? } } +#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/header/_help_dropdown.html.haml b/app/views/layouts/header/_help_dropdown.html.haml index 40bf45db80d..c3769dd2993 100644 --- a/app/views/layouts/header/_help_dropdown.html.haml +++ b/app/views/layouts/header/_help_dropdown.html.haml @@ -1,6 +1,6 @@ %ul - if current_user_menu?(:help) - = render_if_exists 'layouts/header/whats_new_dropdown_item' + = render 'layouts/header/whats_new_dropdown_item' %li = link_to _("Help"), help_path %li diff --git a/app/views/layouts/header/_whats_new_dropdown_item.html.haml b/app/views/layouts/header/_whats_new_dropdown_item.html.haml new file mode 100644 index 00000000000..f79b741ced0 --- /dev/null +++ b/app/views/layouts/header/_whats_new_dropdown_item.html.haml @@ -0,0 +1,5 @@ +%li + %button.gl-justify-content-space-between.gl-align-items-center.js-whats-new-trigger{ type: 'button', data: { storage_key: whats_new_storage_key }, class: 'gl-display-flex!' } + = _("What's new") + %span.js-whats-new-notification-count.whats-new-notification-count + = whats_new_most_recent_release_items_count |