From 6dddd54e07f7b041269d704ee1df2810709d5196 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Wed, 14 Oct 2020 16:30:18 -0500 Subject: [PATCH] add beatmap name and link to versions page --- web/repo.go | 9 +++++++-- web/templates/map-version.html | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/web/repo.go b/web/repo.go index 10a4bd4..5e721db 100644 --- a/web/repo.go +++ b/web/repo.go @@ -5,6 +5,7 @@ import ( "io" "net/http" "path" + "strconv" "time" "github.com/dustin/go-humanize" @@ -18,6 +19,9 @@ func (web *Web) mapVersions(c *gin.Context) { userId := c.Param("userId") mapId := c.Param("mapId") + id, _ := strconv.Atoi(mapId) + bs, _ := web.api.GetBeatmapSet(id) + repoDir := path.Join(web.config.Repos, userId, mapId) repo, _ := git.PlainOpen(repoDir) @@ -51,8 +55,9 @@ func (web *Web) mapVersions(c *gin.Context) { } c.HTML(http.StatusOK, "map-version.html", gin.H{ - "LoggedIn": isLoggedIn(c), - "Versions": versions, + "Beatmapset": bs, + "LoggedIn": isLoggedIn(c), + "Versions": versions, }) } diff --git a/web/templates/map-version.html b/web/templates/map-version.html index 0d7fc86..66bb683 100644 --- a/web/templates/map-version.html +++ b/web/templates/map-version.html @@ -1,5 +1,13 @@ {{ define "content" }} +

versions of {{ .Beatmapset.Artist }} - {{ .Beatmapset.Title }}

+ +

+ Map link + · + mapped by {{ .Beatmapset.Creator }} +

+ up to the latest 20 revisions, pagination coming later