myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3796] branches/packs: added personal activity fe


From: noreply
Subject: [myexperiment-hackers] [3796] branches/packs: added personal activity feed
Date: Tue, 19 Nov 2013 14:13:19 +0000 (UTC)

Revision
3796
Author
dgc
Date
2013-11-19 14:13:18 +0000 (Tue, 19 Nov 2013)

Log Message

added personal activity feed

Modified Paths

Diff

Modified: branches/packs/app/controllers/home_controller.rb (3795 => 3796)


--- branches/packs/app/controllers/home_controller.rb	2013-11-19 13:51:38 UTC (rev 3795)
+++ branches/packs/app/controllers/home_controller.rb	2013-11-19 14:13:18 UTC (rev 3796)
@@ -6,11 +6,27 @@
 class HomeController < ApplicationController
   
   before_filter :login_required, :except => [:index]
+
+  include ActivitiesHelper
   
   # GET /home
   def index
     respond_to do |format|
-      format.html # index.rhtml
+      format.html {
+        # index.rhtml
+      }
+
+      format.atom {
+        @title = "Personal feed"
+        @id = @resource = home_url
+        @entries = activities_for_feed(:user => current_user, :no_combine => true)
+
+        unless @entries.empty? || @entries.last.empty?
+          @updated = @entries.last.last.timestamp.to_datetime.rfc3339
+        end
+
+        render "activities/feed.atom"
+      }
     end
   end
   

Modified: branches/packs/app/models/activity.rb (3795 => 3796)


--- branches/packs/app/models/activity.rb	2013-11-19 13:51:38 UTC (rev 3795)
+++ branches/packs/app/models/activity.rb	2013-11-19 14:13:18 UTC (rev 3796)
@@ -149,6 +149,12 @@
         end
 
         auth = object
+
+      when "Attribution"
+
+        contexts << object.attributor
+        contexts << object.attributable
+
     end
 
     uuid = SecureRandom.uuid

Modified: branches/packs/config/routes.rb (3795 => 3796)


--- branches/packs/config/routes.rb	2013-11-19 13:51:38 UTC (rev 3795)
+++ branches/packs/config/routes.rb	2013-11-19 14:13:18 UTC (rev 3796)
@@ -365,6 +365,10 @@
     :conditions   => { :method => :post },
     :requirements => { :path => /.*/ }
 
+  # Home page
+  map.home           '/home',         :conditions => { :method => :get }, :controller => 'home', :action ="" 'show'
+  map.formatted_home '/home.:format', :conditions => { :method => :get }, :controller => 'home', :action ="" 'show'
+
   # Install the default route as the lowest priority.
   map.connect ':controller/:action/:id'
 end

reply via email to

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