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:
Diffstat (limited to 'app/helpers/gitlab/broadcast_messages_helper.rb')
-rw-r--r--app/helpers/gitlab/broadcast_messages_helper.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/helpers/gitlab/broadcast_messages_helper.rb b/app/helpers/gitlab/broadcast_messages_helper.rb
new file mode 100644
index 00000000000..93f0b0ec5ae
--- /dev/null
+++ b/app/helpers/gitlab/broadcast_messages_helper.rb
@@ -0,0 +1,18 @@
+module Gitlab
+ module BroadcastMessagesHelper
+ def broadcast_styling(broadcast_message)
+ 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
+end