diff --git a/repositories/structs.go b/repositories/structs.go index 38ed648..164d677 100644 --- a/repositories/structs.go +++ b/repositories/structs.go @@ -19,6 +19,13 @@ type Post struct { UpdatedAt time.Time `json:"-"` } +func (p *Post) getThreadID() int { + if p.IsParent { + return p.ID + } + return p.ParentID +} + type File struct { ID int `json:"-"` PostID int `json:"-"` @@ -39,6 +46,7 @@ type HtmlFormData struct { IsCaptchaActive bool } +// index.html type HtmlPaginationData struct { PagesCount int Page int diff --git a/templates/components/post.html b/templates/components/post.html new file mode 100644 index 0000000..267f522 --- /dev/null +++ b/templates/components/post.html @@ -0,0 +1,20 @@ +{{ define "post" }} +
{{.Text}}
+{{$Post.Text}}
-