diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/user_controller.rb | 8 | ||||
-rw-r--r-- | app/views/user/river.rhtml | 12 |
2 files changed, 19 insertions, 1 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 5809484f1..9a8b92e81 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user_controller.rb,v 1.64 2009-03-18 02:37:42 francis Exp $ +# $Id: user_controller.rb,v 1.65 2009-04-14 14:51:00 tony Exp $ class UserController < ApplicationController # Show page about a user @@ -261,6 +261,12 @@ class UserController < ApplicationController end + # River of News: What's happening with your tracked things + def river + @results = @user.track_things.collect { |thing| + perform_search([InfoRequestEvent], thing.track_query, thing.params[:feed_sortby], nil).results + }.flatten.sort { |a,b| b[:model].created_at <=> a[:model].created_at }.first(20) + end private diff --git a/app/views/user/river.rhtml b/app/views/user/river.rhtml new file mode 100644 index 000000000..9618e0aa8 --- /dev/null +++ b/app/views/user/river.rhtml @@ -0,0 +1,12 @@ +<% @title = 'Recent Events' %> + +<div class="single_user"> + <h1><%=@title%></h1> + + <% for result in @results %> + <%= render :partial => 'request/request_listing_via_event', :locals => { + :event => result[:model], :info_request => result[:model].info_request } %> + <% end %> + +</div> + |