summaryrefslogtreecommitdiff
path: root/app/views/shared/_label.html.haml
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-01 15:02:58 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-17 15:10:13 -0200
commit4a29fde577a7d5d7c46ffff7c5feb79be23cdaa8 (patch)
tree31a014bba8e06b29175aea068631ece0a9f2ac78 /app/views/shared/_label.html.haml
parentb34c063ec428f1fd890a357a3f8ac7c129ee4c46 (diff)
downloadgitlab-ce-4a29fde577a7d5d7c46ffff7c5feb79be23cdaa8.tar.gz
Allow users to subscribe to group labels at project-level
Diffstat (limited to 'app/views/shared/_label.html.haml')
-rw-r--r--app/views/shared/_label.html.haml12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml
index f3c49870770..c8bc175093e 100644
--- a/app/views/shared/_label.html.haml
+++ b/app/views/shared/_label.html.haml
@@ -18,8 +18,8 @@
%li
= link_to_label(label, subject: subject) do
= pluralize open_issues_count, 'open issue'
- - if current_user
- %li.label-subscription{ data: toggle_subscription_data(label) }
+ - if current_user && defined?(@project)
+ %li.label-subscription{ data: toggle_subscription_data(label, @project) }
%a.js-subscribe-button.label-subscribe-button.subscription-status{ role: "button", href: "#", data: { toggle: "tooltip", status: label_subscription_status(label, @project) } }
%span= label_subscription_toggle_button_text(label, @project)
- if can?(current_user, :admin_label, label)
@@ -34,11 +34,11 @@
= link_to_label(label, subject: subject, css_class: 'btn btn-transparent btn-action') do
= pluralize open_issues_count, 'open issue'
- - if current_user
- .label-subscription.inline{ data: toggle_subscription_data(label) }
+ - if current_user && defined?(@project)
+ .label-subscription.inline{ data: toggle_subscription_data(label, @project) }
%button.js-subscribe-button.label-subscribe-button.btn.btn-transparent.btn-action.subscription-status{ type: "button", title: label_subscription_toggle_button_text(label, @project), data: { toggle: "tooltip", status: label_subscription_status(label, @project) } }
%span.sr-only= label_subscription_toggle_button_text(label, @project)
- = icon('eye', class: 'label-subscribe-button-icon', disabled: label.is_a?(GroupLabel))
+ = icon('eye', class: 'label-subscribe-button-icon')
= icon('spinner spin', class: 'label-subscribe-button-loading')
- if can?(current_user, :admin_label, label)
@@ -49,6 +49,6 @@
%span.sr-only Delete
= icon('trash-o')
- - if current_user && label.is_a?(ProjectLabel)
+ - if current_user && defined?(@project)
:javascript
new Subscription('##{dom_id(label)} .label-subscription');