2021-09-04 01:27:46 +05:30
|
|
|
- view_model = new_dropdown_view_model(project: @project, group: @group)
|
|
|
|
- menu_sections = view_model.fetch(:menu_sections)
|
|
|
|
- title = view_model.fetch(:title)
|
|
|
|
- show_headers = menu_sections.length > 1
|
|
|
|
- top_class = local_assigns.fetch(:class, nil)
|
|
|
|
|
|
|
|
- return if menu_sections.empty?
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
%li.header-new.gl-flex-grow-1.gl-flex-shrink-1.dropdown{ class: top_class,
|
|
|
|
data: { track_label: "new_dropdown", track_action: "click_dropdown", track_property: "navigation_top" } }
|
|
|
|
= link_to new_project_path,
|
|
|
|
class: "header-new-dropdown-toggle has-tooltip gl-display-flex",
|
|
|
|
id: "js-onboarding-new-project-link",
|
|
|
|
title: title, ref: 'tooltip', aria: { label: title },
|
|
|
|
data: { toggle: 'dropdown', placement: 'bottom', container: 'body', display: 'static',
|
|
|
|
qa_selector: 'new_menu_toggle', testid: 'new-dropdown' } do
|
2020-10-24 23:57:45 +05:30
|
|
|
= sprite_icon('plus-square')
|
2021-01-03 14:25:43 +05:30
|
|
|
= sprite_icon('chevron-down', css_class: 'caret-down')
|
2021-03-08 18:12:59 +05:30
|
|
|
.dropdown-menu.dropdown-menu-right.dropdown-extended-height
|
2017-09-10 17:25:29 +05:30
|
|
|
%ul
|
2021-09-04 01:27:46 +05:30
|
|
|
- menu_sections.each_with_index do |section, index|
|
|
|
|
- if index > 0
|
2017-09-10 17:25:29 +05:30
|
|
|
%li.divider
|
2021-09-04 01:27:46 +05:30
|
|
|
- if show_headers
|
2018-11-18 11:00:15 +05:30
|
|
|
%li.dropdown-bold-header
|
2021-09-04 01:27:46 +05:30
|
|
|
= section.fetch(:title)
|
|
|
|
- section.fetch(:menu_items).each do |menu_item|
|
|
|
|
%li<
|
2023-05-27 22:25:52 +05:30
|
|
|
- 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)
|