feat: Add summary card for repos and releases

This commit is contained in:
JakobDev 2024-12-14 19:36:09 +01:00
parent f5cfdd80a7
commit 7685a1e98e
No known key found for this signature in database
GPG key ID: 39DEF62C3ED6DC4C
11 changed files with 673 additions and 247 deletions

View file

@ -1146,9 +1146,10 @@ func registerRoutes(m *web.Route) {
m.Group("/{type:issues|pulls}", func() {
m.Group("/{index}", func() {
m.Get("/info", repo.GetIssueInfo)
m.Get("/summary-card", repo.GetSummaryCard)
m.Get("/summary-card", repo.DrawIssueSummaryCard)
})
})
m.Get("/-/summary-card", repo.DrawRepoSummaryCard)
}, ignSignIn, context.RepoAssignment, context.UnitTypes()) // for "/{username}/{reponame}" which doesn't require authentication
// Grouping for those endpoints that do require authentication
@ -1298,6 +1299,7 @@ func registerRoutes(m *web.Route) {
m.Get("/latest", repo.LatestRelease)
m.Get(".rss", feedEnabled, repo.ReleasesFeedRSS)
m.Get(".atom", feedEnabled, repo.ReleasesFeedAtom)
m.Get("/summary-card/{releaseID}", repo.DrawReleaseSummaryCard)
}, ctxDataSet("EnableFeed", setting.Other.EnableFeed),
repo.MustBeNotEmpty, context.RepoRefByType(context.RepoRefTag, true))
m.Get("/releases/attachments/{uuid}", repo.MustBeNotEmpty, repo.GetAttachment)