@@ -28,6 +28,7 @@ import (
2828 "code.gitea.io/gitea/modules/markup"
2929 "code.gitea.io/gitea/modules/setting"
3030 "code.gitea.io/gitea/modules/util"
31+ "code.gitea.io/gitea/routers/web/repo/shared"
3132 "code.gitea.io/gitea/services/context"
3233 "code.gitea.io/gitea/services/gitdiff"
3334 repo_service "code.gitea.io/gitea/services/repository"
@@ -61,6 +62,10 @@ func Commits(ctx *context.Context) {
6162 }
6263 ctx .Data ["PageIsViewCode" ] = true
6364
65+ if ! shared .RenderRepoSubMenu (ctx ) {
66+ return
67+ }
68+
6469 commitsCount , err := ctx .Repo .GetCommitsCount ()
6570 if err != nil {
6671 ctx .ServerError ("GetCommitsCount" , err )
@@ -102,7 +107,6 @@ func Commits(ctx *context.Context) {
102107 pager := context .NewPagination (int (commitsCount ), pageSize , page , 5 )
103108 pager .SetDefaultParams (ctx )
104109 ctx .Data ["Page" ] = pager
105- ctx .Data ["LicenseFileName" ] = repo_service .LicenseFileName
106110 ctx .HTML (http .StatusOK , tplCommits )
107111}
108112
@@ -197,6 +201,10 @@ func SearchCommits(ctx *context.Context) {
197201 ctx .Data ["PageIsCommits" ] = true
198202 ctx .Data ["PageIsViewCode" ] = true
199203
204+ if ! shared .RenderRepoSubMenu (ctx ) {
205+ return
206+ }
207+
200208 query := ctx .FormTrim ("q" )
201209 if len (query ) == 0 {
202210 ctx .Redirect (ctx .Repo .RepoLink + "/commits/" + ctx .Repo .BranchNameSubURL ())
@@ -220,12 +228,15 @@ func SearchCommits(ctx *context.Context) {
220228 ctx .Data ["Username" ] = ctx .Repo .Owner .Name
221229 ctx .Data ["Reponame" ] = ctx .Repo .Repository .Name
222230 ctx .Data ["RefName" ] = ctx .Repo .RefName
223- ctx .Data ["LicenseFileName" ] = repo_service .LicenseFileName
224231 ctx .HTML (http .StatusOK , tplCommits )
225232}
226233
227234// FileHistory show a file's reversions
228235func FileHistory (ctx * context.Context ) {
236+ if ! shared .RenderRepoSubMenu (ctx ) {
237+ return
238+ }
239+
229240 fileName := ctx .Repo .TreePath
230241 if len (fileName ) == 0 {
231242 Commits (ctx )
@@ -266,7 +277,6 @@ func FileHistory(ctx *context.Context) {
266277 pager := context .NewPagination (int (commitsCount ), setting .Git .CommitsRangeSize , page , 5 )
267278 pager .SetDefaultParams (ctx )
268279 ctx .Data ["Page" ] = pager
269- ctx .Data ["LicenseFileName" ] = repo_service .LicenseFileName
270280 ctx .HTML (http .StatusOK , tplCommits )
271281}
272282
0 commit comments