Skip to content
Snippets Groups Projects
Verified Commit 989caaeb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Improve admin broadcast messages page


* Show latest broadcast messages first on admin page
* Use nice looking pagination

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 0c449e36
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,7 +2,7 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController
before_action :finder, only: [:edit, :update, :destroy]
 
def index
@broadcast_messages = BroadcastMessage.reorder("starts_at ASC").page(params[:page])
@broadcast_messages = BroadcastMessage.reorder("ends_at DESC").page(params[:page])
@broadcast_message = BroadcastMessage.new
end
 
Loading
Loading
Loading
Loading
@@ -34,4 +34,4 @@
= 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
= paginate @broadcast_messages, theme: 'gitlab'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment