diff options
Diffstat (limited to 'modules/structs/issue.go')
-rw-r--r-- | modules/structs/issue.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/structs/issue.go b/modules/structs/issue.go index dc633dedce..54b0f31d8a 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -5,6 +5,7 @@ package structs import ( + "strings" "time" ) @@ -119,3 +120,19 @@ type IssueDeadline struct { // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` } + +// IssueTemplate represents an issue template for a repository +// swagger:model +type IssueTemplate struct { + Name string `json:"name" yaml:"name"` + Title string `json:"title" yaml:"title"` + About string `json:"about" yaml:"about"` + Labels []string `json:"labels" yaml:"labels"` + Content string `json:"content" yaml:"-"` + FileName string `json:"file_name" yaml:"-"` +} + +// Valid checks whether an IssueTemplate is considered valid, e.g. at least name and about +func (it IssueTemplate) Valid() bool { + return strings.TrimSpace(it.Name) != "" && strings.TrimSpace(it.About) != "" +} |