code.gitea.io/gitea@v1.21.7/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/context"
    11  )
    12  
    13  const (
    14  	tplFindFiles base.TplName = "repo/find/files"
    15  )
    16  
    17  // FindFiles render the page to find repository files
    18  func FindFiles(ctx *context.Context) {
    19  	path := ctx.Params("*")
    20  	ctx.Data["TreeLink"] = ctx.Repo.RepoLink + "/src/" + path
    21  	ctx.Data["DataLink"] = ctx.Repo.RepoLink + "/tree-list/" + path
    22  	ctx.HTML(http.StatusOK, tplFindFiles)
    23  }