BigW Consortium Gitlab

index.html.haml 2.11 KB
Newer Older
1
- page_title "Broadcast Messages"
2 3 4
%h3.page-title
  Broadcast Messages
%p.light
5
  Broadcast messages are displayed for every user and can be used to notify users about scheduled maintenance, recent upgrades and more.
6
.broadcast-message-preview
7
  %i.fa.fa-bullhorn
8
  %span Your message here
9

10
= form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form form-horizontal'} do |f|
11
  -if @broadcast_message.errors.any?
12
    .alert.alert-danger
13 14
      - @broadcast_message.errors.full_messages.each do |msg|
        %p= msg
15
  .form-group
16
    = f.label :message, class: 'control-label'
17
    .col-sm-10
18
      = f.text_area :message, class: "form-control", rows: 2, required: true
19 20 21
      %div
        = link_to '#', class: 'js-toggle-colors-link' do
          Customize colors
22
  .form-group.js-toggle-colors-container.hide
23
    = f.label :color, "Background Color", class: 'control-label'
24
    .col-sm-10
25
      = f.color_field :color, value: "#eb9532", class: "form-control"
26
  .form-group.js-toggle-colors-container.hide
27
    = f.label :font, "Font Color", class: 'control-label'
28
    .col-sm-10
29
      = f.color_field :font, value: "#FFFFFF", class: "form-control"
30
  .form-group
31
    = f.label :starts_at, class: 'control-label'
32
    .col-sm-10.datetime-controls
33
      = f.datetime_select :starts_at
34
  .form-group
35
    = f.label :ends_at, class: 'control-label'
36
    .col-sm-10.datetime-controls
37 38 39 40 41
      = f.datetime_select :ends_at
  .form-actions
    = f.submit "Add broadcast message", class: "btn btn-create"

-if @broadcast_messages.any?
42
  %ul.bordered-list.broadcast-messages
43 44 45 46 47 48 49 50 51 52
    - @broadcast_messages.each do |broadcast_message|
      %li
        .pull-right
          - if broadcast_message.starts_at
            %strong
              #{broadcast_message.starts_at.to_s(:short)}
            \...
          - if broadcast_message.ends_at
            %strong
              #{broadcast_message.ends_at.to_s(:short)}
53
           
Dmitriy Zaporozhets committed
54
          = link_to [:admin, broadcast_message], method: :delete, remote: true, class: 'remove-row btn btn-xs' do
55
            %i.fa.fa-times.cred
56

57 58
        .message= broadcast_message.message

59

60
  = paginate @broadcast_messages