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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-29 14:08:30 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-30 11:44:20 +0300
commit08b3d7f6ef23b7a8a83c7e71e2d04f6416e73406 (patch)
treeed350c2aa283545df35c93d46f7771dbf1900197 /app/helpers/notifications_helper.rb
parent855b2820c16c6e569d5c38b7def8ead18c86cecd (diff)
Refactor notification helper and fix notification service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/notifications_helper.rb')
-rw-r--r--app/helpers/notifications_helper.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb
index 8816cc5d164..54ab9179efc 100644
--- a/app/helpers/notifications_helper.rb
+++ b/app/helpers/notifications_helper.rb
@@ -16,8 +16,8 @@ module NotificationsHelper
end
end
- def notification_icon(level)
- icon("#{notification_icon_class(level)} fw")
+ def notification_icon(level, text = nil)
+ icon("#{notification_icon_class(level)} fw", text: text)
end
def notification_title(level)
@@ -39,14 +39,10 @@ module NotificationsHelper
notification_title: title
}
- content_tag(:li, class: active_level_for(setting, level)) do
+ content_tag(:li, class: ('active' if setting.level == level)) do
link_to '#', class: 'update-notification', data: data do
- icon("#{notification_icon_class(level)} fw", text: title)
+ notification_icon(level, title)
end
end
end
-
- def active_level_for(setting, level)
- 'active' if setting.level == level
- end
end