0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-05 22:54:55 +02:00

add GroupLink method to Group struct

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2024-12-27 21:56:51 -05:00
parent 2ffbc4d2c0
commit 2760a0e29f
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C

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() {