Fix reply template

This commit is contained in:
r 2019-12-19 15:12:35 +00:00
parent d7fc7cf2f5
commit 6e02be73b5
3 changed files with 5 additions and 7 deletions

View File

@ -37,17 +37,15 @@ func NewTimelinePageTemplateData(statuses []*mastodon.Status, hasNext bool, next
type ThreadPageTemplateData struct { type ThreadPageTemplateData struct {
Statuses []*mastodon.Status Statuses []*mastodon.Status
PostReply bool
ReplyToID string ReplyToID string
ReplyContent string ReplyContent string
ReplyMap map[string][]mastodon.ReplyInfo ReplyMap map[string][]mastodon.ReplyInfo
NavbarData *NavbarTemplateData NavbarData *NavbarTemplateData
} }
func NewThreadPageTemplateData(statuses []*mastodon.Status, postReply bool, replyToID string, replyContent string, replyMap map[string][]mastodon.ReplyInfo, navbarData *NavbarTemplateData) *ThreadPageTemplateData { func NewThreadPageTemplateData(statuses []*mastodon.Status, replyToID string, replyContent string, replyMap map[string][]mastodon.ReplyInfo, navbarData *NavbarTemplateData) *ThreadPageTemplateData {
return &ThreadPageTemplateData{ return &ThreadPageTemplateData{
Statuses: statuses, Statuses: statuses,
PostReply: postReply,
ReplyToID: replyToID, ReplyToID: replyToID,
ReplyContent: replyContent, ReplyContent: replyContent,
ReplyMap: replyMap, ReplyMap: replyMap,

View File

@ -306,7 +306,7 @@ func (svc *service) ServeThreadPage(ctx context.Context, client io.Writer, c *ma
return return
} }
data := renderer.NewThreadPageTemplateData(statuses, reply, replyToID, content, replyMap, navbarData) data := renderer.NewThreadPageTemplateData(statuses, replyToID, content, replyMap, navbarData)
err = svc.renderer.RenderThreadPage(ctx, client, data) err = svc.renderer.RenderThreadPage(ctx, client, data)
if err != nil { if err != nil {
return return

View File

@ -7,10 +7,10 @@
{{if eq .ID $.ReplyToID}} {{if eq .ID $.ReplyToID}}
<form class="timeline-post-form" action="/post" method="POST" enctype="multipart/form-data"> <form class="timeline-post-form" action="/post" method="POST" enctype="multipart/form-data">
<input type="hidden" name="reply_to_id" value="{{.ReplyToID}}" /> <input type="hidden" name="reply_to_id" value="{{$.ReplyToID}}" />
<label for="post-content"> Reply to {{.Status.Account.DisplayName}} </label> <label for="post-content"> Reply to {{.Account.DisplayName}} </label>
<br/> <br/>
<textarea id="post-content" name="content" class="post-content" cols="50" rows="5">{{.ReplyContent}}</textarea> <textarea id="post-content" name="content" class="post-content" cols="50" rows="5">{{$.ReplyContent}}</textarea>
<br/> <br/>
Attachments <input id="post-file-picker" type="file" name="attachments" multiple> Attachments <input id="post-file-picker" type="file" name="attachments" multiple>
<br/> <br/>