Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-28 14:15:30 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-31 12:46:37 +0300
commit300f6aba4620a8c1f819786d56f50486276c0746 (patch)
treeea22744ba8c2204596a1d29d27bf646b5197c45c /app/views/projects/labels
parentc0bf3615059869ebc1148ba98140f76b81a651a7 (diff)
Add more UI logic to label search functionality
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects/labels')
-rw-r--r--app/views/projects/labels/index.html.haml18
1 files changed, 13 insertions, 5 deletions
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml
index fc5b1d1aea1..64324078de1 100644
--- a/app/views/projects/labels/index.html.haml
+++ b/app/views/projects/labels/index.html.haml
@@ -2,13 +2,14 @@
- page_title "Labels"
- can_admin_label = can?(current_user, :admin_label, @project)
- hide_class = ''
+- search = params[:search]
- if can_admin_label
- content_for(:header_content) do
.nav-controls
= link_to _('New label'), new_project_label_path(@project), class: "btn btn-new"
-- if @labels.exists? || @prioritized_labels.exists? || params[:search].present?
+- if @labels.exists? || @prioritized_labels.exists? || search.present?
#promote-label-modal
%div{ class: container_class }
.top-area.adjust
@@ -33,10 +34,13 @@
.prioritized-labels{ class: ('hide' if hide) }
%h5.prepend-top-10= _('Prioritized Labels')
.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_project_labels_path(@project) }
- #js-priority-labels-empty-state.priority-labels-empty-state{ class: "#{'hidden' unless @prioritized_labels.empty?}" }
+ #js-priority-labels-empty-state.priority-labels-empty-state{ class: "#{'hidden' unless @prioritized_labels.empty? && search.blank?}" }
= render 'shared/empty_states/priority_labels'
- if @prioritized_labels.present?
= render partial: 'shared/label', subject: @project, collection: @prioritized_labels, as: :label, locals: { force_priority: true }
+ - elsif search.present?
+ .nothing-here-block
+ = _('No labels with such name or description')
- if @labels.present?
.other-labels
@@ -45,9 +49,13 @@
.content-list.manage-labels-list.js-other-labels
= render partial: 'shared/label', subject: @project, collection: @labels, as: :label
= paginate @labels, theme: 'gitlab'
- - elsif params[:search].present?
- .nothing-here-block
- = _('No labels with such name or description')
+ - elsif search.present?
+ .other-labels
+ - if @available_labels.any?
+ %h5
+ = _('Other Labels')
+ .nothing-here-block
+ = _('No labels with such name or description')
- else
= render 'shared/empty_states/labels'