aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data.go6
-rw-r--r--table.tmpl17
2 files changed, 13 insertions, 10 deletions
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 -}}
<!--p>
{{- range $top.Tags -}}<button>{{ . }}</button>{{- end -}}
</p-->
<table>
<tr>
<th class="side"></th>
- {{- range $vname := $top.TargetVersions }}
- {{- with $version := $versions.Get . }}
+ {{- range $version := $versions }}
<th>
<details class="version">
- <summary><b>{{ $vname }}</b> <span class="right">({{ $version.Timestamp.Format "02 Jan 06"}})</span></summary>
+ <summary><b>{{ $version.Name }}</b> <span class="right">({{ $version.Timestamp.Format "02 Jan 06"}})</span></summary>
<div>{{ $version.Description }}</div>
</details>
</th>
{{- end}}
- {{- end}}
</tr>
{{- range $cat := $top.Categories }}
<tr>
<th class="side">{{ . }}</th>
- {{- range $tar := $top.TargetVersions }}
- {{- with $version := $versions.Get . }}
- <td><div class="minh">{{ with $features.ByCategoryAndTarget $cat $tar }}
+ {{- range $version := $versions }}
+ <td><div class="minh">{{ with $features.ByCategoryAndTarget $cat $version.Name }}
<details class="feature">
<summary>
<div>{{ $l := len .}}{{ if lt 1 $l }}{{ $l }} features{{ else }}1 feature{{ end }}</div>
@@ -133,7 +130,7 @@ details[open].issue {
{{- end}}
</details>
{{- end }}
- {{- with $issues.ByCategoryAndTarget $cat $tar }}
+ {{- with $issues.ByCategoryAndTarget $cat $version.Name }}
<details class="issue">
<summary>
<div>{{ $l := len .}}{{ if lt 1 $l }}{{ $l }} issues{{ else }}1 issue{{ end }}</div>
@@ -147,7 +144,7 @@ details[open].issue {
{{- end}}
</details>
{{ end -}}
- </div></td>{{ end }}
+ </div></td>
{{ end }}
</tr>
{{- end}}