add GroupLink method to Group struct

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧
2026-04-02 20:00:44 -04:00
parent 2ffbc4d2c0
commit 2760a0e29f
+7
View File
@@ -10,6 +10,8 @@ import (
"context"
"errors"
"fmt"
"net/url"
"strconv"
"xorm.io/builder"
)
@@ -32,6 +34,11 @@ type Group struct {
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 init() {