2025-01-28 04:19:08 +00:00
|
|
|
{{ define "item-buttons" -}}
|
2025-01-28 03:35:13 +00:00
|
|
|
<button class="item-button" title="Deactivate {{ .Source }}/{{ .Id }}">✕</button>
|
|
|
|
<button class="item-button" title="Punt {{ .Source }}/{{ .Id }}">↷</button>
|
|
|
|
{{- if .Link }}<a class="item-link" href="{{ .Link }}" target="_blank">⇗</a>
|
|
|
|
{{ end -}}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "item-title" -}}
|
|
|
|
<span class="item-title">{{ or .Title .Id | raw }}</span>
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "item" -}}
|
|
|
|
<article id="{{ .Source }}-{{ .Id }}">
|
|
|
|
|
2025-01-28 04:19:08 +00:00
|
|
|
{{- /* The item title is a clickable <summary> if there is body content */ -}}
|
2025-01-28 03:35:13 +00:00
|
|
|
{{ if .Body }}
|
|
|
|
<details>
|
|
|
|
<summary>
|
2025-01-28 04:19:08 +00:00
|
|
|
{{ template "item-buttons" . }}
|
2025-01-28 03:35:13 +00:00
|
|
|
{{ template "item-title" . }}
|
|
|
|
</summary>
|
|
|
|
{{ if .Body }}
|
|
|
|
<p>{{ raw .Body }}</p>
|
|
|
|
{{ end }}
|
|
|
|
</details>
|
2025-01-28 04:19:08 +00:00
|
|
|
{{ template "item-buttons" . }}
|
|
|
|
{{- else -}}
|
|
|
|
{{ template "item-buttons" . }}
|
2025-01-28 03:35:13 +00:00
|
|
|
{{ template "item-title" . }}<br>
|
|
|
|
{{ end }}
|
2025-01-28 04:19:08 +00:00
|
|
|
{{- /* end if .Body */ -}}
|
2025-01-28 03:35:13 +00:00
|
|
|
|
2025-01-28 04:19:08 +00:00
|
|
|
{{- /* author/time footer line */ -}}
|
2025-01-28 03:35:13 +00:00
|
|
|
{{ if or .Author .Time }}
|
|
|
|
<span class="item-info">
|
|
|
|
{{ .Author }}
|
|
|
|
{{ .Time | tsToDate }}
|
|
|
|
</span><br>
|
2025-01-28 04:19:08 +00:00
|
|
|
{{ end -}}
|
2025-01-28 03:35:13 +00:00
|
|
|
|
2025-01-28 04:19:08 +00:00
|
|
|
{{- /* source/id/created footer line */ -}}
|
2025-01-28 03:35:13 +00:00
|
|
|
<span class="item-info">
|
2025-01-28 04:19:08 +00:00
|
|
|
<a href="/item/{{ .Source }}/{{ .Id }}">{{ .Source }}/{{ .Id }}</a>
|
2025-01-28 03:35:13 +00:00
|
|
|
{{ .Created | tsToDate }}
|
|
|
|
</span>
|
|
|
|
</article>
|
2025-01-28 04:19:08 +00:00
|
|
|
{{ end -}}
|
|
|
|
{{- /* end define "item" */ -}}
|