aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/star_unstar.tmpl
diff options
context:
space:
mode:
authorKerwin Bryant <kerwin612@qq.com>2024-06-11 21:07:10 +0800
committerGitHub <noreply@github.com>2024-06-11 21:07:10 +0800
commite6ab6e637fb4da2353522d192066869fc2a8a94b (patch)
tree4d42d59ba55adce8a5e36bac07f0a9da9414f531 /templates/repo/star_unstar.tmpl
parent397930d8c1ffaeefbfec438908b8ddfc75de249a (diff)
downloadgitea-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.tmpl2
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">