add beatmap name and link to versions page
This commit is contained in:
parent
1ac3c9b982
commit
6dddd54e07
2 changed files with 15 additions and 2 deletions
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
{{ define "content" }}
|
||||
|
||||
<h3>versions of {{ .Beatmapset.Artist }} - {{ .Beatmapset.Title }}</h3>
|
||||
|
||||
<p>
|
||||
<a href="https://osu.ppy.sh/s/{{ .Beatmapset.ID }}" target="_blank">Map link</a>
|
||||
·
|
||||
mapped by <a href="https://osu.ppy.sh/u/{{ .Beatmapset.UserID }}" target="_blank">{{ .Beatmapset.Creator }}</a>
|
||||
</p>
|
||||
|
||||
<small>up to the latest 20 revisions, pagination coming later</small>
|
||||
|
||||
<table>
|
||||
|
|
Loading…
Reference in a new issue