gitea源码

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