Skip to content

Commit

Permalink
Fix missing template for follow button in organization (go-gitea#29215)
Browse files Browse the repository at this point in the history
  • Loading branch information
yardenshoham authored and earl-warren committed Feb 17, 2024
1 parent ca85251 commit a46fa02
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion routers/web/user/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

const (
tplProfileBigAvatar base.TplName = "shared/user/profile_big_avatar"
tplFollowUnfollow base.TplName = "shared/user/follow_unfollow"
tplFollowUnfollow base.TplName = "org/follow_unfollow"
)

// OwnerProfile render profile page for a user or a organization (aka, repo owner)
Expand Down
7 changes: 7 additions & 0 deletions templates/org/follow_unfollow.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<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>
8 changes: 1 addition & 7 deletions templates/org/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@
</a>
{{end}}
{{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>
{{template "org/follow_unfollow" .}}
{{end}}
</div>
</div>
Expand Down

0 comments on commit a46fa02

Please sign in to comment.