diff --git a/issues.go b/issues.go index ce0f0c4..055b720 100644 --- a/issues.go +++ b/issues.go @@ -36,7 +36,7 @@ type Issue struct { Category KeyVal TargetVersion KeyVal `json:"target_version"` Reporter KeyVal - handler KeyVal + Handler KeyVal Status KeyVal Resolution KeyVal ViewState KeyVal `json:"view_state"` @@ -103,6 +103,15 @@ func (b ByCategory) Less(i, j int) bool { } func (b ByCategory) Swap(i, j int) { b[i], b[j] = b[j], b[i] } +type ByAssignment []Issue + +func (b ByAssignment) Len() int { return len(b) } +func (b ByAssignment) Less(i, j int) bool { + return strings.Compare(b[i].Handler.Name, b[j].Handler.Name) < 0 +} +func (b ByAssignment) Swap(i, j int) { b[i], b[j] = b[j], b[i] } + + type ById []Issue func (b ById) Len() int { return len(b) } @@ -117,6 +126,19 @@ func (b ByTarget) Less(i, j int) bool { } func (b ByTarget) Swap(i, j int) { b[i], b[j] = b[j], b[i] } +type ByHandlerAndId []Issue + +func (b ByHandlerAndId) Len() int { return len(b) } +func (b ByHandlerAndId) Less(i, j int) bool { + if (b[i].Handler.Name == "") == (b[j].Handler.Name == "") { + return b[i].Id < b[j].Id + } else if b[i].Handler.Name == "" { + return true + } + return false +} +func (b ByHandlerAndId) Swap(i, j int) { b[i], b[j] = b[j], b[i] } + func (i Issues) Tags() (tags []string) { var m = map[string]bool{} for _, issue := range i { @@ -131,6 +153,19 @@ func (i Issues) Tags() (tags []string) { return } +func (is Issues) Assigned(assigned bool) (n int) { + for _, i := range is { + if assigned == (i.Handler.Name != "") { + n += 1 + } + } + return n +} + +func (i *Issue) IsHandled() bool { + return i.Handler.Name != "" +} + func (i Issues) TargetVersions() (targets []string) { var m = map[string]bool{} for _, issue := range i { @@ -164,7 +199,7 @@ func (i Issues) ByCategory(cat string) (issues Issues) { issues = append(issues, issue) } } - sort.Sort(ById(issues)) + sort.Sort(sort.Reverse(ByHandlerAndId(issues))) return issues } @@ -175,6 +210,6 @@ func (i Issues) ByCategoryAndTarget(cat, tar string) (issues Issues) { issues = append(issues, is) } } - sort.Sort(ById(issues)) + sort.Sort(sort.Reverse(ByHandlerAndId(issues))) return } diff --git a/list.tmpl b/list.tmpl index f73c441..79c25b9 100644 --- a/list.tmpl +++ b/list.tmpl @@ -42,14 +42,18 @@ pre {
{{ .Description }}
{{ .Description }}
- {{- range $vname := $top.TargetVersions }} - {{- with $version := $versions.Get . }} - |
-
-
- {{ $vname }} ({{ $version.Timestamp.Format "02 Jan 06"}})-{{ $version.Description }}
- |
- {{- end}}
- {{- end}}
-
---|---|
{{ . }} | - {{- range $tar := $top.TargetVersions }} - {{- with $version := $versions.Get . }} -{{ with $features.ByCategoryAndTarget $cat $tar }}
-
-
- {{- end }}
- {{- with $issues.ByCategoryAndTarget $cat $tar }}
- {{ $l := len .}}{{ if lt 1 $l }}{{ $l }} features{{ else }}1 feature{{ end }}- {{- range . }} - {{.Id}} {{.Summary}}- {{- end}} -
-
- {{ end -}}
- {{ $l := len .}}{{ if lt 1 $l }}{{ $l }} issues{{ else }}1 issue{{ end }}- {{- range . }} - {{.Id}} {{.Summary}}{{end}} - | {{ end }}
- {{ end }}
-
- taler-dashboard - version: {{.Commit}} - https://git.kesim.org/taler/taler-dashboard - +
++ {{- range $vname := $top.TargetVersions }} + {{- with $version := $versions.Get . }} + |
+
+
+ {{ $vname }} ({{ $version.Timestamp.Format "02 Jan 06"}})+{{ $version.Description }}
+ |
+ {{- end}}
+ {{- end}}
+
---|---|
{{ . }} | + {{- range $tar := $top.TargetVersions }} + {{- with $version := $versions.Get . }} +{{ with $features.ByCategoryAndTarget $cat $tar }}
+
+
+ {{- end }}
+ {{- with $issues.ByCategoryAndTarget $cat $tar }}
+ {{ $l := len .}}{{ if lt 1 $l }}{{ $l }} features{{ else }}1 feature{{ end }} + {{- $unassigned := .Assigned false }}{{if gt $unassigned 0 }} ({{ $unassigned}} unassigned){{ end -}} ++ {{- range . }} + {{ if .IsHandled }}🥷{{else}}❓{{end}} + {{.Id}} {{.Summary}}+ {{- end}} +
+
+ {{ end -}}
+ {{ $l := len .}}{{ if lt 1 $l }}{{ $l }} issues{{ else }}1 issue{{ end }} + {{- $unassigned := .Assigned false }}{{if gt $unassigned 0 }} ({{ $unassigned}} unassigned){{ end -}} ++ {{- range . }} + {{ if .IsHandled }}🥷{{else}}❓{{end}} + {{.Id}} {{.Summary}}{{end}} + | {{ end }}
+ {{ end }}
+
+ taler-dashboard - version: {{.Commit}} - https://git.kesim.org/taler/taler-dashboard +