summaryrefslogtreecommitdiff
path: root/app/views/admin/broadcast_messages/index.html.haml
blob: 7a005f9c982b5838d83e0933f11a5ccd8f8be910 (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
- breadcrumb_title _("Messages")
- page_title _("Broadcast Messages")
- vue_app_enabled = Feature.enabled?(:vue_broadcast_messages, current_user)

%h1.page-title.gl-font-size-h-display
  = _('Broadcast Messages')
%p.light
  = _('Use banners and notifications to notify your users about scheduled maintenance, recent upgrades, and more.')

- if vue_app_enabled
  #js-broadcast-messages{ data: {
    page: params[:page] || 1,
    target_access_level_options: target_access_level_options.to_json,
    messages_count: @broadcast_messages.total_count,
    messages: @broadcast_messages.map { |message| {
      id: message.id,
      status: broadcast_message_status(message),
      preview: broadcast_message(message, preview: true),
      starts_at: message.starts_at.to_s,
      ends_at: message.ends_at.to_s,
      target_roles: target_access_levels_display(message.target_access_levels),
      target_path: message.target_path,
      type: message.broadcast_type.capitalize,
      edit_path: edit_admin_broadcast_message_path(message),
      delete_path: admin_broadcast_message_path(message) + '.js'
    } }.to_json
  } }
- else
  = render 'form'
  %br.clearfix
  = render 'table'