{{$canNotForkOwn := and $.IsSigned (not $.CanSignedUserFork) (not $.UserAndOrgForks)}} {{$forkHref := printf "%s/fork" $.RepoLink}} {{if not $.IsSigned}} {{$forkHref = printf "%s/user/login" AppSubUrl}} {{else if $.ShowForkModal}}{{/* see backend comment for this logic */}} {{$forkHref = "#"}} {{else if eq (len $.UserAndOrgForks) 1}} {{$forkHref = printf "%s/%s" AppSubUrl (index $.UserAndOrgForks 0).FullName}} {{else if $canNotForkOwn}} {{$forkHref = "#"}} {{end}} {{svg "octicon-repo-forked"}} {{ctx.Locale.Tr "repo.fork"}} {{CountFmt $.Repository.NumForks}} {{if $.ShowForkModal}} {{end}}