2022-06-21 17:19:12 +05:30
|
|
|
- icon_name = 'bullhorn'
|
|
|
|
- dismissable = message.dismissable?
|
|
|
|
- preview = local_assigns.fetch(:preview, false)
|
2020-06-23 00:09:42 +05:30
|
|
|
|
2022-06-21 17:19:12 +05:30
|
|
|
- unless message.notification?
|
2023-03-17 16:20:25 +05:30
|
|
|
.gl-broadcast-message.broadcast-banner-message.banner{ role: "alert", class: "js-broadcast-notification-#{message.id} #{message.theme}" }
|
2022-06-21 17:19:12 +05:30
|
|
|
.gl-broadcast-message-content
|
|
|
|
.gl-broadcast-message-icon
|
|
|
|
= sprite_icon(icon_name)
|
|
|
|
.gl-broadcast-message-text.js-broadcast-message-preview
|
|
|
|
- if message.message.present?
|
|
|
|
= render_broadcast_message(message)
|
|
|
|
- else
|
|
|
|
= yield
|
|
|
|
- if dismissable && !preview
|
2022-07-23 23:45:48 +05:30
|
|
|
= render Pajamas::ButtonComponent.new(category: :tertiary,
|
|
|
|
icon: 'close',
|
|
|
|
size: :small,
|
|
|
|
button_options: { class: 'gl-close-btn-color-inherit gl-broadcast-message-dismiss js-dismiss-current-broadcast-notification', 'aria-label': _('Close'), data: { id: message.id, expire_date: message.ends_at.iso8601 } },
|
|
|
|
icon_classes: 'gl-mx-3! gl-text-white')
|
2022-06-21 17:19:12 +05:30
|
|
|
- else
|
|
|
|
- notification_class = "js-broadcast-notification-#{message.id}"
|
|
|
|
- notification_class << ' preview' if preview
|
2022-08-27 11:52:29 +05:30
|
|
|
.broadcast-message.broadcast-notification-message.mt-2{ role: "alert", class: notification_class, data: { qa_selector: 'broadcast_notification_container' } }
|
2022-06-21 17:19:12 +05:30
|
|
|
= sprite_icon(icon_name, css_class: 'vertical-align-text-top')
|
|
|
|
- if message.message.present?
|
|
|
|
= render_broadcast_message(message)
|
|
|
|
- else
|
|
|
|
= yield
|
|
|
|
- if !preview
|
2022-07-23 23:45:48 +05:30
|
|
|
= render Pajamas::ButtonComponent.new(variant: :link,
|
|
|
|
icon: 'close',
|
|
|
|
size: :small,
|
2022-08-27 11:52:29 +05:30
|
|
|
button_options: { class: 'js-dismiss-current-broadcast-notification', 'aria-label': _('Close'), data: { id: message.id, expire_date: message.ends_at.iso8601, qa_selector: 'close_button' } },
|
2022-07-23 23:45:48 +05:30
|
|
|
icon_classes: 'gl-mx-3! gl-text-gray-700')
|