diff options
author | Kyle D <kdumontnu@gmail.com> | 2021-04-15 10:53:57 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-15 18:53:57 +0200 |
commit | f44543a1bb776fa8bdfd3b605d67197d1466eb20 (patch) | |
tree | b9a014285b40c3eb45dd90bcafa7ccc17c1031d8 /templates/repo/header.tmpl | |
parent | af2adb4e35ea71ca5c7fbb1e51b9d25fe49af2e4 (diff) | |
download | gitea-f44543a1bb776fa8bdfd3b605d67197d1466eb20.tar.gz gitea-f44543a1bb776fa8bdfd3b605d67197d1466eb20.zip |
Disable Stars config option (#14653)
* Add config option to disable stars
* Replace "stars" with watched in user profile
* Add documentation
Diffstat (limited to 'templates/repo/header.tmpl')
-rw-r--r-- | templates/repo/header.tmpl | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 188fc87b6a..ebd0333e8c 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -71,17 +71,19 @@ </a> </div> </form> - <form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}"> - {{$.CsrfTokenHtml}} - <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 small basic button"{{if not $.IsSigned}} disabled{{end}}> - {{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{svg "octicon-star"}}{{$.i18n.Tr "repo.star"}}{{end}} - </button> - <a class="ui basic label" href="{{.Link}}/stars"> - {{CountFmt .NumStars}} - </a> - </div> - </form> + {{if not $.DisableStars}} + <form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}"> + {{$.CsrfTokenHtml}} + <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 small basic button"{{if not $.IsSigned}} disabled{{end}}> + {{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{svg "octicon-star"}}{{$.i18n.Tr "repo.star"}}{{end}} + </button> + <a class="ui basic label" href="{{.Link}}/stars"> + {{CountFmt .NumStars}} + </a> + </div> + </form> + {{end}} {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}} <div class="ui labeled button{{if not $.CanSignedUserFork}} poping up disabled{{end}}"{{if and (not $.CanSignedUserFork) $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" {{else if not $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_guest_user"}}"{{end}} data-position="top center" data-variation="tiny" tabindex="0"> <a class="ui compact small basic button"{{if $.CanSignedUserFork}} href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{end}}> |