render_types.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. package routes
  2. import (
  3. "html/template"
  4. "codeberg.org/vnpower/pixivfe/v2/core"
  5. "codeberg.org/vnpower/pixivfe/v2/utils"
  6. "codeberg.org/vnpower/pixivision"
  7. )
  8. // Tutorial: adding new types in this file
  9. // Whenever you add new types, update `TestTemplates` in render_test.go to include the type in the test
  10. // Do not use pointer in Data_* struct. faker will insert nil.
  11. // Do not name template file a.b.jet.html or it won't be able to be used here, since Data_a.b is not a valid identifier.
  12. type Data_error struct {
  13. Title string
  14. Error error
  15. }
  16. type Data_about struct {
  17. Time string
  18. Version string
  19. ImageProxy string
  20. AcceptLanguage string
  21. }
  22. type Data_artwork struct {
  23. Illust core.Illust
  24. Title string
  25. MetaDescription string
  26. MetaImage string
  27. MetaAuthor string
  28. MetaAuthorID string
  29. }
  30. type Data_artworkMulti struct {
  31. Artworks []core.Illust
  32. Title string
  33. }
  34. type Data_userAtom struct {
  35. URL string
  36. Title string
  37. User core.User
  38. Category core.UserArtCategory
  39. Updated string
  40. PageLimit int
  41. Page int
  42. // MetaImage string
  43. }
  44. type Data_index struct {
  45. Title string
  46. LoggedIn bool
  47. Data core.LandingArtworks
  48. NoTokenData core.Ranking
  49. }
  50. type Data_unauthorized struct{}
  51. type Data_discovery struct {
  52. Artworks []core.ArtworkBrief
  53. Title string
  54. Queries utils.PartialURL
  55. }
  56. type Data_novelDiscovery struct {
  57. Novels []core.NovelBrief
  58. Title string
  59. }
  60. type Data_newest struct {
  61. Items []core.ArtworkBrief
  62. Title string
  63. }
  64. type Data_novel struct {
  65. Novel core.Novel
  66. NovelRelated []core.NovelBrief
  67. User core.UserBrief
  68. Title string
  69. FontType string
  70. ViewMode string
  71. Language string
  72. }
  73. type Data_following struct {
  74. Title string
  75. Mode string
  76. Artworks []core.ArtworkBrief
  77. CurPage string
  78. Page int
  79. }
  80. type Data_pixivision_index struct {
  81. Data []pixivision.Article
  82. }
  83. type Data_pixivision_article struct {
  84. Article pixivision.Article
  85. }
  86. type Data_rank struct {
  87. Title string
  88. Page int
  89. PageLimit int
  90. Date string
  91. Data core.Ranking
  92. }
  93. type Data_rankingCalendar struct {
  94. Title string
  95. Render template.HTML
  96. Mode string
  97. Year int
  98. MonthBefore DateWrap
  99. MonthAfter DateWrap
  100. ThisMonth DateWrap
  101. }
  102. type Data_settings struct {
  103. ProxyList []string
  104. WorkingProxyList []string
  105. }
  106. type Data_tag struct {
  107. Title string
  108. Tag core.TagDetail
  109. Data core.SearchResult
  110. QueriesC utils.PartialURL
  111. TrueTag string
  112. Page int
  113. }
  114. type Data_user struct {
  115. Title string
  116. User core.User
  117. Category core.UserArtCategory
  118. PageLimit int
  119. Page int
  120. MetaImage string
  121. }