add GroupLink method to Group struct

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ committed 2026-04-02 20:00:44 -04:00
1 parent 2ffbc4d2c0
commit 2760a0e29f
1 file changed
+7
+7
View File
@@ -10,6 +10,8 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"net/url"
"strconv"
"xorm.io/builder" "xorm.io/builder"
) )
@@ -32,6 +34,11 @@ type Group struct {
Subgroups GroupList `xorm:"-"` Subgroups GroupList `xorm:"-"`
} }
// GroupLink returns the link to this group
func (g *Group) GroupLink() string {
return setting.AppSubURL + "/" + url.PathEscape(g.OwnerName) + "/groups/" + strconv.FormatInt(g.ID, 10)
}
func (Group) TableName() string { return "repo_group" } func (Group) TableName() string { return "repo_group" }
func init() { func init() {