Show GIFs properly on add/edit forum post page

This commit is contained in:
Noah Petherbridge 2024-11-12 20:10:40 -08:00
parent ad0eb6e17c
commit 63471e2e9b
2 changed files with 7 additions and 1 deletions

View File

@ -55,7 +55,7 @@ func Forum() http.HandlerFunc {
var pager = &models.Pagination{
Page: 1,
PerPage: config.PageSizeThreadList,
Sort: "updated_at desc",
Sort: "threads.updated_at desc",
}
pager.ParsePage(r)

View File

@ -203,7 +203,13 @@
</h3>
<!-- Container of img tags for the selected photo preview. -->
{{if and .CommentPhoto (HasSuffix .CommentPhoto.Filename ".mp4")}}
<video autoplay loop controls controlsList="nodownload" playsinline>
<source src="{{PhotoURL .CommentPhoto.Filename}}" type="video/mp4">
</video>
{{else}}
<img id="previewImage"{{if .CommentPhoto}} src="{{PhotoURL .CommentPhoto.Filename}}"{{end}}>
{{end}}
</div>
{{end}}