aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2024-02-17 15:42:52 +0200
committerGitHub <noreply@github.com>2024-02-17 13:42:52 +0000
commitaa6f88638fb827d5c5ed7506e5fc06dad92beea7 (patch)
tree30fa94c475ea66090f76be438c144ba576b85ecd
parentb96fbb567c67b2e1580396cd5326003a0a8da799 (diff)
downloadgitea-aa6f88638fb827d5c5ed7506e5fc06dad92beea7.tar.gz
gitea-aa6f88638fb827d5c5ed7506e5fc06dad92beea7.zip
Fix missing template for follow button in organization (#29215)
Leftover from https://github.com/go-gitea/gitea/pull/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 <git@yardenshoham.com>
-rw-r--r--routers/web/user/profile.go2
-rw-r--r--templates/org/follow_unfollow.tmpl7
-rw-r--r--templates/org/home.tmpl8
3 files changed, 9 insertions, 8 deletions
diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go
index e7f133e981..37ce450530 100644
--- a/routers/web/user/profile.go
+++ b/routers/web/user/profile.go
@@ -29,7 +29,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 322be3271d..81a76d3b4d 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -26,13 +26,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>