Browse Source

repo: commits, branches and releases should highlight files tab

Unknwon 8 years ago
parent
commit
61e2bff757
3 changed files with 7 additions and 1 deletions
  1. 5 1
      cmd/web.go
  2. 1 0
      routers/repo/commit.go
  3. 1 0
      routers/repo/release.go

+ 5 - 1
cmd/web.go

@@ -529,7 +529,9 @@ func runWeb(ctx *cli.Context) error {
 			m.Post("/delete", repo.DeleteRelease)
 			m.Get("/edit/*", repo.EditRelease)
 			m.Post("/edit/*", bindIgnErr(form.EditRelease{}), repo.EditReleasePost)
-		}, reqRepoWriter)
+		}, reqRepoWriter, func(ctx *context.Context) {
+			ctx.Data["PageIsViewCode"] = true
+		})
 
 		// FIXME: Should use ctx.Repo.PullRequest to unify template, currently we have inconsistent URL
 		// for PR in same repository. After select branch on the page, the URL contains redundant head user name.
@@ -579,6 +581,8 @@ func runWeb(ctx *cli.Context) error {
 			m.Get("", repo.Branches)
 			m.Get("/all", repo.AllBranches)
 			m.Post("/delete/*", reqSignIn, reqRepoWriter, repo.DeleteBranchPost)
+		}, func(ctx *context.Context) {
+			ctx.Data["PageIsViewCode"] = true
 		})
 
 		m.Group("/wiki", func() {

+ 1 - 0
routers/repo/commit.go

@@ -22,6 +22,7 @@ const (
 )
 
 func RefCommits(ctx *context.Context) {
+	ctx.Data["PageIsViewCode"] = true
 	switch {
 	case len(ctx.Repo.TreePath) == 0:
 		Commits(ctx)

+ 1 - 0
routers/repo/release.go

@@ -45,6 +45,7 @@ func calReleaseNumCommitsBehind(repoCtx *context.Repository, release *models.Rel
 
 func Releases(ctx *context.Context) {
 	ctx.Data["Title"] = ctx.Tr("repo.release.releases")
+	ctx.Data["PageIsViewCode"] = true
 	ctx.Data["PageIsReleaseList"] = true
 
 	tagsResult, err := ctx.Repo.GitRepo.GetTagsAfter(ctx.Query("after"), 10)