diff options
author | Felipe Artur <fcardozo@gitlab.com> | 2018-09-04 19:54:05 +0300 |
---|---|---|
committer | Felipe Artur <fcardozo@gitlab.com> | 2018-09-04 19:54:05 +0300 |
commit | 732d8a83b65afde21ae09e05c295f5d8d1b39869 (patch) | |
tree | ea8cd245ff8c527824b32baf358d081b42555e2d /app/views | |
parent | 0db1db36d7aebc1b3545c5f677094a44225e3294 (diff) | |
parent | 329f7cbe9e605322985192b0fb6faa8de2222735 (diff) |
Merge branch 'dz-group-labels-search' into 'master'
Add search to group labels page
See merge request gitlab-org/gitlab-ce!21480
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/groups/labels/index.html.haml | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/app/views/groups/labels/index.html.haml b/app/views/groups/labels/index.html.haml index e1e38a7e82f..d63ef477177 100644 --- a/app/views/groups/labels/index.html.haml +++ b/app/views/groups/labels/index.html.haml @@ -3,26 +3,38 @@ - can_admin_label = can?(current_user, :admin_label, @group) - hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1') - issuables = ['issues', 'merge requests'] +- search = params[:search] - if can_admin_label - content_for(:header_content) do .nav-controls = link_to _('New label'), new_group_label_path(@group), class: "btn btn-new" -- if @labels.exists? +- if @labels.exists? || search.present? #promote-label-modal %div{ class: container_class } .top-area.adjust .nav-text = _('Labels can be applied to %{features}. Group labels are available for any project within the group.') % { features: issuables.to_sentence } + .nav-controls + = form_tag group_labels_path(@group), method: :get do + .input-group + = search_field_tag :search, params[:search], { placeholder: _('Filter'), id: 'label-search', class: 'form-control search-text-input input-short', spellcheck: false } + %span.input-group-append + %button.btn.btn-default{ type: "submit", "aria-label" => _('Submit search') } + = icon("search") .labels-container.prepend-top-5 - .other-labels - - if can_admin_label - %h5{ class: ('hide' if hide) } Labels - %ul.content-list.manage-labels-list.js-other-labels - = render partial: 'shared/label', subject: @group, collection: @labels, as: :label, locals: { use_label_priority: false } - = paginate @labels, theme: 'gitlab' + - if @labels.any? + .other-labels + - if can_admin_label + %h5{ class: ('hide' if hide) } Labels + %ul.content-list.manage-labels-list.js-other-labels + = render partial: 'shared/label', subject: @group, collection: @labels, as: :label, locals: { use_label_priority: false } + = paginate @labels, theme: 'gitlab' + - elsif search.present? + .nothing-here-block + = _('No labels with such name or description') - else = render 'shared/empty_states/labels' |