diff options
author | Kerwin Bryant <kerwin612@qq.com> | 2024-06-11 21:07:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 21:07:10 +0800 |
commit | e6ab6e637fb4da2353522d192066869fc2a8a94b (patch) | |
tree | 4d42d59ba55adce8a5e36bac07f0a9da9414f531 /templates/repo/star_unstar.tmpl | |
parent | 397930d8c1ffaeefbfec438908b8ddfc75de249a (diff) | |
download | gitea-e6ab6e637fb4da2353522d192066869fc2a8a94b.tar.gz gitea-e6ab6e637fb4da2353522d192066869fc2a8a94b.zip |
code optimization (#31315)
Simplifying complex if-else to existing Iif operations
Diffstat (limited to 'templates/repo/star_unstar.tmpl')
-rw-r--r-- | templates/repo/star_unstar.tmpl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/star_unstar.tmpl b/templates/repo/star_unstar.tmpl index 0f09d8b492..9234a0d196 100644 --- a/templates/repo/star_unstar.tmpl +++ b/templates/repo/star_unstar.tmpl @@ -3,7 +3,7 @@ {{$buttonText := ctx.Locale.Tr "repo.star"}} {{if $.IsStaringRepo}}{{$buttonText = ctx.Locale.Tr "repo.unstar"}}{{end}} <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}"> - {{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{else}}{{svg "octicon-star"}}{{end}} + {{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}} <span aria-hidden="true">{{$buttonText}}</span> </button> <a hx-boost="false" class="ui basic label" href="{{$.RepoLink}}/stars"> |