File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,12 @@ func RefBlame(ctx *context.Context) {
194194 commitNames [c .ID .String ()] = c
195195 }
196196
197+ // Get Topics of this repo
198+ renderRepoTopics (ctx )
199+ if ctx .Written () {
200+ return
201+ }
202+
197203 renderBlame (ctx , blameParts , commitNames )
198204
199205 ctx .HTML (200 , tplBlame )
Original file line number Diff line number Diff line change @@ -621,6 +621,17 @@ func renderLanguageStats(ctx *context.Context) {
621621 ctx .Data ["LanguageStats" ] = langs
622622}
623623
624+ func renderRepoTopics (ctx * context.Context ) {
625+ topics , err := models .FindTopics (& models.FindTopicOptions {
626+ RepoID : ctx .Repo .Repository .ID ,
627+ })
628+ if err != nil {
629+ ctx .ServerError ("models.FindTopics" , err )
630+ return
631+ }
632+ ctx .Data ["Topics" ] = topics
633+ }
634+
624635func renderCode (ctx * context.Context ) {
625636 ctx .Data ["PageIsViewCode" ] = true
626637
@@ -645,14 +656,10 @@ func renderCode(ctx *context.Context) {
645656 }
646657
647658 // Get Topics of this repo
648- topics , err := models .FindTopics (& models.FindTopicOptions {
649- RepoID : ctx .Repo .Repository .ID ,
650- })
651- if err != nil {
652- ctx .ServerError ("models.FindTopics" , err )
659+ renderRepoTopics (ctx )
660+ if ctx .Written () {
653661 return
654662 }
655- ctx .Data ["Topics" ] = topics
656663
657664 // Get current entry user currently looking at.
658665 entry , err := ctx .Repo .Commit .GetTreeEntryByPath (ctx .Repo .TreePath )
You can’t perform that action at this time.
0 commit comments