mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	| @@ -161,6 +161,14 @@ type Repository struct { | ||||
| 	IsMirror bool | ||||
| 	*Mirror  `xorm:"-"` | ||||
|  | ||||
| 	// Advanced settings | ||||
| 	EnableWiki            bool `xorm:"NOT NULL DEFAULT true"` | ||||
| 	EnableIssues          bool `xorm:"NOT NULL DEFAULT true"` | ||||
| 	EnableExternalTracker bool | ||||
| 	ExternalTrackerFormat string | ||||
| 	ExternalMetas         map[string]string `xorm:"-"` | ||||
| 	EnablePulls           bool              `xorm:"NOT NULL DEFAULT true"` | ||||
|  | ||||
| 	IsFork   bool `xorm:"NOT NULL DEFAULT false"` | ||||
| 	ForkID   int64 | ||||
| 	BaseRepo *Repository `xorm:"-"` | ||||
| @@ -214,6 +222,20 @@ func (repo *Repository) MustOwner() *User { | ||||
| 	return repo.mustOwner(x) | ||||
| } | ||||
|  | ||||
| // ComposeMetas composes a map of metas for rendering external issue tracker URL. | ||||
| func (repo *Repository) ComposeMetas() map[string]string { | ||||
| 	if !repo.EnableExternalTracker { | ||||
| 		return nil | ||||
| 	} else if repo.ExternalMetas == nil { | ||||
| 		repo.ExternalMetas = map[string]string{ | ||||
| 			"format": repo.ExternalTrackerFormat, | ||||
| 			"user":   repo.MustOwner().Name, | ||||
| 			"repo":   repo.Name, | ||||
| 		} | ||||
| 	} | ||||
| 	return repo.ExternalMetas | ||||
| } | ||||
|  | ||||
| // GetAssignees returns all users that have write access of repository. | ||||
| func (repo *Repository) GetAssignees() (_ []*User, err error) { | ||||
| 	if err = repo.GetOwner(); err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user