File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments