diff --git a/models/models.go b/models/models.go index a1ed4ce..d246864 100644 --- a/models/models.go +++ b/models/models.go @@ -135,6 +135,7 @@ type User struct { type RankedArtwork struct { ID int `json:"illust_id"` Title string `json:"title"` + Rank int `json:"rank"` Pages string `json:"illust_page_count"` Image string `json:"url"` ArtistID int `json:"user_id"` diff --git a/template/rank.html b/template/rank.html index 81df5b4..7286cee 100644 --- a/template/rank.html +++ b/template/rank.html @@ -5,43 +5,121 @@
Content - Overall - Illustrations - Mangas + Overall + Illustrations + Mangas

Modes - Daily - Weekly - Monthly - Rookie + Daily + Weekly + Monthly + Rookie - Daily (R-18) - Weekly (R-18) + Daily (R-18) + Weekly (R-18)

- {{ range $i, $_ := .Items }} + {{ range .Items }}
-
{{ $i | inc}}
+
{{ .Rank }}
{{ if gt (toInt .Pages) 1 }}
⧉ {{ .Pages }}
{{ end }} - {{ .Title }} + {{ .Title }}

{{ .Title }}

- {{ .ArtistName }} - {{ .ArtistName }} + {{ .ArtistName }} + {{ .ArtistName }}
{{ end }} + + {{ template "footer.html" }} diff --git a/views/routes.go b/views/routes.go index 603cff1..785e4be 100644 --- a/views/routes.go +++ b/views/routes.go @@ -82,12 +82,14 @@ func ranking_page(c *gin.Context) { page = "1" } + pageInt, _ := strconv.Atoi(page) + response, _ := PC.GetRanking(mode, content, page) c.HTML(http.StatusOK, "rank.html", gin.H{"Items": response.Artworks, "Mode": mode, "Content": content, - "Page": page}) + "Page": pageInt}) } func newestArtworksPage(c *gin.Context) {