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

9
= form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form form-horizontal'} do |f|
10
  -if @broadcast_message.errors.any?
11
    .alert.alert-danger
12 13
      - @broadcast_message.errors.full_messages.each do |msg|
        %p= msg
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
14
  .form-group
15
    = f.label :message, class: 'control-label'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
16
    .col-sm-10
17
      = f.text_area :message, class: "form-control", rows: 2, required: true
18 19 20
      %div
        = link_to '#', class: 'js-toggle-colors-link' do
          Customize colors
21
  .form-group.js-toggle-colors-container.hide
22
    = f.label :color, "Background Color", class: 'control-label'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
23
    .col-sm-10
24
      = f.text_field :color, placeholder: "#AA33EE", class: "form-control"
25
      .light Hex values as 3 double digit numbers, starting with a # sign.
26
  .form-group.js-toggle-colors-container.hide
27
    = f.label :font, "Font Color", class: 'control-label'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
28
    .col-sm-10
29
      = f.text_field :font, placeholder: "#224466", class: "form-control"
30
      .light Hex values as 3 double digit numbers, starting with a # sign.
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
31
  .form-group
32
    = f.label :starts_at, class: 'control-label'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
33
    .col-sm-10.datetime-controls
34
      = f.datetime_select :starts_at
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
35
  .form-group
36
    = f.label :ends_at, class: 'control-label'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
37
    .col-sm-10.datetime-controls
38 39 40 41 42
      = f.datetime_select :ends_at
  .form-actions
    = f.submit "Add broadcast message", class: "btn btn-create"

-if @broadcast_messages.any?
43
  %ul.bordered-list.broadcast-messages
44 45 46 47 48 49 50 51 52 53
    - @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)}
54 55 56 57
           
          = link_to [:admin, broadcast_message], method: :delete, remote: true, class: 'remove-row btn btn-tiny' do
            %i.icon-remove.cred

58 59
        .message= broadcast_message.message

60

61
  = paginate @broadcast_messages