Diff
Modified: branches/event_logging/app/controllers/blobs_controller.rb (2234 => 2235)
--- branches/event_logging/app/controllers/blobs_controller.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/controllers/blobs_controller.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -314,7 +314,7 @@
def find_blobs_rss
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
- found = Blob.find(:all, :order => "blobs.updated_at DESC", :limit => LATEST_CONTRIBUTABLES_RSS_ENTRY_COUNT, :include => [ { :contribution => {:policy => :permissions} } ])
+ found = Blob.find(:all, :order => "blobs.updated_at DESC", :limit => Conf.rss["latest_contributables_count"], :include => [ { :contribution => {:policy => :permissions} } ])
@rss_blobs = []
Modified: branches/event_logging/app/controllers/home_controller.rb (2234 => 2235)
--- branches/event_logging/app/controllers/home_controller.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/controllers/home_controller.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -72,7 +72,7 @@
def find_latest_public_group_announcements_rss
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
- @group_announcements_rss = GroupAnnouncement.latest_public(DEFAULT_RSS_ENTRY_COUNT)
+ @group_announcements_rss = GroupAnnouncement.latest_public(Conf.rss["default_count"])
end
end
@@ -80,7 +80,7 @@
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
@new_items_rss = []
- items = Contribution.latest(LATEST_ITEMS_RSS_ENTRY_COUNT)
+ items = Contribution.latest(Conf.rss["latest_items_count"])
items.each do |item|
# should be authorized for anonymous users to view
# (feed partials require contributables, not contributions to display details)
@@ -94,7 +94,7 @@
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
@updated_items_rss = []
- items = Contribution.last_updated(LATEST_UPDATED_ITEMS_RSS_ENTRY_COUNT)
+ items = Contribution.last_updated(Conf.rss["updated_items_count"])
items.each do |item|
# should be authorized for anonymous users to view
# (feed partials require contributables, not contributions to display details)
@@ -108,7 +108,7 @@
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
@latest_comments_rss = {}
- comments = Comment.latest(DEFAULT_RSS_ENTRY_COUNT)
+ comments = Comment.latest(Conf.rss["default_count"])
comments.each do |c|
# commented item should be authorized for anonymous users to view
@latest_comments_rss[c] = c.commentable if Authorization.is_authorized?("show", nil, c.commentable, current_user)
@@ -120,7 +120,7 @@
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
@latest_reviews_rss = {}
- reviews = Review.latest(DEFAULT_RSS_ENTRY_COUNT)
+ reviews = Review.latest(Conf.rss["default_count"])
reviews.each do |r|
# commented item should be authorized for anonymous users to view
@latest_reviews_rss[r] = r.reviewable if Authorization.is_authorized?("show", nil, r.reviewable, current_user)
Modified: branches/event_logging/app/controllers/packs_controller.rb (2234 => 2235)
--- branches/event_logging/app/controllers/packs_controller.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/controllers/packs_controller.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -435,7 +435,7 @@
def find_packs_rss
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
- found = Pack.find(:all, :order => "packs.updated_at DESC", :limit => LATEST_CONTRIBUTABLES_RSS_ENTRY_COUNT, :include => [ { :contribution => {:policy => :permissions} } ])
+ found = Pack.find(:all, :order => "packs.updated_at DESC", :limit => Conf.rss["latest_contributables_count"], :include => [ { :contribution => {:policy => :permissions} } ])
@rss_packs = []
Modified: branches/event_logging/app/controllers/tags_controller.rb (2234 => 2235)
--- branches/event_logging/app/controllers/tags_controller.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/controllers/tags_controller.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -85,7 +85,7 @@
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
@latest_tags_rss = {}
- taggings = Tagging.latest(DEFAULT_RSS_ENTRY_COUNT)
+ taggings = Tagging.latest(Conf.rss["default_count"])
taggings.each do |t|
# tagged item should be authorized for anonymous users to view
@latest_tags_rss[t] = t.taggable if Authorization.is_authorized?("show", nil, t.taggable, current_user)
Modified: branches/event_logging/app/controllers/workflows_controller.rb (2234 => 2235)
--- branches/event_logging/app/controllers/workflows_controller.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/controllers/workflows_controller.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -599,7 +599,7 @@
def find_workflows_rss
# Only carry out if request is for RSS
if params[:format] and params[:format].downcase == 'rss'
- found = Workflow.find(:all, :order => "workflows.updated_at DESC", :limit => LATEST_CONTRIBUTABLES_RSS_ENTRY_COUNT, :include => [ { :contribution => {:policy => :permissions} } ])
+ found = Workflow.find(:all, :order => "workflows.updated_at DESC", :limit => Conf.rss["latest_contributables_count"], :include => [ { :contribution => {:policy => :permissions} } ])
@rss_workflows = [ ]
Modified: branches/event_logging/app/helpers/application_helper.rb (2234 => 2235)
--- branches/event_logging/app/helpers/application_helper.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/helpers/application_helper.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -585,11 +585,11 @@
# (zero or NIL value indicates not logged in viewer; also a setting for RSS feeds, etc - only public events will be shown)
# 7) contributor_initiated_actions_only - (active only when "restrict_contributor" set to 'true'); 'true' to process only the actions in the
# event log, when "news_for" is a 'contributor' and where it is the "culprit" of the action
- def news(news_for, restrict_contributor=true, before=Time.now, after=Time.now-DEFAULT_NEWS_TIMEFRAME, limit=DEFAULT_NEWS_COUNT, current_viewer=nil, contributor_initiated_actions_only=false)
+ def news(news_for, restrict_contributor=true, before=Time.now, after=Time.now-Conf.news["default"]["timeframe"].days, limit=Conf.news["default"]["count"], current_viewer=nil, contributor_initiated_actions_only=false)
hash = {}
# if event logging is switched off in "environment_private.rb" - no news can be generated
- return hash unless USE_EVENT_LOG
+ return hash unless Conf.news["use_event_log"]
# collect all activity log events and interpret them as news entries;
# choose to display news feed type:
@@ -1765,6 +1765,7 @@
# interpret activity log entries into news entries
# (contributor set to NIL to indicate anonymous home page generation)
rtn = news_entries_from_log_entries(events, limit, current_viewer, nil, false)
+p rtn
return rtn
end
@@ -2722,7 +2723,7 @@
ans = false
related_object = []
- if (new_event.created_at - base_event.created_at <= EVENT_GROUPING_TIMEFRAME)
+ if (new_event.created_at - base_event.created_at <= Conf.news["event_grouping_timeframe"].seconds)
# action "create" && "Tagging" && ActivityLoggableType match (IDs can vary) && CulpritType/CulpritID match && ReferencedType/ReferencedID match
if ((["Tagging"].include? new_event.activity_loggable_type) && new_event.action == "create" &&
new_event.action == base_event.action && new_event.activity_loggable_type == base_event.activity_loggable_type &&
Modified: branches/event_logging/app/models/announcement.rb (2234 => 2235)
--- branches/event_logging/app/models/announcement.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/announcement.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -12,7 +12,7 @@
before_save :check_admin
- acts_as_activity_logged :models => { :culprit => { :model => :user } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :user } } if Conf.news["use_event_log"]
def check_admin
if !self.user_id.blank? and self.user.admin?
@@ -30,4 +30,4 @@
:order => "created_at DESC",
:limit => limit)
end
-end
\ No newline at end of file
+end
Modified: branches/event_logging/app/models/attribution.rb (2234 => 2235)
--- branches/event_logging/app/models/attribution.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/attribution.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -16,7 +16,7 @@
# this variable is set in the appropriate actions in the controller
attr_accessor :userid_initiating_action
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged(:models => { :culprit => { :model => :attributable },
:referenced => { :model => :attributor } },
:check_log_allowed => true)
Modified: branches/event_logging/app/models/blob.rb (2234 => 2235)
--- branches/event_logging/app/models/blob.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/blob.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -29,7 +29,7 @@
:boost => "search_boost",
:include => [ :comments ]) if Conf.solr_enable
- acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if Conf.news["use_event_log"]
belongs_to :content_blob
belongs_to :content_type
Modified: branches/event_logging/app/models/blog.rb (2234 => 2235)
--- branches/event_logging/app/models/blog.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/blog.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -17,7 +17,7 @@
acts_as_rateable
acts_as_taggable
- acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if Conf.news["use_event_log"]
has_many :posts,
:class_name => "BlogPost",
Modified: branches/event_logging/app/models/bookmark.rb (2234 => 2235)
--- branches/event_logging/app/models/bookmark.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/bookmark.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -14,7 +14,7 @@
belongs_to :user
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :bookmarkable } } if USE_EVENT_LOG
+ :referenced => { :model => :bookmarkable } } if Conf.news["use_event_log"]
validates_presence_of :bookmarkable
validates_presence_of :user
Modified: branches/event_logging/app/models/citation.rb (2234 => 2235)
--- branches/event_logging/app/models/citation.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/citation.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -15,6 +15,6 @@
validates_length_of :issn, :is => 8, :if => Proc.new { |c| !(c.issn.nil? or c.issn.empty?) }
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :workflow } } if USE_EVENT_LOG
+ :referenced => { :model => :workflow } } if Conf.news["use_event_log"]
end
Modified: branches/event_logging/app/models/comment.rb (2234 => 2235)
--- branches/event_logging/app/models/comment.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/comment.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -14,7 +14,7 @@
belongs_to :user
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :commentable } } if USE_EVENT_LOG
+ :referenced => { :model => :commentable } } if Conf.news["use_event_log"]
acts_as_solr :fields => [ :comment ] if Conf.solr_enable
Modified: branches/event_logging/app/models/creditation.rb (2234 => 2235)
--- branches/event_logging/app/models/creditation.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/creditation.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -16,7 +16,7 @@
# this variable is set in the appropriate actions in the controller
attr_accessor :userid_initiating_action
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged(:models => { :culprit => { :model => :creditable },
:referenced => { :model => :creditor } },
:check_log_allowed => true)
Modified: branches/event_logging/app/models/experiment.rb (2234 => 2235)
--- branches/event_logging/app/models/experiment.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/experiment.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -14,7 +14,7 @@
validates_presence_of :title
- acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if Conf.news["use_event_log"]
def self.default_title(user)
Modified: branches/event_logging/app/models/friendship.rb (2234 => 2235)
--- branches/event_logging/app/models/friendship.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/friendship.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -24,7 +24,7 @@
# this variable is set in the appropriate actions in the controller
attr_accessor :userid_initiating_action
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged(:models => { :culprit => { :model => :user },
:referenced => { :model => :friend } },
:check_log_allowed => true )
Modified: branches/event_logging/app/models/group_announcement.rb (2234 => 2235)
--- branches/event_logging/app/models/group_announcement.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/group_announcement.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -11,7 +11,7 @@
before_save :check_admin # this is done in addition to check in the controller
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :network } } if USE_EVENT_LOG
+ :referenced => { :model => :network } } if Conf.news["use_event_log"]
def check_admin
if !self.user_id.blank? and self.network.member?(self.user_id)
Modified: branches/event_logging/app/models/job.rb (2234 => 2235)
--- branches/event_logging/app/models/job.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/job.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -29,7 +29,7 @@
serialize :inputs_data
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :experiment } } if USE_EVENT_LOG
+ :referenced => { :model => :experiment } } if Conf.news["use_event_log"]
def self.default_title(user)
Modified: branches/event_logging/app/models/membership.rb (2234 => 2235)
--- branches/event_logging/app/models/membership.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/membership.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -23,7 +23,7 @@
# this variable is set in the appropriate actions in the controller
attr_accessor :userid_initiating_action
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged(:models => { :culprit => { :model => :user },
:referenced => { :model => :network } },
:check_log_allowed => true )
Modified: branches/event_logging/app/models/message.rb (2234 => 2235)
--- branches/event_logging/app/models/message.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/message.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -27,7 +27,7 @@
:foreign_key => :reply_id,
:order => "created_at DESC"
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged(:models => { :culprit => { :model => :u_from },
:referenced => { :model => :u_to } },
:check_log_allowed => true)
Modified: branches/event_logging/app/models/network.rb (2234 => 2235)
--- branches/event_logging/app/models/network.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/network.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -25,7 +25,7 @@
format_attribute :description
- acts_as_activity_logged :models => { :culprit => { :model => :owner } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :owner } } if Conf.news["use_event_log"]
def self.recently_created(limit=5)
Modified: branches/event_logging/app/models/pack.rb (2234 => 2235)
--- branches/event_logging/app/models/pack.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/pack.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -26,7 +26,7 @@
format_attribute :description
- acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if Conf.news["use_event_log"]
acts_as_solr(:fields => [ :title, :description, :contributor_name, :tag_list ],
:boost => "search_boost",
Modified: branches/event_logging/app/models/pack_contributable_entry.rb (2234 => 2235)
--- branches/event_logging/app/models/pack_contributable_entry.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/pack_contributable_entry.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -18,7 +18,7 @@
before_save :check_version
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :pack } } if USE_EVENT_LOG
+ :referenced => { :model => :pack } } if Conf.news["use_event_log"]
def check_unique
Modified: branches/event_logging/app/models/pack_remote_entry.rb (2234 => 2235)
--- branches/event_logging/app/models/pack_remote_entry.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/pack_remote_entry.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -16,7 +16,7 @@
before_create :check_unique
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :pack } } if USE_EVENT_LOG
+ :referenced => { :model => :pack } } if Conf.news["use_event_log"]
def check_unique
Modified: branches/event_logging/app/models/permission.rb (2234 => 2235)
--- branches/event_logging/app/models/permission.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/permission.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -21,7 +21,7 @@
# this variable is set in the appropriate actions in the controller
attr_accessor :userid_initiating_action
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged(:models => { :culprit => { :model => :contributor },
:referenced => { :model => :policy } },
:check_log_allowed => true)
Modified: branches/event_logging/app/models/picture.rb (2234 => 2235)
--- branches/event_logging/app/models/picture.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/picture.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -20,7 +20,7 @@
has_many :picture_selections,
:dependent => :destroy
- acts_as_activity_logged :models => { :culprit => { :model => :owner } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :owner } } if Conf.news["use_event_log"]
def select!
Modified: branches/event_logging/app/models/picture_selection.rb (2234 => 2235)
--- branches/event_logging/app/models/picture_selection.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/picture_selection.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -3,6 +3,6 @@
belongs_to :user
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :picture } } if USE_EVENT_LOG
+ :referenced => { :model => :picture } } if Conf.news["use_event_log"]
end
Modified: branches/event_logging/app/models/profile.rb (2234 => 2235)
--- branches/event_logging/app/models/profile.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/profile.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -50,7 +50,7 @@
:interests,
:contact_details ] if Conf.solr_enable
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged :models => { :culprit => { :model => :owner } }
end
Modified: branches/event_logging/app/models/rating.rb (2234 => 2235)
--- branches/event_logging/app/models/rating.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/rating.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -10,7 +10,7 @@
belongs_to :user
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :rateable } } if USE_EVENT_LOG
+ :referenced => { :model => :rateable } } if Conf.news["use_event_log"]
# Helper class method to lookup all ratings assigned
Modified: branches/event_logging/app/models/review.rb (2234 => 2235)
--- branches/event_logging/app/models/review.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/review.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -13,7 +13,7 @@
before_create :check_multiple
acts_as_activity_logged :models => { :culprit => { :model => :user },
- :referenced => { :model => :reviewable } } if USE_EVENT_LOG
+ :referenced => { :model => :reviewable } } if Conf.news["use_event_log"]
acts_as_solr :fields => [ :title, :review ] if Conf.solr_enable
Modified: branches/event_logging/app/models/taverna_enactor.rb (2234 => 2235)
--- branches/event_logging/app/models/taverna_enactor.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/taverna_enactor.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -22,7 +22,7 @@
encrypts :password, :mode => :symmetric, :key => Conf.sym_encryption_key
- acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if Conf.news["use_event_log"]
def self.find_by_contributor(contributor_type, contributor_id)
Modified: branches/event_logging/app/models/user.rb (2234 => 2235)
--- branches/event_logging/app/models/user.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/user.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -26,7 +26,7 @@
:conditions => ["contributor_type = ?", "User"]
- acts_as_activity_logged if USE_EVENT_LOG
+ acts_as_activity_logged if Conf.news["use_event_log"]
Modified: branches/event_logging/app/models/workflow.rb (2234 => 2235)
--- branches/event_logging/app/models/workflow.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/models/workflow.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -50,7 +50,7 @@
acts_as_reviewable
- acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if USE_EVENT_LOG
+ acts_as_activity_logged :models => { :culprit => { :model => :contributor } } if Conf.news["use_event_log"]
explicit_versioning(:version_column => "current_version",
:file_columns => ["image", "svg"],
@@ -78,7 +78,7 @@
validates_presence_of :content_blob
validates_presence_of :content_type
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged :models => { :culprit => { :model => :last_editor },
:referenced => { :model => :workflow }
}
Modified: branches/event_logging/app/views/blobs/news.rxml (2234 => 2235)
--- branches/event_logging/app/views/blobs/news.rxml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/blobs/news.rxml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -6,6 +6,6 @@
xml.ttl "60"
xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href ="" "http://#{request.host_with_port}/open_search.xml"
xml.description "News and status updates for #{contributable_name_from_instance(@blob)} File on myExperiment.org"
- render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributable(@blob, Time.now, Time.now-DEFAULT_CONTRIBUTABLE_NEWS_TIMEFRAME, DEFAULT_RSS_ENTRY_COUNT, nil), :locals => { :xm => xml })
+ render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributable(@blob, Time.now, Time.now-Conf.news["contributable_news"]["timeframe"].days, Conf.rss["default_count"], nil), :locals => { :xm => xml })
end
-end
\ No newline at end of file
+end
Modified: branches/event_logging/app/views/blobs/show.rhtml (2234 => 2235)
--- branches/event_logging/app/views/blobs/show.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/blobs/show.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -151,8 +151,8 @@
<% benchmark "File page news feed" do %>
<% viewer_id = (logged_in? ? current_user.id : "public") -%>
- <% cache_timeout({ :controller => 'news', :action ="" 'file', :id => @blob.id, :viewer => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
- <%= render :partial => "layouts/news", :locals => { :collection => news(@blob, true, Time.now, Time.now-DEFAULT_CONTRIBUTABLE_NEWS_TIMEFRAME, DEFAULT_CONTRIBUTABLE_NEWS_COUNT, current_user) } %>
+ <% cache_timeout({ :controller => 'news', :action ="" 'file', :id => @blob.id, :viewer => viewer_id } , Conf.news["cache_timeout"].seconds.from_now ) do -%>
+ <%= render :partial => "layouts/news", :locals => { :collection => news(@blob, true, Time.now, Time.now-Conf.news["contributable_news"]["timeframe"].days, Conf.news["contributable_news"]["count"], current_user) } %>
<% end -%>
<% end %>
</div>
Modified: branches/event_logging/app/views/home/_group_announcements.rhtml (2234 => 2235)
--- branches/event_logging/app/views/home/_group_announcements.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/home/_group_announcements.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -7,7 +7,7 @@
</div>
<div class="content">
<% cache(:controller => 'home_cache', :action ="" 'group_announcements') do -%>
- <% unless (announcements = GroupAnnouncement.latest_public(DEFAULT_RSS_ENTRY_COUNT)).empty? %>
+ <% unless (announcements = GroupAnnouncement.latest_public(Conf.rss["default_count"])).empty? %>
<ul class="announcements">
<% announcements.each do |a| %>
<li>
@@ -24,4 +24,4 @@
<% end -%>
</div>
<b class="xbottom"><b class="xb5"></b><b class="xb6"></b><b class="xb7"></b><b class="xb1"></b></b>
-</div>
\ No newline at end of file
+</div>
Modified: branches/event_logging/app/views/home/_news.rhtml (2234 => 2235)
--- branches/event_logging/app/views/home/_news.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/home/_news.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -9,7 +9,7 @@
</div>
<div class="content">
<% viewer_id = ((!news_for.nil? && logged_in?) ? current_user.id : "public") %>
- <% cache_timeout({ :controller => 'news', :action ="" 'home', :id => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
+ <% cache_timeout({ :controller => 'news', :action ="" 'home', :id => viewer_id } , Conf.news["cache_timeout"].seconds.from_now ) do -%>
<% # this is the "home" page, so current viewer of the page is the same "contributor" for which news are generated -%>
<%= render :partial => "layouts/news", :locals => { :collection => news(news_for, false, Time.now, Time.now-required_news_timeframe, required_news_count, news_for) } %>
<% end %>
Modified: branches/event_logging/app/views/home/_summary.rhtml (2234 => 2235)
--- branches/event_logging/app/views/home/_summary.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/home/_summary.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -7,7 +7,7 @@
<% tab_id_correction = logged_in? ? 1 : 0 -%>
<% viewer_id = (logged_in? ? "member" : "anonymous") %>
-<% cache_timeout({ :controller => 'home_cache', :action ="" 'quick_summary', :id => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
+<% cache_timeout({ :controller => 'home_cache', :action ="" 'quick_summary', :id => viewer_id } , Conf.news["cache_timeout"].seconds.from_now ) do -%>
<div class="box">
<b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>
<div class="box_title">
Modified: branches/event_logging/app/views/home/index.rhtml (2234 => 2235)
--- branches/event_logging/app/views/home/index.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/home/index.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -21,8 +21,8 @@
<%= render :partial => "news", :locals => {:news_box_title => "My News",
:news_box_style => "width: 550px; text-align: left;",
:news_for => current_user,
- :required_news_count => DEFAULT_USER_HOME_PAGE_NEWS_COUNT,
- :required_news_timeframe => DEFAULT_USER_HOME_PAGE_NEWS_TIMEFRAME} %>
+ :required_news_count => Conf.news["user_homepage"]["count"],
+ :required_news_timeframe => Conf.news["user_homepage"]["timeframe"].days} %>
</center>
<div class="clearer"> </div>
</div>
@@ -41,8 +41,8 @@
<div class="right">
<%= render :partial => "news", :locals => {:news_box_title => feed_icon_tag("myExperiment Public News", home_public_news_rss_url) + " Public News",
:news_for => nil,
- :required_news_count => DEFAULT_ANONYMOUS_HOME_PAGE_NEWS_COUNT,
- :required_news_timeframe => DEFAULT_ANONYMOUS_HOME_PAGE_NEWS_TIMEFRAME} %>
+ :required_news_count => Conf.news["anonymous_homepage"]["count"],
+ :required_news_timeframe => Conf.news["anonymous_homepage"]["timeframe"].days} %>
</div>
<div class="clearer"> </div>
</div>
@@ -103,4 +103,4 @@
</div>
</div>
-</div>
\ No newline at end of file
+</div>
Modified: branches/event_logging/app/views/home/public_news.rxml (2234 => 2235)
--- branches/event_logging/app/views/home/public_news.rxml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/home/public_news.rxml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -7,6 +7,6 @@
xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href ="" "http://#{request.host_with_port}/open_search.xml"
xml.description "Latest public news on myExperiment.org"
- render(:partial => "layouts/news_entry", :collection => news_from_log_public(Time.now, Time.now-DEFAULT_PUBLIC_NEWS_RSS_TIMEFRAME, DEFAULT_PUBLIC_NEWS_RSS_COUNT, nil), :locals => { :xm => xml })
+ render(:partial => "layouts/news_entry", :collection => news_from_log_public(Time.now, Time.now-Conf.rss["public_news"]["timeframe"].days, Conf.rss["public_news"]["count"], nil), :locals => { :xm => xml })
end
-end
\ No newline at end of file
+end
Modified: branches/event_logging/app/views/layouts/_news.rhtml (2234 => 2235)
--- branches/event_logging/app/views/layouts/_news.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/layouts/_news.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -1,3 +1,4 @@
+<% ActiveRecord::Base.connection.execute("SELECT 1=3") if (false) %>
<% unless collection.empty? %>
<div class="news_feed_div">
<% collection.each do |news_day| %>
@@ -22,4 +23,5 @@
</div>
<% else %>
<p>No news</p>
-<% end %>
\ No newline at end of file
+<% end %>
+<% ActiveRecord::Base.connection.execute("SELECT 1=3") if (false) %>
Modified: branches/event_logging/app/views/layouts/_sidebar.rhtml (2234 => 2235)
--- branches/event_logging/app/views/layouts/_sidebar.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/layouts/_sidebar.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -1,3 +1,4 @@
+<% ActiveRecord::Base.connection.execute("SELECT 9=0") if (false) %>
<%= render :partial => "gadgets/new_object" %>
<% if logged_in? %>
@@ -27,3 +28,4 @@
<% cache(:controller => 'sidebar_cache', :action ="" 'tags', :part => 'most_popular_tags') do -%>
<%= render :partial => "gadgets/most_popular_tags", :locals => { :limit => 25 } %>
<% end -%>
+<% ActiveRecord::Base.connection.execute("SELECT 9=1") if (false) %>
Modified: branches/event_logging/app/views/networks/index.rxml (2234 => 2235)
--- branches/event_logging/app/views/networks/index.rxml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/networks/index.rxml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -6,6 +6,6 @@
xml.ttl "60"
xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href ="" "http://#{request.host_with_port}/open_search.xml"
xml.description "Most recent groups on myExperiment.org"
- render(:partial => "layouts/network", :collection => Network.recently_created(LATEST_GROUPS_RSS_ENTRY_COUNT), :locals => { :xm => xml })
+ render(:partial => "layouts/network", :collection => Network.recently_created(Conf.rss["latest_groups_count"]), :locals => { :xm => xml })
end
-end
\ No newline at end of file
+end
Modified: branches/event_logging/app/views/networks/news.rxml (2234 => 2235)
--- branches/event_logging/app/views/networks/news.rxml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/networks/news.rxml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -6,6 +6,6 @@
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 group news for address@hidden Group on myExperiment.org"
- render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributor(@network, Time.now, Time.now-DEFAULT_PUBLIC_NEWS_RSS_TIMEFRAME, true, false, false, DEFAULT_PUBLIC_NEWS_RSS_COUNT, nil), :locals => { :xm => xml, :group => @network })
+ render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributor(@network, Time.now, Time.now-Conf.rss["public_news"]["timeframe"].days, true, false, false, Conf.rss["public_news"]["count"], nil), :locals => { :xm => xml, :group => @network })
end
-end
\ No newline at end of file
+end
Modified: branches/event_logging/app/views/networks/show.rhtml (2234 => 2235)
--- branches/event_logging/app/views/networks/show.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/networks/show.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -157,8 +157,8 @@
<% benchmark "Group page news feed" do %>
<% viewer_id = (logged_in? ? current_user.id : "public") -%>
- <% cache_timeout({ :controller => 'news', :action ="" 'network_profile', :id => @network.id, :viewer => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
- <%= render :partial => "layouts/news", :locals => { :collection => news(@network, true, Time.now, Time.now-DEFAULT_GROUP_NEWS_TIMEFRAME, DEFAULT_GROUP_NEWS_COUNT, current_user) } %>
+ <% cache_timeout({ :controller => 'news', :action ="" 'network_profile', :id => @network.id, :viewer => viewer_id } , Conf.news["cache_timeout"].seconds.from_now ) do -%>
+ <%= render :partial => "layouts/news", :locals => { :collection => news(@network, true, Time.now, Time.now-Conf.news["group_news"]["timeframe"].days, Conf.news["group_news"]["count"], current_user) } %>
<% end -%>
<% end %>
</div>
Modified: branches/event_logging/app/views/packs/news.rxml (2234 => 2235)
--- branches/event_logging/app/views/packs/news.rxml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/packs/news.rxml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -6,6 +6,6 @@
xml.ttl "60"
xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href ="" "http://#{request.host_with_port}/open_search.xml"
xml.description "News and status updates for #{contributable_name_from_instance(@pack)} Pack on myExperiment.org"
- render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributable(@pack, Time.now, Time.now-DEFAULT_CONTRIBUTABLE_NEWS_TIMEFRAME, DEFAULT_RSS_ENTRY_COUNT, nil), :locals => { :xm => xml })
+ render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributable(@pack, Time.now, Time.now-Conf.news["contributable_news"]["timeframe"].days, Conf.rss["default_count"], nil), :locals => { :xm => xml })
end
-end
\ No newline at end of file
+end
Modified: branches/event_logging/app/views/packs/show.rhtml (2234 => 2235)
--- branches/event_logging/app/views/packs/show.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/packs/show.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -165,8 +165,8 @@
<% benchmark "Pack page news feed" do %>
<% viewer_id = (logged_in? ? current_user.id : "public") -%>
- <% cache_timeout({ :controller => 'news', :action ="" 'pack', :id => @pack.id, :viewer => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
- <%= render :partial => "layouts/news", :locals => { :collection => news(@pack, true, Time.now, Time.now-DEFAULT_CONTRIBUTABLE_NEWS_TIMEFRAME, DEFAULT_CONTRIBUTABLE_NEWS_COUNT, current_user) } %>
+ <% cache_timeout({ :controller => 'news', :action ="" 'pack', :id => @pack.id, :viewer => viewer_id } , Conf.news.["cache_timeout"].seconds.from_now ) do -%>
+ <%= render :partial => "layouts/news", :locals => { :collection => news(@pack, true, Time.now, Time.now-Conf.news["contributable_news"]["timeframe"].days, Conf.news["contributable_news"]["count"], current_user) } %>
<% end -%>
<% end %>
</div>
Modified: branches/event_logging/app/views/users/news.rxml (2234 => 2235)
--- branches/event_logging/app/views/users/news.rxml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/users/news.rxml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -6,6 +6,6 @@
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 })
+ render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributor(@user, Time.now, Time.now-Conf.rss["public_news"]["timeframe"].days, true, false, false, Conf.rss["public_news"]["count"], nil), :locals => { :xm => xml })
end
-end
\ No newline at end of file
+end
Modified: branches/event_logging/app/views/users/show.rhtml (2234 => 2235)
--- branches/event_logging/app/views/users/show.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/users/show.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -379,8 +379,8 @@
<% benchmark "User profile page news feed" do %>
<% viewer_id = (logged_in? ? current_user.id : "public") -%>
- <% cache_timeout({ :controller => 'news', :action ="" 'user_profile', :id => @user.id, :viewer => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
- <%= render :partial => "layouts/news", :locals => { :collection => news(@user, true, Time.now, Time.now-DEFAULT_USER_NEWS_TIMEFRAME, DEFAULT_USER_NEWS_COUNT, current_user) } %>
+ <% cache_timeout({ :controller => 'news', :action ="" 'user_profile', :id => @user.id, :viewer => viewer_id } , Conf.news["cache_timeout"].seconds.from_now ) do -%>
+ <%= render :partial => "layouts/news", :locals => { :collection => news(@user, true, Time.now, Time.now-Conf.news["user_news"]["timeframe"].days, Conf.news["user_news"]["count"], current_user) } %>
<% end %>
<% end %>
@@ -394,8 +394,8 @@
<% benchmark "User profile 'My Activity' news feed" do %>
<% viewer_id = (logged_in? ? current_user.id : "public") -%>
<% # this is only visible to the owner of the profile, so only a single viewer ever exists -%>
- <% cache_timeout({ :controller => 'news', :action ="" 'user_activity', :id => @user.id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
- <%= render :partial => "layouts/news", :locals => { :collection => news(@user, true, Time.now, Time.now-DEFAULT_USER_NEWS_TIMEFRAME, DEFAULT_USER_NEWS_COUNT, current_user, true) } %>
+ <% cache_timeout({ :controller => 'news', :action ="" 'user_activity', :id => @user.id } , Conf.news["cache_timeout"].seconds.from_now ) do -%>
+ <%= render :partial => "layouts/news", :locals => { :collection => news(@user, true, Time.now, Time.now-Conf.news["user_news"]["timeframe"].days, Conf.news["user_news"]["count"], current_user, true) } %>
<% end %>
<% end %>
<% else -%>
Modified: branches/event_logging/app/views/workflows/news.rxml (2234 => 2235)
--- branches/event_logging/app/views/workflows/news.rxml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/workflows/news.rxml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -6,6 +6,6 @@
xml.ttl "60"
xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href ="" "http://#{request.host_with_port}/open_search.xml"
xml.description "News and status updates for #{contributable_name_from_instance(@workflow)} Workflow on myExperiment.org"
- render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributable(@workflow, Time.now, Time.now-DEFAULT_CONTRIBUTABLE_NEWS_TIMEFRAME, DEFAULT_RSS_ENTRY_COUNT, nil), :locals => { :xm => xml })
+ render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributable(@workflow, Time.now, Time.now-Conf.news["contributable_news"]["timeframe"].days, Conf.rss["default_count:"], nil), :locals => { :xm => xml })
end
-end
\ No newline at end of file
+end
Modified: branches/event_logging/app/views/workflows/show.rhtml (2234 => 2235)
--- branches/event_logging/app/views/workflows/show.rhtml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/app/views/workflows/show.rhtml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -314,8 +314,8 @@
<% benchmark "Workflow page news feed" do %>
<% viewer_id = (logged_in? ? current_user.id : "public") -%>
- <% cache_timeout({ :controller => 'news', :action ="" 'workflow', :id => @workflow.id, :viewer => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
- <%= render :partial => "layouts/news", :locals => { :collection => news(@workflow, true, Time.now, Time.now-DEFAULT_CONTRIBUTABLE_NEWS_TIMEFRAME, DEFAULT_CONTRIBUTABLE_NEWS_COUNT, current_user) } %>
+ <% cache_timeout({ :controller => 'news', :action ="" 'workflow', :id => @workflow.id, :viewer => viewer_id } , Conf.news["cache_timeout"].seconds.from_now ) do -%>
+ <%= render :partial => "layouts/news", :locals => { :collection => news(@workflow, true, Time.now, Time.now-Conf.news["contributable_news"]["timeframe"].days, Conf.news["contributable_news"]["count"], current_user) } %>
<% end -%>
<% end %>
</div>
Modified: branches/event_logging/config/default_settings.yml (2234 => 2235)
--- branches/event_logging/config/default_settings.yml 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/config/default_settings.yml 2009-06-23 14:58:27 UTC (rev 2235)
@@ -344,6 +344,76 @@
promote_every: 20 # days
promote_increment: 10
+# =========== Settings for Event Logging and News Generation ===========
+#
+# Many settings (below) are required to ensure that very flexible
+# configuration of news feed generation can be achieved - this is
+# because it is performance intense operation (even after all
+# improvement work), so need to make sure that different values
+# can be tried to out easily determine the best performance / coverage
+# ratio on all affected pages.
+
+news:
+
+# Switch event logging on or off
+ use_event_log: true
+# News feeds have timed caches. This is duration of caching a fragment
+# of news feeds (in SECONDS)
+ cache_timeout: 300
+# similar events within this timeframe will be grouped together, where possible
+ event_grouping_timeframe: 300 # seconds
+
+ default:
+
+ timeframe: 7 # days
+ count: 30
+
+ anonymous_homepage:
+
+ timeframe: 7 # days
+ count: 50
+
+ user_homepage:
+
+ timeframe: 7 # days
+ count: 30
+
+ user_news:
+
+ timeframe: 7 # days
+ count: 30
+
+ group_news:
+
+ timeframe: 7 # days
+ count: 30
+
+ contributable_news:
+
+ timeframe: 7 # days
+ count: 30
+
+rss:
+
+# public news RSS feed on "home" page
+ public_news:
+
+ timeframe: 7 # days
+ count : 50
+
+# number of entries to show in "latest workflows|files|packs" feeds
+# (latest contributables - /workflows, /files, /packs respectively; latest groups - /groups)
+ latest_contributables_count: 30
+ latest_groups_count: 10
+
+# various feeds on "home" page
+# (default_count is currently used for RSS feeds "latest tags|comments|reviews";
+# also, RSS news feeds for Files, Workflows, Packs;
+# also, RSS feed and listing on the "home" page for "latest public group announcements")
+ default_count: 20
+ latest_items_count: 25
+ updated_items_count: 25
+
# home_page_stats - These are the models which are shown in the home page
# statistics message at the top of the home page.
Modified: branches/event_logging/config/system_initializers.rb (2234 => 2235)
--- branches/event_logging/config/system_initializers.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/config/system_initializers.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -1,9 +1,9 @@
# modify the "acts_as_taggable" plugin to make use of activity logging
Tagging.class_eval do
- if USE_EVENT_LOG
+ if Conf.news["use_event_log"]
acts_as_activity_logged :models => { :culprit => { :model => :user },
:referenced => { :model => :taggable } }
end
end
-
\ No newline at end of file
+
Modified: branches/event_logging/lib/conf.rb (2234 => 2235)
--- branches/event_logging/lib/conf.rb 2009-06-19 13:30:03 UTC (rev 2234)
+++ branches/event_logging/lib/conf.rb 2009-06-23 14:58:27 UTC (rev 2235)
@@ -101,6 +101,14 @@
self.fetch_entry('activity_limits')
end
+ def self.news
+ self.fetch_entry('news')
+ end
+
+ def self.rss
+ self.fetch_entry('rss')
+ end
+
def self.home_page_stats
self.fetch_entry('home_page_stats')
end