2021-03-14 20:49:58 +00:00
|
|
|
package templates
|
|
|
|
|
2021-05-04 01:59:45 +00:00
|
|
|
import (
|
|
|
|
"html/template"
|
|
|
|
"time"
|
|
|
|
)
|
2021-04-22 23:02:50 +00:00
|
|
|
|
2021-03-14 20:49:58 +00:00
|
|
|
type BaseData struct {
|
|
|
|
Title string
|
|
|
|
CanonicalLink string
|
|
|
|
OpenGraphItems []OpenGraphItem
|
|
|
|
BackgroundImage BackgroundImage
|
|
|
|
Theme string
|
|
|
|
BodyClasses []string
|
2021-05-03 22:45:17 +00:00
|
|
|
Breadcrumbs []Breadcrumb
|
2021-03-26 03:33:00 +00:00
|
|
|
|
|
|
|
Project Project
|
|
|
|
User *User
|
2021-03-14 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
2021-04-22 23:02:50 +00:00
|
|
|
type Thread struct {
|
|
|
|
Title string
|
|
|
|
|
2021-04-29 04:52:27 +00:00
|
|
|
Locked bool
|
|
|
|
Sticky bool
|
2021-04-22 23:02:50 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 21:46:06 +00:00
|
|
|
type Post struct {
|
2021-05-04 01:59:45 +00:00
|
|
|
ID int
|
|
|
|
Url string
|
|
|
|
|
2021-04-11 21:46:06 +00:00
|
|
|
Preview string
|
|
|
|
ReadOnly bool
|
|
|
|
|
2021-05-04 01:59:45 +00:00
|
|
|
Author *User
|
|
|
|
Content template.HTML
|
|
|
|
PostDate time.Time
|
|
|
|
|
|
|
|
Editor *User
|
|
|
|
EditDate time.Time
|
|
|
|
EditIP string
|
|
|
|
EditReason string
|
2021-04-23 04:07:44 +00:00
|
|
|
|
2021-04-11 21:46:06 +00:00
|
|
|
IP string
|
|
|
|
}
|
|
|
|
|
2021-03-18 01:25:06 +00:00
|
|
|
type Project struct {
|
|
|
|
Name string
|
|
|
|
Subdomain string
|
2021-04-11 21:46:06 +00:00
|
|
|
Color1 string
|
|
|
|
Color2 string
|
2021-03-18 01:25:06 +00:00
|
|
|
|
|
|
|
IsHMN bool
|
|
|
|
|
|
|
|
HasBlog bool
|
|
|
|
HasForum bool
|
|
|
|
HasWiki bool
|
|
|
|
HasLibrary bool
|
|
|
|
}
|
|
|
|
|
2021-03-26 03:33:00 +00:00
|
|
|
type User struct {
|
2021-05-04 01:59:45 +00:00
|
|
|
ID int
|
2021-03-26 03:33:00 +00:00
|
|
|
Username string
|
|
|
|
Email string
|
|
|
|
IsSuperuser bool
|
|
|
|
IsStaff bool
|
2021-04-17 00:01:13 +00:00
|
|
|
|
2021-04-22 23:02:50 +00:00
|
|
|
Name string
|
|
|
|
Blurb string
|
2021-05-04 01:59:45 +00:00
|
|
|
Bio string
|
2021-04-22 23:02:50 +00:00
|
|
|
Signature string
|
|
|
|
AvatarUrl string
|
|
|
|
ProfileUrl string
|
2021-04-17 00:01:13 +00:00
|
|
|
|
|
|
|
DarkTheme bool
|
|
|
|
Timezone string
|
|
|
|
ProfileColor1 string
|
|
|
|
ProfileColor2 string
|
|
|
|
|
|
|
|
CanEditLibrary bool
|
|
|
|
DiscordSaveShowcase bool
|
|
|
|
DiscordDeleteSnippetOnMessageDelete bool
|
2021-03-26 03:33:00 +00:00
|
|
|
}
|
|
|
|
|
2021-03-14 20:49:58 +00:00
|
|
|
type OpenGraphItem struct {
|
|
|
|
Property string
|
|
|
|
Name string
|
|
|
|
Value string
|
|
|
|
}
|
|
|
|
|
|
|
|
type BackgroundImage struct {
|
|
|
|
Url string
|
|
|
|
Size string // A valid CSS background-size value
|
|
|
|
}
|
2021-04-22 23:02:50 +00:00
|
|
|
|
|
|
|
// Data from post_list_item.html
|
|
|
|
type PostListItem struct {
|
|
|
|
Title string
|
|
|
|
Url string
|
|
|
|
Breadcrumbs []Breadcrumb
|
2021-05-03 14:51:07 +00:00
|
|
|
|
|
|
|
User User
|
|
|
|
Date time.Time
|
|
|
|
|
|
|
|
Unread bool
|
|
|
|
Classes string
|
|
|
|
Content string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Data from thread_list_item.html
|
|
|
|
type ThreadListItem struct {
|
|
|
|
Title string
|
|
|
|
Url string
|
|
|
|
Breadcrumbs []Breadcrumb
|
|
|
|
|
|
|
|
FirstUser User
|
|
|
|
FirstDate time.Time
|
|
|
|
LastUser User
|
|
|
|
LastDate time.Time
|
|
|
|
|
|
|
|
Unread bool
|
|
|
|
Classes string
|
|
|
|
Content string
|
2021-04-22 23:02:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Breadcrumb struct {
|
|
|
|
Name, Url string
|
2021-05-03 22:45:17 +00:00
|
|
|
Current bool
|
2021-04-22 23:02:50 +00:00
|
|
|
}
|
2021-04-25 19:33:22 +00:00
|
|
|
|
|
|
|
type Pagination struct {
|
|
|
|
Current int
|
|
|
|
Total int
|
|
|
|
|
|
|
|
FirstUrl string
|
|
|
|
LastUrl string
|
|
|
|
PreviousUrl string
|
|
|
|
NextUrl string
|
|
|
|
}
|