mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 21:07:06 +02:00
add GroupLink method to Group struct
This commit is contained in:
1 parent
2ffbc4d2c0
commit
2760a0e29f
1 file changed
+7
@@ -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() {
|
||||||
|
|||||||
Reference in new issue
Block a user