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:
parent
2ffbc4d2c0
commit
2760a0e29f
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user