aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/find.go
diff options
context:
space:
mode:
authorRoger Luo <rogerluo410@gmail.com>2022-06-09 19:15:08 +0800
committerGitHub <noreply@github.com>2022-06-09 14:15:08 +0300
commit2ae45cebbf2ec839bf2280765f958eb60d1f6374 (patch)
tree7e5a81f11ceebcbaf7c71cf9853a4c21fe28eeaf /routers/web/repo/find.go
parent7948cb3149ab64484a8d4c6644f53f9f39accbef (diff)
downloadgitea-2ae45cebbf2ec839bf2280765f958eb60d1f6374.tar.gz
gitea-2ae45cebbf2ec839bf2280765f958eb60d1f6374.zip
Feature: Find files in repo (#15028)
* Create finding files page ui in repo page * Get tree entries for find repo files. * Move find files JS to individual file. * gen swagger. * Add enry.IsVendor to exclude entries Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers/web/repo/find.go')
-rw-r--r--routers/web/repo/find.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/routers/web/repo/find.go b/routers/web/repo/find.go
new file mode 100644
index 0000000000..7117c00076
--- /dev/null
+++ b/routers/web/repo/find.go
@@ -0,0 +1,24 @@
+// Copyright 2022 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package repo
+
+import (
+ "net/http"
+
+ "code.gitea.io/gitea/modules/base"
+ "code.gitea.io/gitea/modules/context"
+)
+
+const (
+ tplFindFiles base.TplName = "repo/find/files"
+)
+
+// FindFiles render the page to find repository files
+func FindFiles(ctx *context.Context) {
+ path := ctx.Params("*")
+ ctx.Data["TreeLink"] = ctx.Repo.RepoLink + "/src/" + path
+ ctx.Data["DataLink"] = ctx.Repo.RepoLink + "/tree-list/" + path
+ ctx.HTML(http.StatusOK, tplFindFiles)
+}