Skip to content

Commit 1c5866d

Browse files
committed
Missing file
1 parent 58802bd commit 1c5866d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

routers/web/repo/find.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2021 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package repo
6+
7+
import (
8+
"code.gitea.io/gitea/modules/base"
9+
"code.gitea.io/gitea/modules/context"
10+
)
11+
12+
const (
13+
tplFindFiles base.TplName = "repo/find/files"
14+
)
15+
16+
// FindFiles render the page to find repository files
17+
func FindFiles(ctx *context.Context) {
18+
ctx.Data["PageIsFindFiles"] = true
19+
ctx.Data["PageIsViewCode"] = true
20+
21+
branchLink := ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL()
22+
treeLink := branchLink
23+
24+
if len(ctx.Repo.TreePath) > 0 {
25+
treeLink += "/" + ctx.Repo.TreePath
26+
}
27+
28+
ctx.Data["BranchName"] = ctx.Repo.BranchName
29+
ctx.Data["OwnerName"] = ctx.Repo.Owner.Name
30+
ctx.Data["RepoName"] = ctx.Repo.Repository.Name
31+
32+
ctx.Data["RepoLink"] = ctx.Repo.RepoLink
33+
ctx.Data["TreeLink"] = treeLink
34+
35+
ctx.HTML(200, tplFindFiles)
36+
}

0 commit comments

Comments
 (0)