mirror of https://github.com/gogs/gogs.git
repo: rename PageIsViewCode -> PageIsViewFiles
Also highlight 'Files' tab when use editor.pull/4330/head
parent
aba8789542
commit
bb86d66496
|
@ -534,7 +534,7 @@ func runWeb(ctx *cli.Context) error {
|
||||||
m.Get("/edit/*", repo.EditRelease)
|
m.Get("/edit/*", repo.EditRelease)
|
||||||
m.Post("/edit/*", bindIgnErr(form.EditRelease{}), repo.EditReleasePost)
|
m.Post("/edit/*", bindIgnErr(form.EditRelease{}), repo.EditReleasePost)
|
||||||
}, repo.MustBeNotBare, reqRepoWriter, func(ctx *context.Context) {
|
}, repo.MustBeNotBare, reqRepoWriter, func(ctx *context.Context) {
|
||||||
ctx.Data["PageIsViewCode"] = true
|
ctx.Data["PageIsViewFiles"] = true
|
||||||
})
|
})
|
||||||
|
|
||||||
// FIXME: Should use ctx.Repo.PullRequest to unify template, currently we have inconsistent URL
|
// FIXME: Should use ctx.Repo.PullRequest to unify template, currently we have inconsistent URL
|
||||||
|
@ -569,6 +569,8 @@ func runWeb(ctx *cli.Context) error {
|
||||||
ctx.NotFound()
|
ctx.NotFound()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.Data["PageIsViewFiles"] = true
|
||||||
})
|
})
|
||||||
}, reqSignIn, context.RepoAssignment())
|
}, reqSignIn, context.RepoAssignment())
|
||||||
|
|
||||||
|
@ -586,7 +588,7 @@ func runWeb(ctx *cli.Context) error {
|
||||||
m.Get("/all", repo.AllBranches)
|
m.Get("/all", repo.AllBranches)
|
||||||
m.Post("/delete/*", reqSignIn, reqRepoWriter, repo.DeleteBranchPost)
|
m.Post("/delete/*", reqSignIn, reqRepoWriter, repo.DeleteBranchPost)
|
||||||
}, repo.MustBeNotBare, func(ctx *context.Context) {
|
}, repo.MustBeNotBare, func(ctx *context.Context) {
|
||||||
ctx.Data["PageIsViewCode"] = true
|
ctx.Data["PageIsViewFiles"] = true
|
||||||
})
|
})
|
||||||
|
|
||||||
m.Group("/wiki", func() {
|
m.Group("/wiki", func() {
|
||||||
|
|
|
@ -22,7 +22,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
func RefCommits(ctx *context.Context) {
|
func RefCommits(ctx *context.Context) {
|
||||||
ctx.Data["PageIsViewCode"] = true
|
ctx.Data["PageIsViewFiles"] = true
|
||||||
switch {
|
switch {
|
||||||
case len(ctx.Repo.TreePath) == 0:
|
case len(ctx.Repo.TreePath) == 0:
|
||||||
Commits(ctx)
|
Commits(ctx)
|
||||||
|
|
|
@ -47,7 +47,7 @@ func calReleaseNumCommitsBehind(repoCtx *context.Repository, release *models.Rel
|
||||||
|
|
||||||
func Releases(ctx *context.Context) {
|
func Releases(ctx *context.Context) {
|
||||||
ctx.Data["Title"] = ctx.Tr("repo.release.releases")
|
ctx.Data["Title"] = ctx.Tr("repo.release.releases")
|
||||||
ctx.Data["PageIsViewCode"] = true
|
ctx.Data["PageIsViewFiles"] = true
|
||||||
ctx.Data["PageIsReleaseList"] = true
|
ctx.Data["PageIsReleaseList"] = true
|
||||||
|
|
||||||
tagsResult, err := ctx.Repo.GitRepo.GetTagsAfter(ctx.Query("after"), 10)
|
tagsResult, err := ctx.Repo.GitRepo.GetTagsAfter(ctx.Query("after"), 10)
|
||||||
|
|
|
@ -224,7 +224,7 @@ func setEditorconfigIfExists(ctx *context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func Home(ctx *context.Context) {
|
func Home(ctx *context.Context) {
|
||||||
ctx.Data["PageIsViewCode"] = true
|
ctx.Data["PageIsViewFiles"] = true
|
||||||
|
|
||||||
if ctx.Repo.Repository.IsBare {
|
if ctx.Repo.Repository.IsBare {
|
||||||
ctx.HTML(200, BARE)
|
ctx.HTML(200, BARE)
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
{{if not .IsDiffCompare}}
|
{{if not .IsDiffCompare}}
|
||||||
<div class="ui tabs container">
|
<div class="ui tabs container">
|
||||||
<div class="ui tabular menu navbar">
|
<div class="ui tabular menu navbar">
|
||||||
<a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}">
|
<a class="{{if .PageIsViewFiles}}active{{end}} item" href="{{.RepoLink}}">
|
||||||
<i class="octicon octicon-file-text"></i> {{.i18n.Tr "repo.files"}}
|
<i class="octicon octicon-file-text"></i> {{.i18n.Tr "repo.files"}}
|
||||||
</a>
|
</a>
|
||||||
{{if .Repository.EnableIssues}}
|
{{if .Repository.EnableIssues}}
|
||||||
|
|
Loading…
Reference in New Issue