Description:
Implement list_all action for message console
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r454:f9a07e801f84 - - 2 files changed: 8 inserted, 2 deleted
@@ -6,7 +6,7 | |||||
|
6 | :redirect_to => { :action => 'list' } |
|
6 | :redirect_to => { :action => 'list' } |
|
7 |
|
7 | ||
|
8 | before_filter :admin_authorization, :only => ['console','show', |
|
8 | before_filter :admin_authorization, :only => ['console','show', |
|
9 | - 'reply','hide'] |
|
9 | + 'reply','hide','list_all'] |
|
10 |
|
10 | ||
|
11 | def list |
|
11 | def list |
|
12 | @user = User.find(session[:user_id]) |
|
12 | @user = User.find(session[:user_id]) |
@@ -22,6 +22,11 | |||||
|
22 | @message = Message.find(params[:id]) |
|
22 | @message = Message.find(params[:id]) |
|
23 | end |
|
23 | end |
|
24 |
|
24 | ||
|
|
25 | + def list_all | ||
|
|
26 | + @user = User.find(session[:user_id]) | ||
|
|
27 | + @messages = Message.where(receiver_id: nil).order(:created_at) | ||
|
|
28 | + end | ||
|
|
29 | + | ||
|
25 | def create |
|
30 | def create |
|
26 | user = User.find(session[:user_id]) |
|
31 | user = User.find(session[:user_id]) |
|
27 | @message = Message.new(params[:message]) |
|
32 | @message = Message.new(params[:message]) |
@@ -8,4 +8,5 | |||||
|
8 | %td |
|
8 | %td |
|
9 | - if short_message.sender |
|
9 | - if short_message.sender |
|
10 | = link_to "[reply]", :action => 'show', :id => short_message.id |
|
10 | = link_to "[reply]", :action => 'show', :id => short_message.id |
|
11 | - = link_to "[hide]", :action => 'hide', :id => short_message.id |
|
11 | + - if params[:action] != 'list_all' |
|
|
12 | + = link_to "[hide]", :action => 'hide', :id => short_message.id |
You need to be logged in to leave comments.
Login now