Skip to content

Commit aa6f886

Browse files
authored
Fix missing template for follow button in organization (#29215)
Leftover from #29005 # Before ![before](https://github.com/go-gitea/gitea/assets/20454870/24c74278-ccac-4dc6-bf26-713e90c07239) # After ![after](https://github.com/go-gitea/gitea/assets/20454870/f91d503b-87d4-4c17-a56c-9c0a81fd9082) --------- Signed-off-by: Yarden Shoham <[email protected]>
1 parent b96fbb5 commit aa6f886

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

routers/web/user/profile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
const (
3131
tplProfileBigAvatar base.TplName = "shared/user/profile_big_avatar"
32-
tplFollowUnfollow base.TplName = "shared/user/follow_unfollow"
32+
tplFollowUnfollow base.TplName = "org/follow_unfollow"
3333
)
3434

3535
// OwnerProfile render profile page for a user or a organization (aka, repo owner)

templates/org/follow_unfollow.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<button class="ui basic button gt-mr-0" hx-post="{{.Org.HomeLink}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}">
2+
{{if $.IsFollowing}}
3+
{{ctx.Locale.Tr "user.unfollow"}}
4+
{{else}}
5+
{{ctx.Locale.Tr "user.follow"}}
6+
{{end}}
7+
</button>

templates/org/home.tmpl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@
2626
</a>
2727
{{end}}
2828
{{if .IsSigned}}
29-
<button class="ui basic button gt-mr-0" hx-post="{{.Org.HomeLink}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}">
30-
{{if $.IsFollowing}}
31-
{{ctx.Locale.Tr "user.unfollow"}}
32-
{{else}}
33-
{{ctx.Locale.Tr "user.follow"}}
34-
{{end}}
35-
</button>
29+
{{template "org/follow_unfollow" .}}
3630
{{end}}
3731
</div>
3832
</div>

0 commit comments

Comments
 (0)