diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-01-01 01:55:14 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-01-13 19:42:15 +0300 |
commit | 00e8700433b3b1ad11252448af5be58913539d85 (patch) | |
tree | b506bc61c351ecbfa3a0c4c468911cf6374b1ba3 /app/views/admin/broadcast_messages | |
parent | 540ae3c3658d051f852b2c10fa61c557521196e1 (diff) |
Broadcast Messages can now be edited
Closes #3046
Diffstat (limited to 'app/views/admin/broadcast_messages')
-rw-r--r-- | app/views/admin/broadcast_messages/_form.html.haml | 10 | ||||
-rw-r--r-- | app/views/admin/broadcast_messages/edit.html.haml | 3 | ||||
-rw-r--r-- | app/views/admin/broadcast_messages/index.html.haml | 40 |
3 files changed, 31 insertions, 22 deletions
diff --git a/app/views/admin/broadcast_messages/_form.html.haml b/app/views/admin/broadcast_messages/_form.html.haml index 0ca3be0bd54..953b8b69368 100644 --- a/app/views/admin/broadcast_messages/_form.html.haml +++ b/app/views/admin/broadcast_messages/_form.html.haml @@ -1,6 +1,6 @@ -.broadcast-message-preview +.broadcast-message-preview{ style: broadcast_message_style(@broadcast_message) } = icon('bullhorn') - %span Your message here + %span= @broadcast_message.message || "Your message here" = form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form form-horizontal js-requires-input'} do |f| -if @broadcast_message.errors.any? @@ -10,18 +10,18 @@ .form-group = f.label :message, class: 'control-label' .col-sm-10 - = f.text_area :message, class: "form-control", rows: 2, required: true + = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true .form-group.js-toggle-colors-container .col-sm-10.col-sm-offset-2 = link_to 'Customize colors', '#', class: 'js-toggle-colors-link' .form-group.js-toggle-colors-container.hide = f.label :color, "Background Color", class: 'control-label' .col-sm-10 - = f.color_field :color, value: "#E75E40", class: "form-control" + = f.color_field :color, class: "form-control" .form-group.js-toggle-colors-container.hide = f.label :font, "Font Color", class: 'control-label' .col-sm-10 - = f.color_field :font, value: "#FFFFFF", class: "form-control" + = f.color_field :font, class: "form-control" .form-group = f.label :starts_at, class: 'control-label' .col-sm-10.datetime-controls diff --git a/app/views/admin/broadcast_messages/edit.html.haml b/app/views/admin/broadcast_messages/edit.html.haml new file mode 100644 index 00000000000..45e053eb31d --- /dev/null +++ b/app/views/admin/broadcast_messages/edit.html.haml @@ -0,0 +1,3 @@ +- page_title "Broadcast Messages" + += render 'form' diff --git a/app/views/admin/broadcast_messages/index.html.haml b/app/views/admin/broadcast_messages/index.html.haml index 04864d4afef..6c72b28ee0c 100644 --- a/app/views/admin/broadcast_messages/index.html.haml +++ b/app/views/admin/broadcast_messages/index.html.haml @@ -8,24 +8,30 @@ = render 'form' +%br.clearfix -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-xs' do - %i.fa.fa-times.cred - - .message= broadcast_message.message - + %table.table + %thead + %tr + %th Status + %th Preview + %th Starts + %th Ends + %th + %tbody + - @broadcast_messages.each do |message| + %tr + %td + = message.status + %td + = broadcast_message(message) + %td + = message.starts_at.to_s(:iso861) + %td + = message.ends_at.to_s(:iso861) + %td + = link_to icon('pencil-square-o'), edit_admin_broadcast_message_path(message), title: 'Edit', class: 'btn btn-xs' + = link_to icon('times'), admin_broadcast_message_path(message), method: :delete, remote: true, title: 'Remove', class: 'js-remove-tr btn btn-xs btn-danger' = paginate @broadcast_messages |