Diff
Modified: branches/event_logging/app/controllers/users_controller.rb (1973 => 1974)
--- branches/event_logging/app/controllers/users_controller.rb 2008-11-17 12:00:45 UTC (rev 1973)
+++ branches/event_logging/app/controllers/users_controller.rb 2008-11-17 13:20:56 UTC (rev 1974)
@@ -63,7 +63,13 @@
def news
@tab = "News"
- render :action ="" 'show'
+
+ respond_to do |format|
+ format.html { render :action ="" 'show' }
+ format.rss do
+ render :action ="" 'news.rxml', :layout => false
+ end
+ end
end
def my_activity
Added: branches/event_logging/app/views/users/news.rxml (0 => 1974)
--- branches/event_logging/app/views/users/news.rxml (rev 0)
+++ branches/event_logging/app/views/users/news.rxml 2008-11-17 13:20:56 UTC (rev 1974)
@@ -0,0 +1,11 @@
+xml.rss "version" => "2.0", 'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/", 'xmlns:atom' => "http://www.w3.org/2005/Atom" do
+ xml.channel do
+ xml.title "myExperiment.org - Public News for address@hidden"
+ xml.link user_url(@user)
+ xml.language "en-us"
+ xml.ttl "60"
+ xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href ="" "http://#{request.host_with_port}/open_search.xml"
+ xml.description "Public news of address@hidden on myExperiment.org"
+ render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributor(@user, Time.now, Time.now-DEFAULT_PUBLIC_NEWS_RSS_TIMEFRAME, true, false, false, DEFAULT_PUBLIC_NEWS_RSS_COUNT, nil), :locals => { :xm => xml })
+ end
+end
\ No newline at end of file
Modified: branches/event_logging/app/views/users/show.rhtml (1973 => 1974)
--- branches/event_logging/app/views/users/show.rhtml 2008-11-17 12:00:45 UTC (rev 1973)
+++ branches/event_logging/app/views/users/show.rhtml 2008-11-17 13:20:56 UTC (rev 1974)
@@ -64,12 +64,14 @@
<% if logged_in? %>
<% if mine? @user %>
<h1>
+ <%= feed_icon_tag("address@hidden's public news", formatted_news_user_path(@user, :rss), "float: right;") -%>
<%= if @user.profile then flag_icon(@user.profile.location_country, @user.profile.location) end %>
My Profile
<%= admin_badge(@user) %>
</h1>
<% else %>
<h1>
+ <%= feed_icon_tag("address@hidden's public news", formatted_news_user_path(@user, :rss), "float: right;") -%>
<%= if @user.profile then flag_icon(@user.profile.location_country, @user.profile.location) end %>
User Profile: <%=h @user.name %>
<%= friend_badge(@user) %>
Modified: branches/event_logging/config/routes.rb (1973 => 1974)
--- branches/event_logging/config/routes.rb 2008-11-17 12:00:45 UTC (rev 1973)
+++ branches/event_logging/config/routes.rb 2008-11-17 13:20:56 UTC (rev 1974)
@@ -155,12 +155,13 @@
map.connect 'users/forgot_password', :controller => "users", :action ="" "forgot_password"
map.connect 'users/reset_password/:reset_code', :controller => "users", :action ="" "reset_password"
- [ 'news', 'my_activity', 'friends', 'groups', 'workflows', 'files', 'packs', 'forums', 'blogs', 'credits', 'tags', 'favourites' ].each do |tab|
+ [ 'my_activity', 'friends', 'groups', 'workflows', 'files', 'packs', 'forums', 'blogs', 'credits', 'tags', 'favourites' ].each do |tab|
map.connect "users/:id/#{tab}", :controller => 'users', :action ="" tab
end
# all users
map.resources :users,
+ :member => { :news => :get },
:collection => { :all => :get,
:search => :get,
:invite => :get } do |user|