diff --git a/models/issues/issue.go b/models/issues/issue.go index 8655b9de3f..b0ff0adddd 100644 --- a/models/issues/issue.go +++ b/models/issues/issue.go @@ -142,22 +142,14 @@ type Issue struct { } var ( - issueTasksPat *regexp.Regexp - issueTasksDonePat *regexp.Regexp -) - -const ( - issueTasksRegexpStr = `(^\s*[-*]\s\[[\sxX]\]\s.)|(\n\s*[-*]\s\[[\sxX]\]\s.)` - issueTasksDoneRegexpStr = `(^\s*[-*]\s\[[xX]\]\s.)|(\n\s*[-*]\s\[[xX]\]\s.)` + issueTasksPat = regexp.MustCompile(`(^\s*[-*]\s\[[\sxX]\]\s.)|(\n\s*[-*]\s\[[\sxX]\]\s.)`) + issueTasksDonePat = regexp.MustCompile(`(^\s*[-*]\s\[[xX]\]\s.)|(\n\s*[-*]\s\[[xX]\]\s.)`) ) // IssueIndex represents the issue index table type IssueIndex db.ResourceIndex func init() { - issueTasksPat = regexp.MustCompile(issueTasksRegexpStr) - issueTasksDonePat = regexp.MustCompile(issueTasksDoneRegexpStr) - db.RegisterModel(new(Issue)) db.RegisterModel(new(IssueIndex)) } diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl index 05b7dbaabc..3cc853b351 100644 --- a/templates/repo/issue/card.tmpl +++ b/templates/repo/issue/card.tmpl @@ -49,6 +49,13 @@ {{end}} {{end}} + {{$tasks := .GetTasks}} + {{if gt $tasks 0}} +
+ {{end}} {{if or .Labels .Assignees}}