]> source.dussan.org Git - gitea.git/commitdiff
Fix missing template for follow button in organization (#29215)
authorYarden Shoham <git@yardenshoham.com>
Sat, 17 Feb 2024 13:42:52 +0000 (15:42 +0200)
committerGitHub <noreply@github.com>
Sat, 17 Feb 2024 13:42:52 +0000 (13:42 +0000)
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>
routers/web/user/profile.go
templates/org/follow_unfollow.tmpl [new file with mode: 0644]
templates/org/home.tmpl

index e7f133e98161e9a09e65d0bdce97c6d6f645b4d4..37ce450530452e8fff356ce827c171557df07e95 100644 (file)
@@ -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 (file)
index 0000000..b9a3bb7
--- /dev/null
@@ -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>
index 322be3271d3e4805361774bc6dba3bd2188b3396..81a76d3b4d4515a0fdf52f1e908fec0eed418f4a 100644 (file)
                        </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>