diff options
author | zeripath <art27@cantab.net> | 2020-09-11 12:01:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-11 12:01:51 +0100 |
commit | 4eb0a1dfaf3c4a69651b1055fa09409b9cf0b528 (patch) | |
tree | ae3edb93a8f164313dbba218e3a5c8b234e55d6a /templates | |
parent | e0ac545043d81c9096c161e127a9d4d9e88b1d9f (diff) | |
download | gitea-4eb0a1dfaf3c4a69651b1055fa09409b9cf0b528.tar.gz gitea-4eb0a1dfaf3c4a69651b1055fa09409b9cf0b528.zip |
Disable watch and star if not signed in (#12807)
Fix #12070
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/header.tmpl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 1cfdb7287b..491cbc1c29 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -37,8 +37,8 @@ <div class="repo-buttons"> <form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} - <div class="ui labeled button" tabindex="0"> - <button type="submit" class="ui compact basic button"> + <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"{{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}} </button> <a class="ui basic label" href="{{.Link}}/watchers"> @@ -48,8 +48,8 @@ </form> <form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} - <div class="ui labeled button" tabindex="0"> - <button type="submit" class="ui compact basic button"> + <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"{{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}} </button> <a class="ui basic label" href="{{.Link}}/stars"> |