hmn/src/templates/src/include/post_list_item.html

30 lines
1.1 KiB
HTML

{{/*
This template is intended to display a single post in the context of a forum, the feed, or a similar layout.
It should be called with PostListItem.
*/}}
<div class="post-list-item flex items-center ph3 pv2 {{ if .Unread }}unread{{ else }}read{{ end }} {{ .Classes }}">
<img class="avatar-icon mr2" src="{{ .User.AvatarUrl }}">
<div class="flex-grow-1 overflow-hidden">
<div class="breadcrumbs">
{{ range $i, $breadcrumb := .Breadcrumbs }}
{{ if gt $i 0 }} » {{ end }}
<a href="{{ $breadcrumb.Url }}">{{ $breadcrumb.Name }}</a>
{{ end }}
</div>
<div class="title nowrap truncate"><a href="{{ .Url }}">{{ .Title }}</a></div>
<div class="details">
<a class="user" href="{{ .User.ProfileUrl }}">{{ .User.Name }}</a> &mdash; {{ timehtml (relativedate .Date) .Date }}
</div>
{{ with .Content }}
<div class="mt2">
{{ . }}
</div>
{{ end }}
</div>
<div class="goto">
<a href="{{ .Url }}">&raquo;</a>
</div>
</div>