Finish new edit team page, add member to team

This commit is contained in:
Unknwon 2014-08-24 21:09:05 +08:00
parent e325c8499a
commit 21a1b8e5a3
24 changed files with 710 additions and 84 deletions

View file

@ -54,7 +54,8 @@ type User struct {
LoginSource int64 `xorm:"not null default 0"`
LoginName string
Type UserType
Orgs []*User `xorm:"-"`
Orgs []*User `xorm:"-"`
Repos []*Repository `xorm:"-"`
NumFollowers int
NumFollowings int
NumStars int
@ -143,6 +144,12 @@ func (u *User) GetOrganizationCount() (int64, error) {
return x.Where("uid=?", u.Id).Count(new(OrgUser))
}
// GetRepositories returns all repositories that user owns, including private repositories.
func (u *User) GetRepositories() (err error) {
u.Repos, err = GetRepositories(u.Id, true)
return err
}
// GetOrganizations returns all organizations that user belongs to.
func (u *User) GetOrganizations() error {
ous, err := GetOrgUsersByUserId(u.Id)