diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-04-26 19:21:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-26 11:21:04 +0000 |
commit | 993736d838c36e26951b6cfea9c6a549958addd1 (patch) | |
tree | 4e088d12ee60a918c26ee988c25cdb4e92a5651a /routers | |
parent | cd70ab31cdee8116055819bf67bcf374e2aa6172 (diff) | |
download | gitea-993736d838c36e26951b6cfea9c6a549958addd1.tar.gz gitea-993736d838c36e26951b6cfea9c6a549958addd1.zip |
Fix code search input for different views (#30678)
Now only show the "code search" on the repo home page, because it only
does global search.
So do not show it when viewing file or directory to avoid misleading
users (it doesn't search in a directory)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/commit.go | 2 | ||||
-rw-r--r-- | routers/web/repo/compare.go | 1 | ||||
-rw-r--r-- | routers/web/repo/pull.go | 1 |
3 files changed, 0 insertions, 4 deletions
diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go index 8543fa44cc..a2c6ac33e8 100644 --- a/routers/web/repo/commit.go +++ b/routers/web/repo/commit.go @@ -212,8 +212,6 @@ func SearchCommits(ctx *context.Context) { // FileHistory show a file's reversions func FileHistory(ctx *context.Context) { - ctx.Data["IsRepoToolbarCommits"] = true - fileName := ctx.Repo.TreePath if len(fileName) == 0 { Commits(ctx) diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 035a92f228..a55426dab5 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -800,7 +800,6 @@ func CompareDiff(ctx *context.Context) { } ctx.Data["Title"] = "Comparing " + base.ShortSha(beforeCommitID) + separator + base.ShortSha(afterCommitID) - ctx.Data["IsRepoToolbarCommits"] = true ctx.Data["IsDiffCompare"] = true _, templateErrs := setTemplateIfExists(ctx, pullRequestTemplateKey, pullRequestTemplateCandidates) diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index acdba4bcdc..7f131f2e98 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -1225,7 +1225,6 @@ func CompareAndPullRequestPost(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.pulls.compare_changes") ctx.Data["PageIsComparePull"] = true ctx.Data["IsDiffCompare"] = true - ctx.Data["IsRepoToolbarCommits"] = true ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled upload.AddUploadContext(ctx, "comment") |