Skip to content

Commit

Permalink
#212 show comment history on project activities
Browse files Browse the repository at this point in the history
  • Loading branch information
tonylampada committed Jan 2, 2014
1 parent afeb0fa commit c29f30e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
3 changes: 1 addition & 2 deletions djangoproject/core/services/activity_services.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from core.models import ActionLog
from django.db.models import Q

__author__ = 'tony'


def get_latest_activity(project_id, offset):
query = ActionLog.objects.all()
if project_id:
query = query.filter(Q(project__id=project_id) & (~Q(action__in=['ADD_ISSUE_COMMENT', 'EDIT_ISSUE_COMMENT'])))
query = query.filter(project__id=project_id)
query = query.order_by('-creationDate')
return query[offset: offset + 10], query.count()
30 changes: 30 additions & 0 deletions djangoproject/statfiles/static/js/activitylist/activitylist.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@
and also left a comment - <a href ng-click="show_detail(activity)">See comment</a>
</span>
</div>
<div ng-switch-when="ADD_ISSUE_COMMENT">
<span title="{[{ activity.creationDate }]}"> {[{ activity.when }]}</span><br>
<a href="{[{ activity.user_link }]}"><img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]}</a>
added a comment on issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a>
- <a href ng-click="show_detail(activity)">See comment</a>
</div>
<div ng-switch-when="EDIT_ISSUE_COMMENT">
<span title="{[{ activity.creationDate }]}"> {[{ activity.when }]}</span><br>
<a href="{[{ activity.user_link }]}"><img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]}</a>
edited his comment on issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a>
- <a href ng-click="show_detail(activity)">More</a>
</div>
<div ng-switch-when="PAY">
<span title="{[{ activity.creationDate }]}"> {[{ activity.when }]}</span><br>
<a href="{[{ activity.user_link }]}"><img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]}</a>
Expand Down Expand Up @@ -160,6 +172,24 @@
{[{ selected_activity.issue_comment_content }]}
</pre>
</div>
<div ng-switch-when="ADD_ISSUE_COMMENT">
New comment:
<pre>
{[{ selected_activity.issue_comment_content }]}
</pre>
</div>
<div ng-switch-when="EDIT_ISSUE_COMMENT">
<ul>
<li>
old comment:<br>
<pre>{[{ selected_activity.old_dic.content }]}</pre>
</li>
<li>
new comment:<br>
<pre>{[{ selected_activity.new_dic.content }]}</pre>
</li>
</ul>
</div>
</div>
</div>
<div class="modal-footer inline-content">
Expand Down

0 comments on commit c29f30e

Please sign in to comment.