Feature: add filters for newest page

This commit is contained in:
VnPower 2023-06-05 16:46:35 +07:00
parent 0217563d1e
commit c1f62a8b81
Signed by: vnpower
GPG key ID: 881DE3DEB966106C
2 changed files with 14 additions and 1 deletions

13
template/newest.html Normal file
View file

@ -0,0 +1,13 @@
{{ template "header.html" }}
<div class="container">
<h2>Newest works from all users</h2>
<div class="switcher">
<span class="switch-title">Filter</span>
<a href="/newest" class="switch-button">Safe</a>
<a href="/newest?mode=r18" class="switch-button">R-18</a>
</div>
<div>{{ template "small-tn.html" .Items }}</div>
</div>
{{ template "footer.html" }}

View file

@ -101,7 +101,7 @@ func newestArtworksPage(c *gin.Context) {
works, _ := PC.GetNewestArtworks(worktype, r18)
c.HTML(http.StatusOK, "list.html", gin.H{"Title": "Newest works from all users", "Items": works})
c.HTML(http.StatusOK, "newest.html", gin.H{"Items": works})
}
func search_page(c *gin.Context) {