Disable watch and star if not signed in (#12807)
Fix #12070 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
e0ac545043
commit
4eb0a1dfaf
2 changed files with 6 additions and 4 deletions
|
@ -746,6 +746,8 @@ forked_from = forked from
|
||||||
generated_from = generated from
|
generated_from = generated from
|
||||||
fork_from_self = You cannot fork a repository you own.
|
fork_from_self = You cannot fork a repository you own.
|
||||||
fork_guest_user = Sign in to fork this repository.
|
fork_guest_user = Sign in to fork this repository.
|
||||||
|
watch_guest_user = Sign in to watch this repository.
|
||||||
|
star_guest_user = Sign in to star this repository.
|
||||||
copy_link = Copy
|
copy_link = Copy
|
||||||
copy_link_success = Link has been copied
|
copy_link_success = Link has been copied
|
||||||
copy_link_error = Use ⌘C or Ctrl-C to copy
|
copy_link_error = Use ⌘C or Ctrl-C to copy
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
<div class="repo-buttons">
|
<div class="repo-buttons">
|
||||||
<form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
|
<form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
|
||||||
{{$.CsrfTokenHtml}}
|
{{$.CsrfTokenHtml}}
|
||||||
<div class="ui labeled button" tabindex="0">
|
<div class="ui labeled button{{if not $.IsSigned}} poping up{{end}}" tabindex="0"{{if not $.IsSigned}} data-content="{{$.i18n.Tr "repo.watch_guest_user" }}" data-position="top center" data-variation="tiny"{{end}}>
|
||||||
<button type="submit" class="ui compact basic button">
|
<button type="submit" class="ui compact basic button"{{if not $.IsSigned}} disabled{{end}}>
|
||||||
{{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye" 16}}{{$.i18n.Tr "repo.watch"}}{{end}}
|
{{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye" 16}}{{$.i18n.Tr "repo.watch"}}{{end}}
|
||||||
</button>
|
</button>
|
||||||
<a class="ui basic label" href="{{.Link}}/watchers">
|
<a class="ui basic label" href="{{.Link}}/watchers">
|
||||||
|
@ -48,8 +48,8 @@
|
||||||
</form>
|
</form>
|
||||||
<form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
|
<form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
|
||||||
{{$.CsrfTokenHtml}}
|
{{$.CsrfTokenHtml}}
|
||||||
<div class="ui labeled button" tabindex="0">
|
<div class="ui labeled button{{if not $.IsSigned}} poping up{{end}}" tabindex="0"{{if not $.IsSigned}} data-content="{{$.i18n.Tr "repo.star_guest_user" }}" data-position="top center" data-variation="tiny"{{end}}>
|
||||||
<button type="submit" class="ui compact basic button">
|
<button type="submit" class="ui compact basic button"{{if not $.IsSigned}} disabled{{end}}>
|
||||||
{{if $.IsStaringRepo}}{{svg "octicon-star-fill" 16}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{svg "octicon-star" 16}}{{$.i18n.Tr "repo.star"}}{{end}}
|
{{if $.IsStaringRepo}}{{svg "octicon-star-fill" 16}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{svg "octicon-star" 16}}{{$.i18n.Tr "repo.star"}}{{end}}
|
||||||
</button>
|
</button>
|
||||||
<a class="ui basic label" href="{{.Link}}/stars">
|
<a class="ui basic label" href="{{.Link}}/stars">
|
||||||
|
|
Reference in a new issue