2019-12-13 18:08:26 +00:00
|
|
|
package renderer
|
|
|
|
|
|
|
|
import (
|
2020-02-01 11:31:44 +00:00
|
|
|
"bloat/mastodon"
|
2020-01-01 15:58:27 +00:00
|
|
|
"bloat/model"
|
2019-12-13 18:08:26 +00:00
|
|
|
)
|
|
|
|
|
2020-01-14 16:57:16 +00:00
|
|
|
type Context struct {
|
|
|
|
MaskNSFW bool
|
|
|
|
FluorideMode bool
|
|
|
|
ThreadInNewTab bool
|
|
|
|
DarkMode bool
|
2020-01-25 10:07:06 +00:00
|
|
|
CSRFToken string
|
2020-02-02 08:30:40 +00:00
|
|
|
UserID string
|
2020-01-14 16:57:16 +00:00
|
|
|
}
|
|
|
|
|
2019-12-25 16:38:47 +00:00
|
|
|
type HeaderData struct {
|
|
|
|
Title string
|
|
|
|
NotificationCount int
|
|
|
|
CustomCSS string
|
2020-01-25 10:07:06 +00:00
|
|
|
CSRFToken string
|
2019-12-25 16:38:47 +00:00
|
|
|
}
|
|
|
|
|
2019-12-25 14:13:59 +00:00
|
|
|
type NavbarData struct {
|
2019-12-24 14:55:05 +00:00
|
|
|
User *mastodon.Account
|
2019-12-15 17:37:58 +00:00
|
|
|
NotificationCount int
|
|
|
|
}
|
|
|
|
|
2019-12-25 16:38:47 +00:00
|
|
|
type CommonData struct {
|
|
|
|
HeaderData *HeaderData
|
|
|
|
NavbarData *NavbarData
|
|
|
|
}
|
|
|
|
|
2020-02-08 11:50:14 +00:00
|
|
|
func (c CommonData) IsCurrentUser(id string) bool {
|
|
|
|
if c.NavbarData != nil &&
|
|
|
|
c.NavbarData.User != nil &&
|
|
|
|
c.NavbarData.User.ID == id {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2019-12-26 09:11:24 +00:00
|
|
|
type ErrorData struct {
|
|
|
|
*CommonData
|
|
|
|
Error string
|
|
|
|
}
|
|
|
|
|
|
|
|
type HomePageData struct {
|
|
|
|
*CommonData
|
|
|
|
}
|
|
|
|
|
|
|
|
type SigninData struct {
|
|
|
|
*CommonData
|
|
|
|
}
|
|
|
|
|
2019-12-25 14:13:59 +00:00
|
|
|
type TimelineData struct {
|
2019-12-25 16:38:47 +00:00
|
|
|
*CommonData
|
2019-12-25 04:30:21 +00:00
|
|
|
Title string
|
2019-12-21 13:26:31 +00:00
|
|
|
Statuses []*mastodon.Status
|
|
|
|
NextLink string
|
|
|
|
PrevLink string
|
|
|
|
PostContext model.PostContext
|
2019-12-13 18:08:26 +00:00
|
|
|
}
|
|
|
|
|
2019-12-25 14:13:59 +00:00
|
|
|
type ThreadData struct {
|
2019-12-25 16:38:47 +00:00
|
|
|
*CommonData
|
2019-12-21 13:26:31 +00:00
|
|
|
Statuses []*mastodon.Status
|
|
|
|
PostContext model.PostContext
|
|
|
|
ReplyMap map[string][]mastodon.ReplyInfo
|
2019-12-13 18:08:26 +00:00
|
|
|
}
|
|
|
|
|
2019-12-25 14:13:59 +00:00
|
|
|
type NotificationData struct {
|
2019-12-25 16:38:47 +00:00
|
|
|
*CommonData
|
2019-12-15 17:37:58 +00:00
|
|
|
Notifications []*mastodon.Notification
|
|
|
|
NextLink string
|
2020-01-12 17:16:57 +00:00
|
|
|
DarkMode bool
|
2019-12-13 18:08:26 +00:00
|
|
|
}
|
2019-12-20 18:30:20 +00:00
|
|
|
|
2019-12-25 14:13:59 +00:00
|
|
|
type UserData struct {
|
2019-12-25 16:38:47 +00:00
|
|
|
*CommonData
|
2020-02-08 11:50:14 +00:00
|
|
|
User *mastodon.Account
|
|
|
|
IsCurrent bool
|
|
|
|
Type string
|
|
|
|
Users []*mastodon.Account
|
|
|
|
Statuses []*mastodon.Status
|
|
|
|
NextLink string
|
|
|
|
DarkMode bool
|
2019-12-20 18:30:20 +00:00
|
|
|
}
|
2019-12-21 05:48:48 +00:00
|
|
|
|
2020-01-30 15:32:37 +00:00
|
|
|
type UserSearchData struct {
|
|
|
|
*CommonData
|
|
|
|
User *mastodon.Account
|
|
|
|
Q string
|
|
|
|
Statuses []*mastodon.Status
|
|
|
|
NextLink string
|
|
|
|
}
|
|
|
|
|
2019-12-25 14:13:59 +00:00
|
|
|
type AboutData struct {
|
2019-12-25 16:38:47 +00:00
|
|
|
*CommonData
|
2019-12-21 05:48:48 +00:00
|
|
|
}
|
|
|
|
|
2019-12-25 14:13:59 +00:00
|
|
|
type EmojiData struct {
|
2019-12-26 09:11:24 +00:00
|
|
|
*CommonData
|
2019-12-26 19:18:09 +00:00
|
|
|
Emojis []*mastodon.Emoji
|
2019-12-26 09:11:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type LikedByData struct {
|
|
|
|
*CommonData
|
2019-12-26 19:18:09 +00:00
|
|
|
Users []*mastodon.Account
|
|
|
|
NextLink string
|
2019-12-26 09:11:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type RetweetedByData struct {
|
|
|
|
*CommonData
|
2019-12-26 19:18:09 +00:00
|
|
|
Users []*mastodon.Account
|
|
|
|
NextLink string
|
|
|
|
}
|
|
|
|
|
|
|
|
type SearchData struct {
|
|
|
|
*CommonData
|
2019-12-27 08:06:43 +00:00
|
|
|
Q string
|
|
|
|
Type string
|
|
|
|
Users []*mastodon.Account
|
|
|
|
Statuses []*mastodon.Status
|
2019-12-26 19:18:09 +00:00
|
|
|
NextLink string
|
2019-12-22 18:10:42 +00:00
|
|
|
}
|
2019-12-27 08:06:43 +00:00
|
|
|
|
|
|
|
type SettingsData struct {
|
|
|
|
*CommonData
|
|
|
|
Settings *model.Settings
|
|
|
|
}
|