Description:
added message hiding for admin in msg console
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@371 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r173:d8e86bba9b6f - - 3 files changed: 18 inserted, 1 deleted
@@ -5,7 +5,8 | |||
|
5 | 5 | verify :method => :post, :only => ['create'], |
|
6 | 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 | 10 | |
|
10 | 11 | def list |
|
11 | 12 | @user = User.find(session[:user_id]) |
@@ -48,6 +49,14 | |||
|
48 | 49 | end |
|
49 | 50 | end |
|
50 | 51 | |
|
52 | + def hide | |
|
53 | + message = Message.find(params[:id]) | |
|
54 | + message.replied = true | |
|
55 | + message.save | |
|
56 | + flash[:notice] = 'Message hided (just marked replied)' | |
|
57 | + redirect_to :action => 'console' | |
|
58 | + end | |
|
59 | + | |
|
51 | 60 | protected |
|
52 | 61 | def build_replying_message_hierarchy(user) |
|
53 | 62 | @all_messages = {} |
@@ -4,3 +4,4 | |||
|
4 | 4 | %td=h truncate(short_message.body) |
|
5 | 5 | %td |
|
6 | 6 | = link_to "[reply]", :action => 'show', :id => short_message.id |
|
7 | + = link_to "[hide]", :action => 'hide', :id => short_message.id |
@@ -11,3 +11,10 | |||
|
11 | 11 | = f.hidden_field :receiver_id, {:value => @message.sender_id } |
|
12 | 12 | = f.hidden_field :replying_message_id, {:value => @message.id } |
|
13 | 13 | = submit_tag "Post" |
|
14 | + | |
|
15 | + %p | |
|
16 | + If you do not want to reply, but want to hide this message from | |
|
17 | + console, you can | |
|
18 | + = link_to "[hide]", :action => 'hide', :id => @message.id | |
|
19 | + this message. (This message will be marked as replied.) | |
|
20 | + |
You need to be logged in to leave comments.
Login now