diff options
author | r <r@freesoftwareextremist.com> | 2020-02-18 22:15:37 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2020-02-18 22:15:37 +0000 |
commit | fe31d4197b66cced9ca84779fac4fe69242d844b (patch) | |
tree | 775e8e76eddb3e86d4515369b9615d3c3a5bc762 /renderer/model.go | |
parent | 39a3bb7f3566ca0b7020d10abd5d5815096b49cb (diff) | |
download | bloat-fe31d4197b66cced9ca84779fac4fe69242d844b.tar.gz bloat-fe31d4197b66cced9ca84779fac4fe69242d844b.zip |
Add frame based navigation
Diffstat (limited to 'renderer/model.go')
-rw-r--r-- | renderer/model.go | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/renderer/model.go b/renderer/model.go index 842dd71..45d3117 100644 --- a/renderer/model.go +++ b/renderer/model.go @@ -14,30 +14,17 @@ type Context struct { UserID string } -type HeaderData struct { - Title string - NotificationCount int - CustomCSS string - CSRFToken string -} - -type NavbarData struct { - User *mastodon.Account - NotificationCount int +type NavData struct { + CommonData *CommonData + User *mastodon.Account + PostContext model.PostContext } type CommonData struct { - HeaderData *HeaderData - NavbarData *NavbarData -} - -func (c CommonData) IsCurrentUser(id string) bool { - if c.NavbarData != nil && - c.NavbarData.User != nil && - c.NavbarData.User.ID == id { - return true - } - return false + Title string + CustomCSS string + CSRFToken string + AutoRefresh bool } type ErrorData struct { @@ -53,13 +40,16 @@ type SigninData struct { *CommonData } +type RootData struct { + Title string +} + type TimelineData struct { *CommonData - Title string - Statuses []*mastodon.Status - NextLink string - PrevLink string - PostContext model.PostContext + Title string + Statuses []*mastodon.Status + NextLink string + PrevLink string } type ThreadData struct { @@ -72,8 +62,9 @@ type ThreadData struct { type NotificationData struct { *CommonData Notifications []*mastodon.Notification + UnreadCount int + ReadID string NextLink string - DarkMode bool } type UserData struct { @@ -84,7 +75,6 @@ type UserData struct { Users []*mastodon.Account Statuses []*mastodon.Status NextLink string - DarkMode bool } type UserSearchData struct { |