Diff
Modified: branches/event_logging/app/controllers/users_controller.rb (1970 => 1971)
--- branches/event_logging/app/controllers/users_controller.rb 2008-11-14 17:41:40 UTC (rev 1970)
+++ branches/event_logging/app/controllers/users_controller.rb 2008-11-14 18:12:00 UTC (rev 1971)
@@ -9,11 +9,12 @@
show_actions = [:show, :news, :friends, :groups, :credits, :tags, :favourites] + contributable_actions
# add ', :invite' to allow displaying of invitation screen without logging in
+ # "my_activity" to be displayed only to the user themself, so login is required (and secure 'find_user_auth' used)
before_filter :login_required, :except => [:index, :new, :create, :search, :all, :confirm_email, :forgot_password, :reset_password] + show_actions
before_filter :find_users, : [:all]
before_filter :find_user, : show_actions
- before_filter :find_user_auth, : [:edit, :update, :destroy]
+ before_filter :find_user_auth, : [:edit, :update, :destroy, :my_activity]
# declare sweepers and which actions should invoke them
cache_sweeper :user_sweeper, : [ :create, :update, :destroy ]
@@ -64,6 +65,11 @@
@tab = "News"
render :action ="" 'show'
end
+
+ def my_activity
+ @tab = "My Activity"
+ render :action ="" 'show'
+ end
def friends
@tab = "Friends"
Modified: branches/event_logging/app/views/users/show.rhtml (1970 => 1971)
--- branches/event_logging/app/views/users/show.rhtml 2008-11-14 17:41:40 UTC (rev 1970)
+++ branches/event_logging/app/views/users/show.rhtml 2008-11-14 18:12:00 UTC (rev 1971)
@@ -360,6 +360,12 @@
<% end %>
<% end %>
+ <% when "My Activity" %>
+
+ <div>
+
+ </div>
+
<% when "Friends" %>
<div>
Modified: branches/event_logging/app/views/widgets/_user_tabnav.rhtml (1970 => 1971)
--- branches/event_logging/app/views/widgets/_user_tabnav.rhtml 2008-11-14 17:41:40 UTC (rev 1970)
+++ branches/event_logging/app/views/widgets/_user_tabnav.rhtml 2008-11-14 18:12:00 UTC (rev 1971)
@@ -32,6 +32,14 @@
t.links_to :action ="" 'news', :id => @user.id
t.highlights_on :action ="" 'show', :id => @user.id
end
+
+ if logged_in? && @user.id == current_user.id
+ add_tab do |t|
+ t.named 'My Activity'
+ t.titled 'My Activity'
+ t.links_to :action ="" 'my_activity', :id => @user.id
+ end
+ end
unless @user.friends.empty?
add_tab do |t|
Modified: branches/event_logging/config/routes.rb (1970 => 1971)
--- branches/event_logging/config/routes.rb 2008-11-14 17:41:40 UTC (rev 1970)
+++ branches/event_logging/config/routes.rb 2008-11-14 18:12:00 UTC (rev 1971)
@@ -155,7 +155,7 @@
map.connect 'users/forgot_password', :controller => "users", :action ="" "forgot_password"
map.connect 'users/reset_password/:reset_code', :controller => "users", :action ="" "reset_password"
- [ 'news', 'friends', 'groups', 'workflows', 'files', 'packs', 'forums', 'blogs', 'credits', 'tags', 'favourites' ].each do |tab|
+ [ 'news', '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