diff options
author | yp05327 <576951401@qq.com> | 2024-02-17 14:13:37 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-17 13:13:37 +0800 |
commit | 68227996a7a84a240b36c304d04c5c8d82948df8 (patch) | |
tree | 94a59fc2d0cc3c043742929bd272add1f5eb90fc /templates | |
parent | e936d2b338859c527482d1569c92d1f8f97f4d51 (diff) | |
download | gitea-68227996a7a84a240b36c304d04c5c8d82948df8.tar.gz gitea-68227996a7a84a240b36c304d04c5c8d82948df8.zip |
Fix broken following organization (#29005)
- following organization is broken from #28908
- add login check for the follow button in organization profile page
Diffstat (limited to 'templates')
-rw-r--r-- | templates/org/home.tmpl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index fc65d4691c..322be3271d 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -25,13 +25,15 @@ {{svg "octicon-rss" 24}} </a> {{end}} - <button class="link-action ui basic button gt-mr-0" data-url="{{.Org.HomeLink}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}"> - {{if $.IsFollowing}} - {{ctx.Locale.Tr "user.unfollow"}} - {{else}} - {{ctx.Locale.Tr "user.follow"}} - {{end}} - </button> + {{if .IsSigned}} + <button class="ui basic button gt-mr-0" hx-post="{{.Org.HomeLink}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}"> + {{if $.IsFollowing}} + {{ctx.Locale.Tr "user.unfollow"}} + {{else}} + {{ctx.Locale.Tr "user.follow"}} + {{end}} + </button> + {{end}} </div> </div> |