Hides project/group labels section if there are none

parent 2910896b
......@@ -18,28 +18,26 @@
-# Only show it in the first page
- hide = params[:page].present? && params[:page] != '1'
- if can?(current_user, :admin_label, @project)
.prioritized-labels{ class: ('hide' if hide) }
.prioritized-labels{ class: ('hidden' if hide) }
%h5 Prioritized Labels
%ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_namespace_project_labels_path(@project.namespace, @project) }
%p.empty-message{ class: ('hidden' unless @prioritized_labels.empty?) } No prioritized labels yet
- if @prioritized_labels.present?
= render partial: 'shared/label', collection: @prioritized_labels, as: :label
.group-labels{ class: ('hide' if hide || @project.group.blank?) }
.group-labels{ class: ('hidden' if hide || @project.group.blank? || @group_labels.empty?) }
%h5
= icon('folder-open')
Group Labels
%ul.content-list.manage-labels-list.js-group-labels
%p.empty-message{ class: ('hidden' unless @group_labels.empty?) } No group labels
- if @group_labels.present?
= render partial: 'shared/label', collection: @group_labels, as: :label
.project-labels
%h5{ class: ('hide' if hide) }
.project-labels{ class: ('hidden' if @project_labels.empty?) }
%h5{ class: ('hidden' if hide) }
= icon('bookmark')
Project Labels
%ul.content-list.manage-labels-list.js-project-labels
%p.empty-message{ class: ('hidden' unless @project_labels.empty?) } No project labels
- if @project_labels.present?
= render partial: 'shared/label', collection: @project_labels, as: :label
= paginate @project_labels, theme: 'gitlab'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment