myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3119] branches/events: added edit profile messag


From: noreply
Subject: [myexperiment-hackers] [3119] branches/events: added edit profile message and brought activity bootstrap up-to-date
Date: Sat, 25 Aug 2012 23:20:01 +0000 (UTC)

Revision
3119
Author
dgc
Date
2012-08-25 23:20:01 +0000 (Sat, 25 Aug 2012)

Log Message

added edit profile message and brought activity bootstrap up-to-date

Modified Paths

Diff

Modified: branches/events/Rakefile (3118 => 3119)


--- branches/events/Rakefile	2012-08-25 16:44:09 UTC (rev 3118)
+++ branches/events/Rakefile	2012-08-25 23:20:01 UTC (rev 3119)
@@ -198,48 +198,96 @@
 
   activities = []
 
-  activities += User.find(:all, :conditions => "activated_at IS NOT NULL").map do |object|
-    Activity.new(
+  User.find(:all, :conditions => "activated_at IS NOT NULL", :include => :profile).map do |object|
+
+    activities << Activity.new(
         :subject => object,
         :subject_label => object.name,
         :action ="" 'register',
         :created_at => object.created_at)
+
+    if object.profile.updated_at && object.profile.updated_at != object.profile.created_at
+
+
+      activities << Activity.new(
+          :subject => object,
+          :subject_label => object.name,
+          :action ="" 'edit',
+          :created_at => object.profile.updated_at)
+
+    end
   end
 
-  activities += (Workflow.all + Blob.all + Pack.all + Blog.all).map do |object|
-    Activity.new(
+  (Workflow.all + Blob.all + Pack.all + Blog.all).map do |object|
+
+    activities << Activity.new(
         :subject => object.contributor,
         :action ="" 'create',
         :objekt => object,
         :auth => object,
         :created_at => object.created_at)
+
+    if object.updated_at && object.updated_at != object.created_at
+
+      activities << Activity.new(
+          :subject => object.contributor,
+          :action ="" 'edit',
+          :objekt => object,
+          :auth => object,
+          :created_at => object.updated_at)
+    end
   end
   
   workflow_versions = (WorkflowVersion.find(:all, :conditions => "version > 1")).select do |object|
     !(object.version == 2 && object.content_blob.data == object.workflow.versions.first.content_blob.data)
   end
   
-  activities += workflow_versions.map do |object|
-    Activity.new(
+  workflow_versions.map do |object|
+
+    activities << Activity.new(
         :subject => object.contributor,
         :action ="" 'create',
         :objekt => object,
         :extra => object.version,
         :auth => object.versioned_resource,
         :created_at => object.created_at)
+
+    if object.updated_at && object.updated_at != object.created_at
+
+      activities << Activity.new(
+          :subject => object.contributor,
+          :action ="" 'edit',
+          :objekt => object,
+          :extra => object.version,
+          :auth => object.versioned_resource,
+          :created_at => object.updated_at)
+    end
   end
   
-  activities += (BlobVersion.find(:all, :conditions => "version > 1")).map do |object|
-    Activity.new(
+  (BlobVersion.find(:all, :conditions => "version > 1")).map do |object|
+
+    activities << Activity.new(
         :subject => object.blob.contributor,
         :action ="" 'create',
         :objekt => object,
         :extra => object.version,
         :auth => object.versioned_resource,
         :created_at => object.created_at)
+
+    if object.updated_at && object.updated_at != object.created_at
+
+      activities << Activity.new(
+          :subject => object.blob.contributor,
+          :action ="" 'edit',
+          :objekt => object,
+          :extra => object.version,
+          :auth => object.versioned_resource,
+          :created_at => object.updated_at)
+    end
   end
 
   activities += Comment.all.map do |comment|
+
     Activity.new(
         :subject => comment.user,
         :action ="" 'create',
@@ -249,6 +297,7 @@
   end
 
   activities += Bookmark.all.map do |bookmark|
+
     Activity.new(
         :subject => bookmark.user,
         :action ="" 'create',
@@ -257,7 +306,88 @@
         :created_at => bookmark.created_at)
   end
 
-  activities.sort do |a, b|
+  Announcement.all.each do |object|
+
+    activities << Activity.new(
+        :subject => object.user,
+        :action ="" 'create',
+        :objekt => object,
+        :created_at => object.created_at)
+
+    if object.updated_at && object.updated_at != object.created_at
+
+
+      activities << Activity.new(
+          :subject => object.user,
+          :action ="" 'edit',
+          :objekt => object,
+          :created_at => object.updated_at)
+    end
+  end
+
+  Citation.all.each do |object|
+
+    activities << Activity.new(
+        :subject => object.user,
+        :action ="" 'create',
+        :objekt => object,
+        :auth => object.workflow,
+        :created_at => object.created_at)
+
+    if object.updated_at && object.updated_at != object.created_at
+
+      activities << Activity.new(
+          :subject => object.user,
+          :action ="" 'edit',
+          :objekt => object,
+          :auth => object.workflow,
+          :created_at => object.updated_at)
+    end
+  end
+
+  Rating.all.each do |object|
+
+    activities << Activity.new(
+        :subject => object.user,
+        :action ="" 'create',
+        :objekt => object,
+        :auth => object.rateable,
+        :extra => object.rating,
+        :created_at => object.created_at)
+  end
+
+  Review.all.each do |object|
+
+    activities << Activity.new(
+        :subject => object.user,
+        :action ="" 'create',
+        :objekt => object,
+        :auth => object.reviewable,
+        :created_at => object.created_at)
+
+    if object.updated_at && object.updated_at != object.created_at
+
+      activities << Activity.new(
+          :subject => object.user,
+          :action ="" 'edit',
+          :objekt => object,
+          :auth => object.reviewable,
+          :created_at => object.updated_at)
+    end
+  end
+
+  Tagging.all.each do |object|
+
+    activities << Activity.new(
+        :subject => object.user,
+        :action ="" 'create',
+        :objekt => object,
+        :auth => object.taggable,
+        :extra => object.tag.name,
+        :created_at => object.created_at)
+  end
+
+  activities.sort! do |a, b|
     a.created_at <=> b.created_at
   end
 

Modified: branches/events/app/helpers/application_helper.rb (3118 => 3119)


--- branches/events/app/helpers/application_helper.rb	2012-08-25 16:44:09 UTC (rev 3118)
+++ branches/events/app/helpers/application_helper.rb	2012-08-25 23:20:01 UTC (rev 3119)
@@ -638,6 +638,7 @@
         when "Citation edit":          "#{subject_link(activity)} edited the citation #{objekt_link(activity)} on #{auth_link(activity)}"
         when "Comment create":         "#{subject_link(activity)} commented on #{objekt_link(activity)}"
         when "Pack create":            "#{subject_link(activity)} created #{objekt_link(activity)}"
+        when "Pack edit":              "#{subject_link(activity)} edited #{objekt_link(activity)}"
         when "Rating create":          "#{subject_link(activity)} rated #{auth_link(activity)} with #{activity.extra}"
         when "Review create":          "#{subject_link(activity)} added a review on #{auth_link(activity)}"
         when "Review edit":            "#{subject_link(activity)} edited a review on #{auth_link(activity)}"
@@ -647,6 +648,7 @@
         when "WorkflowVersion create": "#{subject_link(activity)} uploaded a new version of #{objekt_link(activity)}"
         when "WorkflowVersion edit":   "#{subject_link(activity)} edited version #{activity.extra} of #{objekt_link(activity)}"
         when "register":               "#{subject_link(activity)} joined #{Conf.sitename}"
+        when "edit":                   "#{subject_link(activity)} edited their profile"
         else "Unknown activity"
       end
 

reply via email to

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