Fix reply template
authorr <r@freesoftwareextremist.com>
Thu, 19 Dec 2019 15:12:35 +0000 (15:12 +0000)
committerr <r@freesoftwareextremist.com>
Thu, 19 Dec 2019 15:12:35 +0000 (15:12 +0000)
renderer/model.go
service/service.go
templates/thread.tmpl

index 2a320cc533956f7a9d6bca640637f2e1fbd8acc7..ad356e2691dd87c7f9789c3568ae85ac0dd0cf25 100644 (file)
@@ -37,17 +37,15 @@ func NewTimelinePageTemplateData(statuses []*mastodon.Status, hasNext bool, next
 
 type ThreadPageTemplateData struct {
        Statuses     []*mastodon.Status
-       PostReply    bool
        ReplyToID    string
        ReplyContent string
        ReplyMap     map[string][]mastodon.ReplyInfo
        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{
                Statuses:     statuses,
-               PostReply:    postReply,
                ReplyToID:    replyToID,
                ReplyContent: replyContent,
                ReplyMap:     replyMap,
index 6c7a37d7746b9a43715aa6a46f79f7154f93cf92..556afa675098d9643cca8c3daa48c7e172840f40 100644 (file)
@@ -306,7 +306,7 @@ func (svc *service) ServeThreadPage(ctx context.Context, client io.Writer, c *ma
                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)
        if err != nil {
                return
index e36c5ea618508fa14a62ba624f2caf9dde9f6711..3ad5daea818c65989f04f149c6eeafc4714e4e9a 100644 (file)
@@ -7,10 +7,10 @@
 
 {{if eq .ID $.ReplyToID}}
 <form class="timeline-post-form" action="/post" method="POST" enctype="multipart/form-data">
-       <input type="hidden" name="reply_to_id" value="{{.ReplyToID}}" />
-       <label for="post-content"> Reply to {{.Status.Account.DisplayName}} </label>
+       <input type="hidden" name="reply_to_id" value="{{$.ReplyToID}}" />
+       <label for="post-content"> Reply to {{.Account.DisplayName}} </label>
        <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/>
        Attachments <input id="post-file-picker" type="file" name="attachments" multiple>
        <br/>