Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2015-09-17 03:46:24 +0300
committerPatricio Cano <suprnova32@gmail.com>2015-09-17 03:46:24 +0300
commit4c98357f16b1acfa793d8a5b28c7147e21f20356 (patch)
tree4fac132cf08e07b89a44c5cc253727c4c2552924 /app/models
parentde1ffce7391a9e6adf07a8be60cd36bbc95ef2f3 (diff)
Added Global to the drop downs and updated the label of the button to show the current level instead of `Notifications`
Diffstat (limited to 'app/models')
-rw-r--r--app/models/notification.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/app/models/notification.rb b/app/models/notification.rb
index 828378655ce..171b8df45c2 100644
--- a/app/models/notification.rb
+++ b/app/models/notification.rb
@@ -26,7 +26,7 @@ class Notification
end
def project_notification_levels
- [N_DISABLED, N_PARTICIPATING, N_WATCH, N_GLOBAL, N_MENTION]
+ [N_DISABLED, N_MENTION, N_PARTICIPATING, N_WATCH, N_GLOBAL]
end
end
@@ -57,4 +57,21 @@ class Notification
def level
target.notification_level
end
+
+ def to_s
+ case level
+ when N_DISABLED
+ 'Disabled'
+ when N_PARTICIPATING
+ 'Participating'
+ when N_WATCH
+ 'Watching'
+ when N_MENTION
+ 'On mention'
+ when N_GLOBAL
+ 'Global'
+ else
+ # do nothing
+ end
+ end
end