mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-25 02:48:05 +00:00
Fixes forgejo/forgejo#12951 The changes are made to the following template files: - on the repo star/unstar button - on the repo watch/unwatch button - on the issue notification button Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12976 Reviewed-by: 0ko <0ko@noreply.codeberg.org>
16 lines
1.1 KiB
Go HTML Template
16 lines
1.1 KiB
Go HTML Template
<form hx-target="this" hx-post="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star" hx-on::after-settle="this.querySelector('button').focus()" method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star">
|
|
<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.star_guest_user"}}"{{end}}>
|
|
<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{if $.IsStaringRepo}}{{ctx.Locale.Tr "repo.unstar"}}{{else}}{{ctx.Locale.Tr "repo.star"}}{{end}}">
|
|
{{if $.IsStaringRepo}}
|
|
{{svg "octicon-star-fill"}}<span class="text not-mobile">{{ctx.Locale.Tr "repo.unstar"}}</span>
|
|
{{else}}
|
|
{{svg "octicon-star"}}<span class="text not-mobile">{{ctx.Locale.Tr "repo.star"}}</span>
|
|
{{end}}
|
|
</button>
|
|
<a hx-boost="false" class="ui basic label" href="{{$.RepoLink}}/stars"
|
|
aria-label="{{ctx.Locale.TrPluralString .Repository.NumStars "stars.n_stars" (printf "%d" .Repository.NumStars)}}"
|
|
>
|
|
{{CountFmt .Repository.NumStars}}
|
|
</a>
|
|
</div>
|
|
</form>
|