mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	new create webhook UI
This commit is contained in:
		@@ -26,6 +26,27 @@ import (
 | 
			
		||||
	"github.com/gogits/gogs/modules/setting"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type RepoContext struct {
 | 
			
		||||
	AccessMode   models.AccessMode
 | 
			
		||||
	IsWatching   bool
 | 
			
		||||
	IsBranch     bool
 | 
			
		||||
	IsTag        bool
 | 
			
		||||
	IsCommit     bool
 | 
			
		||||
	Repository   *models.Repository
 | 
			
		||||
	Owner        *models.User
 | 
			
		||||
	Commit       *git.Commit
 | 
			
		||||
	Tag          *git.Tag
 | 
			
		||||
	GitRepo      *git.Repository
 | 
			
		||||
	BranchName   string
 | 
			
		||||
	TagName      string
 | 
			
		||||
	TreeName     string
 | 
			
		||||
	CommitId     string
 | 
			
		||||
	RepoLink     string
 | 
			
		||||
	CloneLink    models.CloneLink
 | 
			
		||||
	CommitsCount int
 | 
			
		||||
	Mirror       *models.Mirror
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Context represents context of a request.
 | 
			
		||||
type Context struct {
 | 
			
		||||
	*macaron.Context
 | 
			
		||||
@@ -51,27 +72,6 @@ type Context struct {
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type RepoContext struct {
 | 
			
		||||
	AccessMode   models.AccessMode
 | 
			
		||||
	IsWatching   bool
 | 
			
		||||
	IsBranch     bool
 | 
			
		||||
	IsTag        bool
 | 
			
		||||
	IsCommit     bool
 | 
			
		||||
	Repository   *models.Repository
 | 
			
		||||
	Owner        *models.User
 | 
			
		||||
	Commit       *git.Commit
 | 
			
		||||
	Tag          *git.Tag
 | 
			
		||||
	GitRepo      *git.Repository
 | 
			
		||||
	BranchName   string
 | 
			
		||||
	TagName      string
 | 
			
		||||
	TreeName     string
 | 
			
		||||
	CommitId     string
 | 
			
		||||
	RepoLink     string
 | 
			
		||||
	CloneLink    models.CloneLink
 | 
			
		||||
	CommitsCount int
 | 
			
		||||
	Mirror       *models.Mirror
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsOwner returns true if current user is the owner of repository.
 | 
			
		||||
func (r RepoContext) IsOwner() bool {
 | 
			
		||||
	return r.AccessMode >= models.ACCESS_MODE_OWNER
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user