@@ -43,6 +43,7 @@ type BugListItem struct {
FullID string
Title string
Author string
+ AuthorAvatar string
Status string
CreatedAt time.Time
LastActivity time.Time
@@ -68,11 +69,12 @@ type BugData struct {
}
type TimelineItem struct {
- Type string
- ID string
- Author string
- Timestamp time.Time
- Edited bool
+ Type string
+ ID string
+ Author string
+ AuthorAvatar string
+ Timestamp time.Time
+ Edited bool
Message template.HTML
Title string
@@ -137,6 +139,7 @@ func getBugsList(rc *cache.RepoCache, status string) ([]BugListItem, error) {
FullID: snap.Id().String(),
Title: snap.Title,
Author: snap.Author.DisplayName(),
+ AuthorAvatar: snap.Author.AvatarUrl(),
Status: snap.Status.String(),
CreatedAt: snap.CreateTime,
LastActivity: getLastActivity(snap),
@@ -206,12 +209,13 @@ func buildTimelineItems(snap *bug.Snapshot) []TimelineItem {
}
items = append(items, TimelineItem{
- Type: "create",
- ID: op.CombinedId().String(),
- Author: op.Author.DisplayName(),
- Timestamp: op.CreatedAt.Time(),
- Edited: op.Edited(),
- Message: messageHTML,
+ Type: "create",
+ ID: op.CombinedId().String(),
+ Author: op.Author.DisplayName(),
+ AuthorAvatar: op.Author.AvatarUrl(),
+ Timestamp: op.CreatedAt.Time(),
+ Edited: op.Edited(),
+ Message: messageHTML,
})
case *bug.AddCommentTimelineItem:
@@ -226,30 +230,33 @@ func buildTimelineItems(snap *bug.Snapshot) []TimelineItem {
}
items = append(items, TimelineItem{
- Type: "comment",
- ID: op.CombinedId().String(),
- Author: op.Author.DisplayName(),
- Timestamp: op.CreatedAt.Time(),
- Edited: op.Edited(),
- Message: messageHTML,
+ Type: "comment",
+ ID: op.CombinedId().String(),
+ Author: op.Author.DisplayName(),
+ AuthorAvatar: op.Author.AvatarUrl(),
+ Timestamp: op.CreatedAt.Time(),
+ Edited: op.Edited(),
+ Message: messageHTML,
})
case *bug.SetTitleTimelineItem:
items = append(items, TimelineItem{
- Type: "title",
- ID: op.CombinedId().String(),
- Author: op.Author.DisplayName(),
- Timestamp: op.UnixTime.Time(),
- Title: op.Title,
+ Type: "title",
+ ID: op.CombinedId().String(),
+ Author: op.Author.DisplayName(),
+ AuthorAvatar: op.Author.AvatarUrl(),
+ Timestamp: op.UnixTime.Time(),
+ Title: op.Title,
})
case *bug.SetStatusTimelineItem:
items = append(items, TimelineItem{
- Type: "status",
- ID: op.CombinedId().String(),
- Author: op.Author.DisplayName(),
- Timestamp: op.UnixTime.Time(),
- Status: op.Status.Action(),
+ Type: "status",
+ ID: op.CombinedId().String(),
+ Author: op.Author.DisplayName(),
+ AuthorAvatar: op.Author.AvatarUrl(),
+ Timestamp: op.UnixTime.Time(),
+ Status: op.Status.Action(),
})
case *bug.LabelChangeTimelineItem:
@@ -267,6 +274,7 @@ func buildTimelineItems(snap *bug.Snapshot) []TimelineItem {
Type: "labels",
ID: op.CombinedId().String(),
Author: op.Author.DisplayName(),
+ AuthorAvatar: op.Author.AvatarUrl(),
Timestamp: op.UnixTime.Time(),
AddedLabels: added,
RemovedLabels: removed,