myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [1971] branches/event_logging: Subscriptions.


From: noreply
Subject: [myexperiment-hackers] [1971] branches/event_logging: Subscriptions.
Date: Fri, 14 Nov 2008 13:12:00 -0500 (EST)

Revision
1971
Author
alekses6
Date
2008-11-14 13:12:00 -0500 (Fri, 14 Nov 2008)

Log Message

Subscriptions. Prepared new tab (currently empty) on user profile page - "my activity". Will be filled with news that are the actions done by the current user (and only visible to them). All authorization work for viewing this tab / access through direct link done.

Modified Paths

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
   

reply via email to

[Prev in Thread] Current Thread [Next in Thread]