BigW Consortium Gitlab

_search_bar.html.haml 6.44 KB
Newer Older
1
- type = local_assigns.fetch(:type)
2
- block_css_class = type != :boards_modal ? 'row-content-block second-block' : ''
3
- full_path = @project.present? ? @project.full_path : @group.full_path
4

Clement Ho committed
5
.issues-filters
6
  .issues-details-filters.filtered-search-block{ class: block_css_class, "v-pre" => type == :boards_modal }
Clement Ho committed
7 8 9
    = form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do
      - if params[:search].present?
        = hidden_field_tag :search, params[:search]
10 11 12
      - if @can_bulk_update
        .check-all-holder.hidden
          = check_box_tag "check-all-issues", nil, false, class: "check-all-issues left"
13 14
      .issues-other-filters.filtered-search-wrapper
        .filtered-search-box
15
          - if type != :boards_modal && type != :boards
16
            = dropdown_tag(custom_icon('icon_history'),
17 18 19 20 21
              options: { wrapper_class: "filtered-search-history-dropdown-wrapper",
              toggle_class: "filtered-search-history-dropdown-toggle-button",
              dropdown_class: "filtered-search-history-dropdown",
              content_class: "filtered-search-history-dropdown-content",
              title: "Recent searches" }) do
22
              .js-filtered-search-history-dropdown{ data: { full_path: full_path } }
23
          .filtered-search-box-input-container.droplab-dropdown
24 25 26
            .scroll-container
              %ul.tokens-container.list-unstyled
                %li.input-token
27
                  %input.form-control.filtered-search{ search_filter_input_options(type) }
28 29 30 31 32
            #js-dropdown-hint.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown
              %ul{ data: { dropdown: true } }
                %li.filter-dropdown-item{ data: { action: 'submit' } }
                  %button.btn.btn-link
                    = icon('search')
Clement Ho committed
33
                    %span
34 35 36 37 38 39 40 41 42 43 44
                      Press Enter or click to search
              %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                %li.filter-dropdown-item
                  %button.btn.btn-link
                    -# Encapsulate static class name `{{icon}}` inside #{} to bypass
                    -# haml lint's ClassAttributeWithStaticValue
                    %i.fa{ class: "#{'{{icon}}'}" }
                    %span.js-filter-hint
                      {{hint}}
                    %span.js-filter-tag.dropdown-light-content
                      {{tag}}
Clement Ho committed
45
            #js-dropdown-author.filtered-search-input-dropdown-menu.dropdown-menu
46 47 48 49
              - if current_user
                %ul{ data: { dropdown: true } }
                  = render 'shared/issuable/user_dropdown_item',
                    user: current_user
50
              %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
51 52 53
                = render 'shared/issuable/user_dropdown_item',
                  user: User.new(username: '{{username}}', name: '{{name}}'),
                  avatar: { lazy: true, url: '{{avatar_url}}' }
Clement Ho committed
54
            #js-dropdown-assignee.filtered-search-input-dropdown-menu.dropdown-menu
55 56 57 58
              %ul{ data: { dropdown: true } }
                %li.filter-dropdown-item{ data: { value: 'none' } }
                  %button.btn.btn-link
                    No Assignee
59
                %li.divider.droplab-item-ignore
60 61 62
                - if current_user
                  = render 'shared/issuable/user_dropdown_item',
                    user: current_user
63
              %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
64 65 66
                = render 'shared/issuable/user_dropdown_item',
                  user: User.new(username: '{{username}}', name: '{{name}}'),
                  avatar: { lazy: true, url: '{{avatar_url}}' }
Clement Ho committed
67
            #js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu
68 69 70 71 72 73 74 75 76 77
              %ul{ data: { dropdown: true } }
                %li.filter-dropdown-item{ data: { value: 'none' } }
                  %button.btn.btn-link
                    No Milestone
                %li.filter-dropdown-item{ data: { value: 'upcoming' } }
                  %button.btn.btn-link
                    Upcoming
                %li.filter-dropdown-item{ 'data-value' => 'started' }
                  %button.btn.btn-link
                    Started
78
                %li.divider.droplab-item-ignore
79 80 81
              %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                %li.filter-dropdown-item
                  %button.btn.btn-link.js-data-value
82
                    {{title}}
Clement Ho committed
83
            #js-dropdown-label.filtered-search-input-dropdown-menu.dropdown-menu
84 85 86 87
              %ul{ data: { dropdown: true } }
                %li.filter-dropdown-item{ data: { value: 'none' } }
                  %button.btn.btn-link
                    No Label
88
                %li.divider.droplab-item-ignore
89 90 91 92 93 94
              %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                %li.filter-dropdown-item
                  %button.btn.btn-link
                    %span.dropdown-label-box{ style: 'background: {{color}}' }
                    %span.label-title.js-data-value
                      {{title}}
95 96 97 98 99 100 101
            #js-dropdown-my-reaction.filtered-search-input-dropdown-menu.dropdown-menu
              %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                %li.filter-dropdown-item
                  %button.btn.btn-link
                    %gl-emoji
                    %span.js-data-value.prepend-left-10
                      {{name}}
102 103
          %button.clear-search.hidden{ type: 'button' }
            = icon('times')
104 105
        .filter-dropdown-container
          - if type == :boards
Simon Knox committed
106
            - if can?(current_user, :admin_list, board.parent)
Phil Hughes committed
107
              .dropdown.prepend-left-10#js-add-list
Simon Knox committed
108
                %button.btn.btn-create.btn-inverted.js-new-board-list{ type: "button", data: board_list_data }
109 110 111
                  Add list
                .dropdown-menu.dropdown-menu-paging.dropdown-menu-align-right.dropdown-menu-issues-board-new.dropdown-menu-selectable
                  = render partial: "shared/issuable/label_page_default", locals: { show_footer: true, show_create: true, show_boards_content: true, title: "Add list" }
Simon Knox committed
112
                  - if can?(current_user, :admin_label, board.parent)
113 114 115
                    = render partial: "shared/issuable/label_page_create"
                  = dropdown_loading
              #js-add-issues-btn.prepend-left-10
116
          - elsif type != :boards_modal
117
            = render 'shared/sort_dropdown'