mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-17 11:59:30 +00:00
Refactor template empty checks (#28351)
This commit is contained in:
parent
ec1feedbf5
commit
b3c258828f
11 changed files with 23 additions and 23 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue