mirror of
https://github.com/go-gitea/gitea
synced 2025-08-02 07:38:35 +00:00
Refactor template empty checks (#28351)
This commit is contained in:
@@ -81,12 +81,12 @@
|
||||
{{end}}
|
||||
{{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
|
||||
<div class="ui labeled button
|
||||
{{if or (not $.IsSigned) (and (not $.CanSignedUserFork) (eq (len $.UserAndOrgForks) 0))}}
|
||||
{{if or (not $.IsSigned) (and (not $.CanSignedUserFork) (not $.UserAndOrgForks))}}
|
||||
disabled
|
||||
{{end}}"
|
||||
{{if not $.IsSigned}}
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.fork_guest_user"}}"
|
||||
{{else if and (not $.CanSignedUserFork) (eq (len $.UserAndOrgForks) 0)}}
|
||||
{{else if and (not $.CanSignedUserFork) (not $.UserAndOrgForks)}}
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.fork_from_self"}}"
|
||||
{{end}}
|
||||
>
|
||||
@@ -98,7 +98,7 @@
|
||||
href="{{AppSubUrl}}/{{(index $.UserAndOrgForks 0).FullName}}"
|
||||
{{/*else is not required here, because the button shouldn't link to any site if you can't create a fork*/}}
|
||||
{{end}}
|
||||
{{else if eq (len $.UserAndOrgForks) 0}}
|
||||
{{else if not $.UserAndOrgForks}}
|
||||
href="{{AppSubUrl}}/repo/fork/{{.ID}}"
|
||||
{{else}}
|
||||
data-modal="#fork-repo-modal"
|
||||
|
Reference in New Issue
Block a user