1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor find forks and fix possible bugs that weak permissions check (#32528)

- Move models/GetForks to services/FindForks
- Add doer as a parameter of FindForks to check permissions
- Slight performance optimization for get forks API with batch loading
of repository units
- Add tests for forking repository to organizations

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao
2024-11-17 19:06:25 -08:00
committed by GitHub
parent f122aaf9ff
commit 4f879a00df
8 changed files with 202 additions and 41 deletions

View File

@@ -5,12 +5,14 @@
<h2 class="ui dividing header">
{{ctx.Locale.Tr "repo.forks"}}
</h2>
<div class="flex-list">
{{range .Forks}}
<div class="tw-flex tw-items-center tw-py-2">
<span class="tw-mr-1">{{ctx.AvatarUtils.Avatar .Owner}}</span>
<a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{.Link}}">{{.Name}}</a>
<div class="flex-item tw-border-0 repo-fork-item">
<span>{{ctx.AvatarUtils.Avatar .Owner}}</span>
<span><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{.Link}}">{{.Name}}</a></span>
</div>
{{end}}
</div>
</div>
{{template "base/paginate" .}}