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:
authorRobert Speicher <rspeicher@gmail.com>2015-05-22 00:49:06 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-22 13:13:46 +0300
commit5a9ede472150ec78f8410ae15cf782095c8f056c (patch)
tree5cbdbfb971329960011e8b3a3544e583f9551f6c /app/helpers
parentdad88568f34bfda5f7fe34672bc5099c80226138 (diff)
Update mock and stub syntax for specs
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/broadcast_messages_helper.rb15
-rw-r--r--app/helpers/icons_helper.rb2
-rw-r--r--app/helpers/notifications_helper.rb2
3 files changed, 15 insertions, 4 deletions
diff --git a/app/helpers/broadcast_messages_helper.rb b/app/helpers/broadcast_messages_helper.rb
index 29ff47663da..6484dca6b55 100644
--- a/app/helpers/broadcast_messages_helper.rb
+++ b/app/helpers/broadcast_messages_helper.rb
@@ -1,9 +1,16 @@
module BroadcastMessagesHelper
def broadcast_styling(broadcast_message)
- if(broadcast_message.color || broadcast_message.font)
- "background-color:#{broadcast_message.color};color:#{broadcast_message.font}"
- else
- ""
+ styling = ''
+
+ if broadcast_message.color.present?
+ styling << "background-color: #{broadcast_message.color}"
+ styling << '; ' if broadcast_message.font.present?
end
+
+ if broadcast_message.font.present?
+ styling << "color: #{broadcast_message.font}"
+ end
+
+ styling
end
end
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index a730684f8f3..30b17a736a7 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -1,4 +1,6 @@
module IconsHelper
+ include FontAwesome::Rails::IconHelper
+
# Creates an icon tag given icon name(s) and possible icon modifiers.
#
# Right now this method simply delegates directly to `fa_icon` from the
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb
index f771fe761ef..2f8e64c375f 100644
--- a/app/helpers/notifications_helper.rb
+++ b/app/helpers/notifications_helper.rb
@@ -1,4 +1,6 @@
module NotificationsHelper
+ include IconsHelper
+
def notification_icon(notification)
if notification.disabled?
icon('volume-off', class: 'ns-mute')