From e2312b96321a0d4940eac70e9f7248b7b7e4d642 Mon Sep 17 00:00:00 2001
From: Elliott Stoneham
" + data
}
}
payload.Issues = raw
- if len(c.Lists) > 0 {
- for _, v := range c.Lists {
- if v.Included {
- payload.ShowList = true
- break
+ if strings.TrimSpace(c.IssuesText) != "" {
+ payload.ShowIssueNumbers = true
+ payload.DateMessage = c.IssuesText
+ } else {
+ if len(c.Lists) > 0 {
+ for _, v := range c.Lists {
+ if v.Included {
+ payload.ShowList = true
+ break
+ }
}
+ payload.List = c.Lists
}
- payload.List = c.Lists
}
default: // to handle legacy data, this handles commits
@@ -702,7 +707,7 @@ func (p *Provider) Render(config, data string) string {
if err != nil {
log.Error("unable to unmarshall github commit data", err)
- return "Documize internal github json umarshall data error: " + err.Error()
+ return "Documize internal github json umarshall data error: " + err.Error() + "
" + data
}
c.ReportInfo.ID = "commits_data"
payload.BranchCommits = raw
diff --git a/documize/section/github/model.go b/documize/section/github/model.go
index a60f3756..2c9aa34a 100644
--- a/documize/section/github/model.go
+++ b/documize/section/github/model.go
@@ -20,13 +20,14 @@ import (
)
type githubRender struct {
- Config githubConfig
- Repo githubRepo
- List []githubBranch
- ShowList bool
- BranchCommits []githubBranchCommits
- CommitCount int
- Issues []githubIssue
+ Config githubConfig
+ Repo githubRepo
+ List []githubBranch
+ ShowList bool
+ ShowIssueNumbers bool
+ BranchCommits []githubBranchCommits
+ CommitCount int
+ Issues []githubIssue
//IssueNum int
//IssueNumActivity []githubIssueActivity
Limit int
@@ -76,9 +77,12 @@ var renderTemplates = map[string]string{
{{$label.Name}}
{{end}}
{{end}}
+ {{end}};
+ {{if .ShowIssueNumbers}}
+ issue(s) {{ .DateMessage }}.
+ {{else}}
+ up to {{ .Limit }} items are shown{{ .DateMessage }}.
{{end}}
- .
- Up to {{ .Limit }} items are shown{{ .DateMessage }}.