Use a single form for new posts and replies

This commit is contained in:
r 2019-12-21 08:36:44 +00:00
parent df875381d4
commit 39c57a6b65
7 changed files with 42 additions and 34 deletions

View file

@ -2,6 +2,7 @@ package renderer
import (
"mastodon"
"web/model"
)
type NavbarTemplateData struct {
@ -37,17 +38,15 @@ func NewTimelinePageTemplateData(statuses []*mastodon.Status, hasNext bool, next
type ThreadPageTemplateData struct {
Statuses []*mastodon.Status
ReplyToID string
ReplyContent string
ReplyContext *model.ReplyContext
ReplyMap map[string][]mastodon.ReplyInfo
NavbarData *NavbarTemplateData
}
func NewThreadPageTemplateData(statuses []*mastodon.Status, replyToID string, replyContent string, replyMap map[string][]mastodon.ReplyInfo, navbarData *NavbarTemplateData) *ThreadPageTemplateData {
func NewThreadPageTemplateData(statuses []*mastodon.Status, replyContext *model.ReplyContext, replyMap map[string][]mastodon.ReplyInfo, navbarData *NavbarTemplateData) *ThreadPageTemplateData {
return &ThreadPageTemplateData{
Statuses: statuses,
ReplyToID: replyToID,
ReplyContent: replyContent,
ReplyContext: replyContext,
ReplyMap: replyMap,
NavbarData: navbarData,
}