diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index cc1953debf..1a9a9cf603 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -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) diff --git a/templates/org/follow_unfollow.tmpl b/templates/org/follow_unfollow.tmpl new file mode 100644 index 0000000000..b9a3bb77fe --- /dev/null +++ b/templates/org/follow_unfollow.tmpl @@ -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> diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 2ca60cd1be..fd2326ffd5 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -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>