myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [1985] branches/event_logging/app/helpers/applica


From: noreply
Subject: [myexperiment-hackers] [1985] branches/event_logging/app/helpers/application_helper.rb: News generation.
Date: Tue, 18 Nov 2008 10:46:38 -0500 (EST)

Revision
1985
Author
alekses6
Date
2008-11-18 10:46:38 -0500 (Tue, 18 Nov 2008)

Log Message

News generation. User profile page still shows events on user favourited / uploaded items but won't show site announcements any more.

Modified Paths

Diff

Modified: branches/event_logging/app/helpers/application_helper.rb (1984 => 1985)


--- branches/event_logging/app/helpers/application_helper.rb	2008-11-18 15:12:49 UTC (rev 1984)
+++ branches/event_logging/app/helpers/application_helper.rb	2008-11-18 15:46:38 UTC (rev 1985)
@@ -1634,13 +1634,17 @@
     # belonging to the user, favourited by the user, etc 
     
     # NB! only show this on the user's "home" page / profile page (never for the groups or "My Activity" feed on user profile page)
-    if contributor.class.to_s == "User" && !contributor_initiated_actions_only
+    if contributor.class.to_s == "User" && (!contributor_news_only || (contributor_news_only && !contributor_initiated_actions_only))
       # ==== Announcements ====
-      # add site announcements to the event list; (this user with no friends who are site admins AND
+      # add site announcements to the event list; (this way users with no friends who are site admins AND
       # who is not a member of any groups, where site admins are members too, will still get news
       # entries about site announcements - which is very important
-      site_announcements = ActivityLog.find(:all, :conditions => ["created_at > ? AND created_at < ? AND activity_loggable_type = ?", after, before, "Announcement"]) 
-      events.concat(site_announcements)
+      #
+      # don't show site announcements on profile page news feeds
+      unless contributor_news_only
+        site_announcements = ActivityLog.find(:all, :conditions => ["created_at > ? AND created_at < ? AND activity_loggable_type = ?", after, before, "Announcement"]) 
+        events.concat(site_announcements)
+      end
       
 
       # ==== User's Items ====

reply via email to

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