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

code optimization (#31315)

Simplifying complex if-else to existing Iif operations
This commit is contained in:
Kerwin Bryant
2024-06-11 21:07:10 +08:00
committed by GitHub
parent 397930d8c1
commit e6ab6e637f
14 changed files with 90 additions and 48 deletions

View File

@@ -93,9 +93,9 @@
{{end}}
</td>
<td class="gt-ellipsis tw-max-w-48">{{.Email}}</td>
<td>{{if .IsActive}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
<td>{{if .IsRestricted}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
<td>{{if index $.UsersTwoFaStatus .ID}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
<td>{{svg (Iif .IsActive "octicon-check" "octicon-x")}}</td>
<td>{{svg (Iif .IsRestricted "octicon-check" "octicon-x")}}</td>
<td>{{svg (Iif (index $.UsersTwoFaStatus .ID) "octicon-check" "octicon-x")}}</td>
<td>{{DateTime "short" .CreatedUnix}}</td>
{{if .LastLoginUnix}}
<td>{{DateTime "short" .LastLoginUnix}}</td>