-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28bd75f
commit dfefc6c
Showing
4 changed files
with
116 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
from core.models import ActionLog | ||
from django.db.models import Q | ||
|
||
__author__ = 'tony' | ||
|
||
|
||
def get_latest_activity(project_id): | ||
query = ActionLog.objects.all() | ||
if project_id: | ||
query = query.filter(project__id=project_id) | ||
query = query.filter(Q(project__id=project_id) & (~Q(action__in=['ADD_ISSUE_COMMENT', 'EDIT_ISSUE_COMMENT']))) | ||
query = query.order_by('-creationDate') | ||
return query[0:10] |
75 changes: 73 additions & 2 deletions
75
djangoproject/statfiles/static/js/activitylist/activitylist.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,76 @@ | ||
<div> | ||
<div ng-repeat="activity in activities"> | ||
{[{describe(activity)}]} | ||
<div ng-repeat="activity in activities" style="border: solid 1px; margin-bottom: 20px"> | ||
<div ng-switch on="activity.action"> | ||
<div ng-switch-when="EDIT_PROJECT"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
has edited project details. <a href="#">More...</a> | ||
</div> | ||
<div ng-switch-when="PROJECT_ADD_TAG"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
added tag <strong>{[{ activity.new_json }]}</strong> to project. | ||
</div> | ||
<div ng-switch-when="PROJECT_REMOVE_TAG"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
removed tag <strong>{[{ activity.new_json }]}</strong> from project. | ||
</div> | ||
<div ng-switch-when="SPONSOR"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
sponsored issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]}</a>, | ||
with a {[{ activity.new_dic.currency }]} {[{ activity.new_dic.price }]} offer. | ||
</div> | ||
<div ng-switch-when="CHANGE_OFFER"> | ||
{[{ activity.when }]}<br> | ||
has changed his offer on issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a> | ||
<a href="#">More...</a> | ||
</div> | ||
<div ng-switch-when="REVOKE"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
revoked his {[{ activity.new_dic.currency }]} {[{ activity.new_dic.price }]} offer | ||
on issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a> | ||
<a href="#">More...</a> | ||
</div> | ||
<div ng-switch-when="PROPOSE"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
proposed issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a> | ||
</div> | ||
<div ng-switch-when="WORK"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
started working on issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a> | ||
<a href="#">More...</a> | ||
</div> | ||
<div ng-switch-when="ABORT"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
stopped working on issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a> | ||
<a href="#">More...</a> | ||
</div> | ||
<div ng-switch-when="RESOLVE"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
resolved issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a> | ||
</div> | ||
<div ng-switch-when="PAY"> | ||
{[{ activity.when }]}<br> | ||
<img ng-src="{[{activity.user_image}]}"> {[{ activity.user_screenname }]} | ||
made a {[{ activity.new_dic.currency }]} {[{ activity.new_dic.total }]} payment | ||
for issue <a href="{[{ activity.issue.link }]}">{[{ activity.issue.title }]} </a><br> | ||
Receivers:<br> | ||
<ul> | ||
<li ng-repeat="part in activity.new_dic.parts"> | ||
<img ng-src="{[{part.programmer_image}]}"> {[{ part.programmer_screenname }]}: {[{ activity.new_dic.currency }]} {[{ part.price }]} | ||
</li> | ||
</ul> | ||
</div> | ||
<div ng-switch-default> | ||
Unknown activity: {[{activity.action }]} | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters