gitea源码

watch_unwatch.tmpl 788B

1234567891011121314
  1. <form class="flex-text-inline" hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}unwatch{{else}}watch{{end}}">
  2. <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}"{{end}}>
  3. {{$buttonText := ctx.Locale.Tr "repo.watch"}}
  4. {{if $.IsWatchingRepo}}{{$buttonText = ctx.Locale.Tr "repo.unwatch"}}{{end}}
  5. <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}">
  6. {{svg "octicon-eye"}}
  7. <span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
  8. </button>
  9. <a hx-boost="false" class="ui basic label" href="{{.RepoLink}}/watchers">
  10. {{CountFmt .Repository.NumWatches}}
  11. </a>
  12. </div>
  13. </form>