diff options
Diffstat (limited to 'app/helpers/labels_helper.rb')
-rw-r--r-- | app/helpers/labels_helper.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb index 74f6f1b1478..a5abae7fa8e 100644 --- a/app/helpers/labels_helper.rb +++ b/app/helpers/labels_helper.rb @@ -68,11 +68,9 @@ module LabelsHelper end end - def toggle_subscription_data(label) - return unless label.is_a?(ProjectLabel) - + def toggle_subscription_data(label, project) { - url: toggle_subscription_namespace_project_label_path(label.project.namespace, label.project, label) + url: toggle_subscription_namespace_project_label_path(project.namespace, project, label) } end @@ -149,17 +147,11 @@ module LabelsHelper end def label_subscription_status(label, project) - case label - when GroupLabel then 'Subscribing to group labels is currently not supported.' - when ProjectLabel then label.subscribed?(current_user, project) ? 'subscribed' : 'unsubscribed' - end + label.subscribed?(current_user, project) ? 'subscribed' : 'unsubscribed' end def label_subscription_toggle_button_text(label, project) - case label - when GroupLabel then 'Subscribing to group labels is currently not supported.' - when ProjectLabel then label.subscribed?(current_user, project) ? 'Unsubscribe' : 'Subscribe' - end + label.subscribed?(current_user, project) ? 'Unsubscribe' : 'Subscribe' end def label_deletion_confirm_text(label) |