model.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. package renderer
  2. import (
  3. "bloat/mastodon"
  4. "bloat/model"
  5. )
  6. type Context struct {
  7. HideAttachments bool
  8. MaskNSFW bool
  9. FluorideMode bool
  10. ThreadInNewTab bool
  11. DarkMode bool
  12. CSRFToken string
  13. UserID string
  14. AntiDopamineMode bool
  15. }
  16. type NavData struct {
  17. CommonData *CommonData
  18. User *mastodon.Account
  19. PostContext model.PostContext
  20. }
  21. type CommonData struct {
  22. Title string
  23. CustomCSS string
  24. CSRFToken string
  25. Count int
  26. RefreshInterval int
  27. Target string
  28. }
  29. type ErrorData struct {
  30. *CommonData
  31. Error string
  32. }
  33. type HomePageData struct {
  34. *CommonData
  35. }
  36. type SigninData struct {
  37. *CommonData
  38. }
  39. type RootData struct {
  40. Title string
  41. }
  42. type TimelineData struct {
  43. *CommonData
  44. Title string
  45. Statuses []*mastodon.Status
  46. NextLink string
  47. PrevLink string
  48. }
  49. type ThreadData struct {
  50. *CommonData
  51. Statuses []*mastodon.Status
  52. PostContext model.PostContext
  53. ReplyMap map[string][]mastodon.ReplyInfo
  54. }
  55. type NotificationData struct {
  56. *CommonData
  57. Notifications []*mastodon.Notification
  58. UnreadCount int
  59. ReadID string
  60. NextLink string
  61. }
  62. type UserData struct {
  63. *CommonData
  64. User *mastodon.Account
  65. IsCurrent bool
  66. Type string
  67. Users []*mastodon.Account
  68. Statuses []*mastodon.Status
  69. NextLink string
  70. }
  71. type UserSearchData struct {
  72. *CommonData
  73. User *mastodon.Account
  74. Q string
  75. Statuses []*mastodon.Status
  76. NextLink string
  77. }
  78. type AboutData struct {
  79. *CommonData
  80. }
  81. type EmojiData struct {
  82. *CommonData
  83. Emojis []*mastodon.Emoji
  84. }
  85. type LikedByData struct {
  86. *CommonData
  87. Users []*mastodon.Account
  88. NextLink string
  89. }
  90. type RetweetedByData struct {
  91. *CommonData
  92. Users []*mastodon.Account
  93. NextLink string
  94. }
  95. type SearchData struct {
  96. *CommonData
  97. Q string
  98. Type string
  99. Users []*mastodon.Account
  100. Statuses []*mastodon.Status
  101. NextLink string
  102. }
  103. type SettingsData struct {
  104. *CommonData
  105. Settings *model.Settings
  106. PostFormats []model.PostFormat
  107. }