1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix broken following organization (#29005)

- following organization is broken from #28908
- add login check for the follow button in organization profile page
This commit is contained in:
yp05327
2024-02-17 14:13:37 +09:00
committed by GitHub
parent e936d2b338
commit 68227996a7
2 changed files with 21 additions and 9 deletions

View File

@@ -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>