summaryrefslogtreecommitdiff
path: root/app/views/admin/broadcast_messages/index.html.haml
blob: 204b8cdd696e7ba74d71c877cb950efa3197cc5d (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
%h3.page-title
  Broadcast Messages
%p.light
  Broadcast messages are displayed for every user and can be used to notify users about scheduled maintenance, recent upgrades and more.
.broadcast-message-preview
  %i.icon-bullhorn
  %span Your message here

= form_for [:admin, @broadcast_message] do |f|
  -if @broadcast_message.errors.any?
    .alert.alert-error
      - @broadcast_message.errors.full_messages.each do |msg|
        %p= msg
  .form-group
    = f.label :message
    .col-sm-10
      = f.text_area :message, class: "input-lg", rows: 2, required: true
      %div
        = link_to '#', class: 'js-toggle-colors-link' do
          Customize colors
  .form-group.js-toggle-colors-container.gl-hide
    = f.label :color, "Background Color"
    .col-sm-10
      = f.text_field :color, placeholder: "#AA33EE"
      .light Hex values as 3 double digit numbers, starting with a # sign.
  .form-group.js-toggle-colors-container.gl-hide
    = f.label :font, "Font Color"
    .col-sm-10
      = f.text_field :font, placeholder: "#224466"
      .light Hex values as 3 double digit numbers, starting with a # sign.
  .form-group
    = f.label :starts_at
    .col-sm-10.datetime-controls
      = f.datetime_select :starts_at
  .form-group
    = f.label :ends_at
    .col-sm-10.datetime-controls
      = f.datetime_select :ends_at
  .form-actions
    = f.submit "Add broadcast message", class: "btn btn-create"

-if @broadcast_messages.any?
  %ul.bordered-list.broadcast-messages
    - @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)}
           
          = link_to [:admin, broadcast_message], method: :delete, remote: true, class: 'remove-row btn btn-tiny' do
            %i.icon-remove.cred

        .message= broadcast_message.message


  = paginate @broadcast_messages