mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add topic support (#3711)
* add topic models and unit tests * fix comments * fix comment * add the UI to show or add topics for a repo * show topics on repositories list * fix test * don't show manage topics link when no permission * use green basic as topic label * fix topic label color * remove trace content * remove debug function
This commit is contained in:
@@ -314,6 +314,16 @@ func renderCode(ctx *context.Context) {
|
||||
treeLink += "/" + ctx.Repo.TreePath
|
||||
}
|
||||
|
||||
// Get Topics of this repo
|
||||
topics, err := models.FindTopics(&models.FindTopicOptions{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("models.FindTopics", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["Topics"] = topics
|
||||
|
||||
// Get current entry user currently looking at.
|
||||
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(ctx.Repo.TreePath)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user