diff options
author | yp05327 <576951401@qq.com> | 2024-02-17 06:13:37 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-02-17 23:24:31 +0100 |
commit | fd3b4afa2b3621ece2d7d1587fd4b017142d75a0 (patch) | |
tree | 1bf0b526549df778547b31f024cbc49977763294 /templates | |
parent | [skip ci] Updated translations via Crowdin (diff) | |
download | forgejo-fd3b4afa2b3621ece2d7d1587fd4b017142d75a0.tar.xz forgejo-fd3b4afa2b3621ece2d7d1587fd4b017142d75a0.zip |
Fix broken following organization (#29005)
- following organization is broken from #28908
- add login check for the follow button in organization profile page
(cherry picked from commit 68227996a7a84a240b36c304d04c5c8d82948df8)
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 c2322b75fb..2ca60cd1be 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -30,13 +30,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> |