incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [07/10] git commit: [#7042] Add activity tags
Date Thu, 06 Feb 2014 02:40:03 GMT
[#7042] Add activity tags

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f295ca5c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f295ca5c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f295ca5c

Branch: refs/heads/tv/7042
Commit: f295ca5c810de64ae484b015c75d7ec9e8645460
Parents: 41b2c9c
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Wed Feb 5 20:32:15 2014 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu Feb 6 02:29:30 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/discuss.py      | 3 ++-
 Allura/allura/model/discuss.py            | 3 ++-
 Allura/allura/model/repo_refresh.py       | 3 ++-
 Allura/allura/model/timeline.py           | 6 ++++--
 ForgeBlog/forgeblog/model/blog.py         | 2 +-
 ForgeImporters/forgeimporters/base.py     | 2 +-
 ForgeTracker/forgetracker/tracker_main.py | 4 ++--
 ForgeWiki/forgewiki/wiki_main.py          | 2 +-
 8 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f295ca5c/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index aefd472..cd4e8a1 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -303,7 +303,8 @@ class PostController(BaseController):
             self.post.commit()
             g.director.create_activity(c.user, 'modified', self.post,
                                        target=self.post.thread.artifact or self.post.thread,
-                                       related_nodes=[self.post.app_config.project])
+                                       related_nodes=[self.post.app_config.project],
+                                       tags=['comment'])
             redirect(request.referer)
         elif request.method == 'GET':
             if version is not None:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f295ca5c/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 2741d03..c5762a9 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -685,7 +685,8 @@ class Post(Message, VersionedArtifact, ActivityObject):
             artifact.update_stats()
         if self.text and not self.is_meta:
             g.director.create_activity(author, 'posted', self, target=artifact,
-                                       related_nodes=[self.app_config.project])
+                                       related_nodes=[self.app_config.project],
+                                       tags=['comment'])
 
     def notify(self, file_info=None, check_dup=False):
         if self.project.notifications_disabled:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f295ca5c/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index d364d2c..a2dc628 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -144,7 +144,8 @@ def refresh_repo(repo, all_commits=False, notify=True, new_clone=False):
             actor = user or TransientActor(
                     activity_name=new.committed.name or new.committed.emai)
             g.director.create_activity(actor, 'committed', new,
-                                       related_nodes=[repo.app_config.project])
+                                       related_nodes=[repo.app_config.project],
+                                       tags=['commit', repo.tool.lower()])
 
     log.info('Refresh complete for %s', repo.full_fs_path)
     g.post_event('repo_refreshed', len(commit_ids), all_commits, new_clone)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f295ca5c/Allura/allura/model/timeline.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/timeline.py b/Allura/allura/model/timeline.py
index 63cbd83..ed059a9 100644
--- a/Allura/allura/model/timeline.py
+++ b/Allura/allura/model/timeline.py
@@ -39,13 +39,15 @@ class Director(ActivityDirector):
     """
 
     def create_activity(self, actor, verb, obj, target=None,
-                        related_nodes=None):
+                        related_nodes=None, tags=None):
         if c.project and c.project.notifications_disabled:
             return
 
         from allura.model.project import Project
         super(Director, self).create_activity(actor, verb, obj,
-                                              target=target, related_nodes=related_nodes)
+                                              target=target,
+                                              related_nodes=related_nodes,
+                                              tags=tags)
         # aggregate actor and follower's timelines
         if actor.node_id:
             create_timelines.post(actor.node_id)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f295ca5c/ForgeBlog/forgeblog/model/blog.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/model/blog.py b/ForgeBlog/forgeblog/model/blog.py
index f520265..1c363c9 100644
--- a/ForgeBlog/forgeblog/model/blog.py
+++ b/ForgeBlog/forgeblog/model/blog.py
@@ -230,7 +230,7 @@ class BlogPost(M.VersionedArtifact, ActivityObject):
 
     def commit(self):
         activity = functools.partial(g.director.create_activity, c.user,
-                                     target=c.project)
+                                     target=c.project, tags=['blog'])
         self.subscribe()
         super(BlogPost, self).commit()
         if self.version > 1:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f295ca5c/ForgeImporters/forgeimporters/base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index d03e838..996edb5 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -142,7 +142,7 @@ def import_tool(importer_path, project_name=None,
         if app:
             with h.notifications_disabled(c.project, disabled=False):
                 g.director.create_activity(c.user, "imported", app.config,
-                                           related_nodes=[c.project])
+                                           related_nodes=[c.project], tags=['import'])
             handler.success(app)
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f295ca5c/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 0ae0cad..f60df6d 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -856,7 +856,7 @@ class RootController(BaseController, FeedController):
         ticket.update(ticket_form)
         c.app.globals.invalidate_bin_counts()
         g.director.create_activity(c.user, 'created', ticket,
-                                   related_nodes=[c.project])
+                                   related_nodes=[c.project], tags=['ticket'])
         redirect(str(ticket.ticket_num) + '/')
 
     @with_trailing_slash
@@ -1435,7 +1435,7 @@ class TicketController(BaseController, FeedController):
         if comment:
             self.ticket.discussion_thread.post(text=comment)
         g.director.create_activity(c.user, 'modified', self.ticket,
-                                   related_nodes=[c.project])
+                                   related_nodes=[c.project], tags=['ticket'])
         c.app.globals.invalidate_bin_counts()
         redirect('.')
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f295ca5c/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 01a6008..9231106 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -655,7 +655,7 @@ class PageController(BaseController, FeedController):
         g.spam_checker.check(text, artifact=self.page,
                              user=c.user, content_type='wiki')
         g.director.create_activity(c.user, activity_verb, self.page,
-                                   target=c.project)
+                                   target=c.project, tags=['wiki'])
         if new_viewable_by:
             if new_viewable_by == 'all':
                 self.page.viewable_by.append('all')


Mime
View raw message