summaryrefslogtreecommitdiff
path: root/app/views/groups/labels
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-09-27 17:19:28 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-10-04 10:24:50 +0200
commit600a10b9d14c0d581efd270a68944957af762a17 (patch)
treed7f4fc6bf5abc9f1199b4256eb70f099f2e8c33c /app/views/groups/labels
parent2243e4d4ca4bbd96a05059d463d283d468a3fc57 (diff)
downloadgitlab-ce-600a10b9d14c0d581efd270a68944957af762a17.tar.gz
Add subscribe filter to labels page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/groups/labels')
-rw-r--r--app/views/groups/labels/index.html.haml20
1 files changed, 17 insertions, 3 deletions
diff --git a/app/views/groups/labels/index.html.haml b/app/views/groups/labels/index.html.haml
index 003bd25dd06..77be21ae2d0 100644
--- a/app/views/groups/labels/index.html.haml
+++ b/app/views/groups/labels/index.html.haml
@@ -3,20 +3,29 @@
- can_admin_label = can?(current_user, :admin_label, @group)
- issuables = ['issues', 'merge requests']
- search = params[:search]
+- subscribed = params[:subscribed]
+- labels_or_filters = @labels.exists? || search.present? || subscribed.present?
- if can_admin_label
- content_for(:header_content) do
.nav-controls
= link_to _('New label'), new_group_label_path(@group), class: "btn btn-success"
-- if @labels.exists? || search.present?
+- if labels_or_filters
#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 }
+ %ul.nav-links.nav.nav-tabs
+ %li{ class: active_when(subscribed != 'true') }>
+ = link_to group_labels_path(@group) do
+ = _('All')
+ - if current_user
+ %li{ class: active_when(subscribed == 'true') }>
+ = link_to group_labels_path(@group, subscribed: 'true') do
+ = _('Subscribed')
.nav-controls
= form_tag group_labels_path(@group), method: :get do
+ = hidden_field_tag :subscribed, params[:subscribed]
.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
@@ -26,6 +35,8 @@
.labels-container.prepend-top-5
- if @labels.any?
+ .text-muted
+ = _('Labels can be applied to %{features}. Group labels are available for any project within the group.') % { features: issuables.to_sentence }
.other-labels
%h5= _('Labels')
%ul.content-list.manage-labels-list.js-other-labels
@@ -34,6 +45,9 @@
- elsif search.present?
.nothing-here-block
= _('No labels with such name or description')
+ - elsif subscribed.present?
+ .nothing-here-block
+ = _('You do not have any subscriptions yet')
- else
= render 'shared/empty_states/labels'