2015-04-30 13:06:18 -04:00
|
|
|
- page_title "Broadcast Messages"
|
2013-11-12 07:28:12 -05:00
|
|
|
%h3.page-title
|
|
|
|
Broadcast Messages
|
|
|
|
%p.light
|
2013-11-14 13:50:07 -05:00
|
|
|
Broadcast messages are displayed for every user and can be used to notify users about scheduled maintenance, recent upgrades and more.
|
2013-12-09 00:34:51 -05:00
|
|
|
.broadcast-message-preview
|
2014-10-01 18:21:29 -04:00
|
|
|
%i.fa.fa-bullhorn
|
2013-12-09 00:34:51 -05:00
|
|
|
%span Your message here
|
2013-11-12 07:28:12 -05:00
|
|
|
|
2014-01-04 12:30:38 -05:00
|
|
|
= form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form form-horizontal'} do |f|
|
2013-11-12 07:28:12 -05:00
|
|
|
-if @broadcast_message.errors.any?
|
2013-12-31 09:34:14 -05:00
|
|
|
.alert.alert-danger
|
2013-11-12 07:28:12 -05:00
|
|
|
- @broadcast_message.errors.full_messages.each do |msg|
|
|
|
|
%p= msg
|
2013-12-30 18:27:02 -05:00
|
|
|
.form-group
|
2014-01-04 12:30:38 -05:00
|
|
|
= f.label :message, class: 'control-label'
|
2013-12-30 18:27:02 -05:00
|
|
|
.col-sm-10
|
2014-01-01 15:11:18 -05:00
|
|
|
= f.text_area :message, class: "form-control", rows: 2, required: true
|
2013-12-09 00:34:51 -05:00
|
|
|
%div
|
|
|
|
= link_to '#', class: 'js-toggle-colors-link' do
|
|
|
|
Customize colors
|
2014-01-01 14:42:42 -05:00
|
|
|
.form-group.js-toggle-colors-container.hide
|
2014-01-04 12:30:38 -05:00
|
|
|
= f.label :color, "Background Color", class: 'control-label'
|
2013-12-30 18:27:02 -05:00
|
|
|
.col-sm-10
|
2015-06-08 14:39:02 -04:00
|
|
|
= f.color_field :color, value: "#eb9532", class: "form-control"
|
2014-01-01 14:42:42 -05:00
|
|
|
.form-group.js-toggle-colors-container.hide
|
2014-01-04 12:30:38 -05:00
|
|
|
= f.label :font, "Font Color", class: 'control-label'
|
2013-12-30 18:27:02 -05:00
|
|
|
.col-sm-10
|
2015-06-08 14:39:02 -04:00
|
|
|
= f.color_field :font, value: "#FFFFFF", class: "form-control"
|
2013-12-30 18:27:02 -05:00
|
|
|
.form-group
|
2014-01-04 12:30:38 -05:00
|
|
|
= f.label :starts_at, class: 'control-label'
|
2013-12-30 18:27:02 -05:00
|
|
|
.col-sm-10.datetime-controls
|
2013-11-12 07:28:12 -05:00
|
|
|
= f.datetime_select :starts_at
|
2013-12-30 18:27:02 -05:00
|
|
|
.form-group
|
2014-01-04 12:30:38 -05:00
|
|
|
= f.label :ends_at, class: 'control-label'
|
2013-12-30 18:27:02 -05:00
|
|
|
.col-sm-10.datetime-controls
|
2013-11-12 07:28:12 -05:00
|
|
|
= f.datetime_select :ends_at
|
|
|
|
.form-actions
|
|
|
|
= f.submit "Add broadcast message", class: "btn btn-create"
|
|
|
|
|
|
|
|
-if @broadcast_messages.any?
|
2013-11-12 08:20:31 -05:00
|
|
|
%ul.bordered-list.broadcast-messages
|
2013-11-12 07:28:12 -05:00
|
|
|
- @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)}
|
2013-11-12 08:20:31 -05:00
|
|
|
|
2015-03-14 03:29:32 -04:00
|
|
|
= link_to [:admin, broadcast_message], method: :delete, remote: true, class: 'remove-row btn btn-xs' do
|
2014-10-01 18:21:29 -04:00
|
|
|
%i.fa.fa-times.cred
|
2013-11-12 08:20:31 -05:00
|
|
|
|
2013-11-12 07:28:12 -05:00
|
|
|
.message= broadcast_message.message
|
|
|
|
|
2013-11-12 08:20:31 -05:00
|
|
|
|
2013-11-12 07:28:12 -05:00
|
|
|
= paginate @broadcast_messages
|