ddc9e2da290b8e7a2be3ff2fd8e76e125e3efcc9
[bloat] / renderer / model.go
1 package renderer
2
3 import (
4         "mastodon"
5 )
6
7 type TimelinePageTemplateData struct {
8         Statuses []*mastodon.Status
9         HasNext  bool
10         NextLink string
11         HasPrev  bool
12         PrevLink string
13 }
14
15 func NewTimelinePageTemplateData(statuses []*mastodon.Status, hasNext bool, nextLink string, hasPrev bool,
16         prevLink string) *TimelinePageTemplateData {
17         return &TimelinePageTemplateData{
18                 Statuses: statuses,
19                 HasNext:  hasNext,
20                 NextLink: nextLink,
21                 HasPrev:  hasPrev,
22                 PrevLink: prevLink,
23         }
24 }
25
26 type ThreadPageTemplateData struct {
27         Status    *mastodon.Status
28         Context   *mastodon.Context
29         PostReply bool
30         ReplyToID string
31 }
32
33 func NewThreadPageTemplateData(status *mastodon.Status, context *mastodon.Context, postReply bool, replyToID string) *ThreadPageTemplateData {
34         return &ThreadPageTemplateData{
35                 Status:    status,
36                 Context:   context,
37                 PostReply: postReply,
38                 ReplyToID: replyToID,
39         }
40 }