Commit 2fd334b8 authored by Luke Bennett's avatar Luke Bennett

Fix group labels list

parent bd47118e
......@@ -262,8 +262,6 @@
}
.label-list-item {
overflow-x: scroll;
.content-list &:before,
.content-list &:after {
content: none;
......
......@@ -9,11 +9,11 @@ class Groups::LabelsController < Groups::ApplicationController
respond_to :html
def index
@prioritized_labels = @available_labels.prioritized(@group)
@labels = @available_labels.unprioritized(@group).page(params[:page])
@labels = @group.labels.page(params[:page])
respond_to do |format|
format.html
format.html do
end
format.json do
render json: LabelSerializer.new.represent_appearance(@available_labels)
end
......
......@@ -2,6 +2,7 @@
- page_title "Labels"
- can_admin_label = can?(current_user, :admin_label, @group)
- hide_class = ''
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
- if can_admin_label
- content_for(:header_content) do
......@@ -9,7 +10,7 @@
= link_to new_group_label_path(@group), class: "btn btn-new" do
New label
- if @labels.exists? || @prioritized_labels.exists?
- if @labels.exists?
#promote-label-modal
%div{ class: container_class }
.top-area.adjust
......@@ -19,24 +20,12 @@
Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.
.labels-container.prepend-top-5
- if can_admin_label
-# Only show it in the first page
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
.prioritized-labels{ class: ('hide' if hide) }
%h5.prepend-top-0 Prioritized Labels
%ul.content-list.manage-labels-list.js-prioritized-labels
#js-priority-labels-empty-state.priority-labels-empty-state{ class: "#{'hidden' unless @prioritized_labels.empty?}" }
= render 'shared/empty_states/priority_labels'
- if @prioritized_labels.present?
= render partial: 'shared/label', subject: @group, collection: @prioritized_labels, as: :label
- if @labels.present?
.other-labels
- if can_admin_label
%h5{ class: ('hide' if hide) } Other Labels
%ul.content-list.manage-labels-list.js-other-labels
= render partial: 'shared/label', subject: @group, collection: @labels, as: :label
= paginate @labels, theme: 'gitlab'
.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
= paginate @labels, theme: 'gitlab'
- else
= render 'shared/empty_states/labels'
......
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