Commit bad14e03 authored by nicolasdular's avatar nicolasdular

Use partial to render broadcast messages

Instead of rendering it in a helper we extracted everything to
HAML.
parent 24f16072
...@@ -12,13 +12,7 @@ module BroadcastMessagesHelper ...@@ -12,13 +12,7 @@ module BroadcastMessagesHelper
def broadcast_message(message, opts = {}) def broadcast_message(message, opts = {})
return unless message.present? return unless message.present?
classes = "broadcast-#{message.broadcast_type}-message #{opts[:preview] && 'preview'}" render 'shared/broadcast_message', { message: message, opts: opts }
content_tag :div, dir: 'auto', class: classes, style: broadcast_message_style(message) do
concat sprite_icon('bullhorn', size: 16, css_class: 'vertical-align-text-top')
concat ' '
concat render_broadcast_message(message)
end
end end
def broadcast_message_style(broadcast_message) def broadcast_message_style(broadcast_message)
......
- classes = "broadcast-#{message.broadcast_type}-message #{opts[:preview] && 'preview'}"
%div{classs: classes, style: broadcast_message_style(message), dir: 'auto'}
= sprite_icon('bullhorn', size: 16, css_class: 'vertical-align-text-top')
= ' '
= render_broadcast_message(message)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment