summaryrefslogtreecommitdiff
path: root/internal/templates/tags.gohtml
blob: 99794a7937bc01fc6ba4e5791f06d5d48f2174f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{{- /*gotype: mokhan.ca/xlgmokha/gitmal/internal/templates.TagsParams*/ -}}
{{- define "head" -}}
<style>
  .tags {
    border: 1px solid var(--c-border);
    border-radius: var(--border-radius);
    overflow: hidden;
  }
  .tag-row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    padding-inline: 16px;
    border-bottom: 1px solid var(--c-border);
    background-color: var(--c-bg-elv);
  }
  .tag-row:last-child {
    border-bottom: none;
  }
  .cell {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .tag-title {
    flex: 1;
  }
  .tag-row a {
    color: var(--c-text-1);
  }
  .tag-row a:hover {
    color: var(--c-brand-2);
    text-decoration: none;
  }
  .date {
    font-family: var(--font-family-mono), monospace;
    font-size: 12px;
    color: var(--c-text-2);
  }
  .hash a {
    font-family: var(--font-family-mono), monospace;
    color: var(--c-text-2);
  }
  .compare {
    min-width: 60px;
  }
  .compare a {
    font-size: 12px;
    color: var(--c-text-2);
  }
</style>
{{- end}}

{{- define "body" -}}
<h1>Tags</h1>
{{- if .UnreleasedHref}}
<p><a href="{{.UnreleasedHref}}">Unreleased changes</a></p>
{{- end}}
<div class="tags">
{{- if .Tags}}
{{- range .Tags}}
  <div class="tag-row">
    <div class="cell tag-title"><a href="commit/{{.CommitHash}}.html">{{.Name}}</a></div>
    <div class="cell date">{{.Date | FormatDate}}</div>
    <div class="cell hash"><a href="commit/{{.CommitHash}}.html">{{ShortHash .CommitHash}}</a></div>
    <div class="cell compare">{{if .CompareHref}}<a href="{{.CompareHref}}">compare</a>{{end}}</div>
  </div>
{{- end}}
{{- else}}
  <div class="tag-row">(no tags)</div>
{{- end}}
</div>
{{- end}}