BigW Consortium Gitlab

index.html.haml 1.42 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 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
%hr

= 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
  .control-group
    = f.label :message
    .controls
      = f.text_area :message, class: "input-xxlarge", rows: 2, required: true
  .control-group
    = f.label :starts_at
    .controls.datetime-controls
      = f.datetime_select :starts_at
  .control-group
    = f.label :ends_at
    .controls.datetime-controls
      = f.datetime_select :ends_at
  .form-actions
    = f.submit "Add broadcast message", class: "btn btn-create"

-if @broadcast_messages.any?
28
  %ul.bordered-list.broadcast-messages
29 30 31 32 33 34 35 36 37 38
    - @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)}
39 40 41 42
           
          = link_to [:admin, broadcast_message], method: :delete, remote: true, class: 'remove-row btn btn-tiny' do
            %i.icon-remove.cred

43 44
        .message= broadcast_message.message

45

46
  = paginate @broadcast_messages