diff options
author | Max Magorsch <arzano@gentoo.org> | 2020-06-24 21:54:41 +0000 |
---|---|---|
committer | Max Magorsch <arzano@gentoo.org> | 2020-06-24 21:54:41 +0000 |
commit | 165e85189fad078b40387ed5d86066521a5d023e (patch) | |
tree | 9b462c6c5a989515d8b142b67fb40b62a4c54b6c /web/templates | |
parent | Remove verbose logging messages (diff) | |
download | archives-165e85189fad078b40387ed5d86066521a5d023e.tar.gz archives-165e85189fad078b40387ed5d86066521a5d023e.tar.bz2 archives-165e85189fad078b40387ed5d86066521a5d023e.zip |
Fix the computation of replies to a message
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'web/templates')
-rw-r--r-- | web/templates/message/show.tmpl | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/web/templates/message/show.tmpl b/web/templates/message/show.tmpl index 8accbde..b5888d3 100644 --- a/web/templates/message/show.tmpl +++ b/web/templates/message/show.tmpl @@ -42,7 +42,7 @@ {{if .Message.InReplyTo}} <tr> <th>In Reply to:</th> - <td colspan="3"><a href="/{{.Message.InReplyTo.List}}/messages/{{.Message.InReplyTo.Id}}">{{.Message.InReplyTo.GetSubject}}</a> by {{.Message.InReplyTo.GetAuthorName}}</td> + <td colspan="3"><a href="/{{.Message.InReplyTo.List}}/message/{{.Message.InReplyTo.Id}}">{{.Message.InReplyTo.GetSubject}}</a> by {{.Message.InReplyTo.GetAuthorName}}</td> </tr> {{end}} @@ -72,16 +72,27 @@ {{end}} {{if .Replies}} + <h3>Replies</h3> <div class="table-responsive"> <table class="table table-sm ag-replies-table"> <tbody><tr> <th>Subject</th> <th>Author</th> + <th>Date</th> </tr> - {{range .Replies}} + {{range $index, $reply := .Replies}} + <tr {{if ge $index 5}}class="more-replies d-none"{{end}}> + <td><a href="/{{$reply.List}}/message/{{$reply.Id}}">{{.GetSubject}}</a></td> + <td>{{formatAddr $reply.From}}</td> + <td>{{$reply.Date.Format "2006-01-02 15:04:05"}}</td> + </tr> + {{end}} + {{ if gt (len .Replies) 5}} + <tr> + <td id="show-more-replies" colspan="3" class="text-center"><button class="btn btn-link" type="button">Show more</button></td> + </tr> <tr> - <td><a href="{{.Id}}">{{.GetSubject}}</a></td> - <td>{{formatAddr .From}}</td> + <td id="show-less-replies" colspan="3" class="text-center d-none"><button class="btn btn-link" type="button">Show less</button></td> </tr> {{end}} </tbody> |