diff options
author | Gergely Nagy <forgejo@gergo.csillger.hu> | 2024-02-25 11:58:23 +0100 |
---|---|---|
committer | Gergely Nagy <forgejo@gergo.csillger.hu> | 2024-02-25 12:00:17 +0100 |
commit | 0ea021c8c94a11372c0edf6ed5f9705da8750e01 (patch) | |
tree | c8b12a9a9c020888224d9c5661b6fd639d590bb3 /templates/explore | |
parent | Merge pull request 'Fixes #2452 - Skipping SHA256 tests if unsupported' (#245... (diff) | |
download | forgejo-0ea021c8c94a11372c0edf6ed5f9705da8750e01.tar.xz forgejo-0ea021c8c94a11372c0edf6ed5f9705da8750e01.zip |
Allow instance-wide disabling of forking
For small, personal self-hosted instances with no user signups, the fork
button is just a noise. This patch allows disabling them like stars can
be disabled too.
Disabling forks does not only remove the buttons from the web UI, it
also disables the routes that could be used to create forks.
Fixes #2441.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Diffstat (limited to 'templates/explore')
-rw-r--r-- | templates/explore/repo_list.tmpl | 4 | ||||
-rw-r--r-- | templates/explore/repo_search.tmpl | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index c51dcaa3ff..848afd305c 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -39,7 +39,9 @@ {{if not $.DisableStars}} <a class="text grey flex-text-inline" href="{{.Link}}/stars">{{svg "octicon-star" 16}}{{.NumStars}}</a> {{end}} - <a class="text grey flex-text-inline" href="{{.Link}}/forks">{{svg "octicon-git-branch" 16}}{{.NumForks}}</a> + {{if not $.DisableForks}} + <a class="text grey flex-text-inline" href="{{.Link}}/forks">{{svg "octicon-git-branch" 16}}{{.NumForks}}</a> + {{end}} </div> </div> {{$description := .DescriptionHTML $.Context}} diff --git a/templates/explore/repo_search.tmpl b/templates/explore/repo_search.tmpl index eaf2e7a090..573163d554 100644 --- a/templates/explore/repo_search.tmpl +++ b/templates/explore/repo_search.tmpl @@ -29,8 +29,10 @@ <a class="{{if eq .SortType "moststars"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=moststars&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.moststars"}}</a> <a class="{{if eq .SortType "feweststars"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=feweststars&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.feweststars"}}</a> {{end}} - <a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=mostforks&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostforks"}}</a> - <a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=fewestforks&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.fewestforks"}}</a> + {{if not .DisableForks}} + <a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=mostforks&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostforks"}}</a> + <a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=fewestforks&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.fewestforks"}}</a> + {{end}} </div> </div> </div> |