Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_broadcast_message.html.haml « shared « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2f470d5ef538c363e5fee142c424936034bfcc19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- icon_name = 'bullhorn'
- dismissable = message.dismissable?
- preview = local_assigns.fetch(:preview, false)

- unless message.notification?
  .gl-broadcast-message.broadcast-banner-message.banner{ role: "alert",
    class: "js-broadcast-notification-#{message.id} #{message.theme}", data: { testid: 'banner-broadcast-message' } }
    .gl-broadcast-message-content
      .gl-broadcast-message-icon
        = sprite_icon(icon_name)
      .gl-broadcast-message-text.js-broadcast-message-preview
        - if message.message.present?
          %h2.gl-sr-only
            = s_("Admin message")
          = render_broadcast_message(message)
        - else
          = yield
    - if dismissable && !preview
      = 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-text-white')
- else
  - notification_class = "js-broadcast-notification-#{message.id}"
  - notification_class << ' preview' if preview
  .gl-broadcast-message.broadcast-notification-message.gl-mt-3{ role: "alert", class: notification_class, data: { qa_selector: 'broadcast_notification_container' } }
    .gl-broadcast-message-content
      .gl-broadcast-message-icon
        = sprite_icon(icon_name, css_class: 'vertical-align-text-top')
      - if message.message.present?
        %h2.gl-sr-only
          = s_("Admin message")
        = render_broadcast_message(message)
      - else
        = yield
    - if !preview
      = render Pajamas::ButtonComponent.new(category: :tertiary,
        icon: 'close',
        size: :small,
        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' } })