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?
|
|
|
|
.gl-broadcast-message.broadcast-banner-message{ role: "alert", class: "js-broadcast-notification-#{message.id} #{message.theme}" }
|
|
|
|
.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
|
|
|
|
%button.btn.gl-close-btn-color-inherit.gl-broadcast-message-dismiss.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.js-dismiss-current-broadcast-notification{ 'aria-label' => _('Close'), :type => 'button', data: { id: message.id, expire_date: message.ends_at.iso8601 } }
|
|
|
|
= sprite_icon('close', size: 16, css_class: "gl-icon gl-mx-3! gl-text-white")
|
|
|
|
- else
|
|
|
|
- notification_class = "js-broadcast-notification-#{message.id}"
|
|
|
|
- notification_class << ' preview' if preview
|
|
|
|
.broadcast-message.broadcast-notification-message.mt-2{ role: "alert", class: notification_class }
|
|
|
|
= sprite_icon(icon_name, css_class: 'vertical-align-text-top')
|
|
|
|
- if message.message.present?
|
|
|
|
= render_broadcast_message(message)
|
|
|
|
- else
|
|
|
|
= yield
|
|
|
|
- if !preview
|
2021-01-29 00:20:46 +05:30
|
|
|
%button.js-dismiss-current-broadcast-notification.btn.btn-link.gl-button{ 'aria-label' => _('Close'), :type => 'button', data: { id: message.id, expire_date: message.ends_at.iso8601 } }
|
2022-06-21 17:19:12 +05:30
|
|
|
= sprite_icon('close', size: 16, css_class: "gl-icon gl-mx-3! gl-text-gray-700")
|