code.gitea.io/gitea@v1.22.3/routers/web/repo/find.go (about) 1 // Copyright 2022 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package repo 5 6 import ( 7 "net/http" 8 9 "code.gitea.io/gitea/modules/base" 10 "code.gitea.io/gitea/modules/util" 11 "code.gitea.io/gitea/services/context" 12 ) 13 14 const ( 15 tplFindFiles base.TplName = "repo/find/files" 16 ) 17 18 // FindFiles render the page to find repository files 19 func FindFiles(ctx *context.Context) { 20 path := ctx.Params("*") 21 ctx.Data["TreeLink"] = ctx.Repo.RepoLink + "/src/" + util.PathEscapeSegments(path) 22 ctx.Data["DataLink"] = ctx.Repo.RepoLink + "/tree-list/" + util.PathEscapeSegments(path) 23 ctx.HTML(http.StatusOK, tplFindFiles) 24 }