diff --git a/data.go b/data.go index 944d89b..24c1fce 100644 --- a/data.go +++ b/data.go @@ -63,6 +63,7 @@ func NewData(ctx context.Context, url, token string, num int) *Data { } funcMap := map[string]any{ "OrderedBy": OrderedBy, + "Reverse": sort.Reverse, } data.tmpl = template.Must(template.New("index").Funcs(funcMap).ParseFS(content, "*.tmpl")) @@ -284,6 +285,11 @@ func (d *Data) VersionsByDate() VersionsByDate { return VersionsByDate(d.Project.Versions) } +func (d VersionsByDate) Sort() VersionsByDate { + sort.Sort(d) + return d +} + func (d *Data) Categories() (cs []string) { d.mux.RLock() defer d.mux.RUnlock() diff --git a/table.tmpl b/table.tmpl index cffda85..17dddc7 100644 --- a/table.tmpl +++ b/table.tmpl @@ -91,30 +91,27 @@ details[open].issue { {{- $top := . -}} {{- $features := .Features -}} {{- $issues := .Issues -}} - {{- $versions := .VersionsByDate -}} + {{- $versions := .VersionsByDate.Sort -}}
- {{- range $vname := $top.TargetVersions }} - {{- with $version := $versions.Get . }} + {{- range $version := $versions }} |
-
{{ $vname }} ({{ $version.Timestamp.Format "02 Jan 06"}})+{{ $version.Name }} ({{ $version.Timestamp.Format "02 Jan 06"}}){{ $version.Description }}
|
{{- end}}
- {{- end}}
|
---|---|---|
{{ . }} | - {{- range $tar := $top.TargetVersions }} - {{- with $version := $versions.Get . }} -{{ with $features.ByCategoryAndTarget $cat $tar }}
+ {{- range $version := $versions }}
+ | {{ end }}
+ {{ with $features.ByCategoryAndTarget $cat $version.Name }}
|
{{ end }}