micrach/templates/components/thread-card.html
2022-02-02 15:03:40 +02:00

18 lines
574 B
HTML

{{ define "thread-card" }}
<div class="col col-sm-6 col-md-4 col-lg-3">
<div class="card">
{{ $length := len .Files }}
{{ if gt $length 0 }}
{{ $FirstFile := index .Files 0 }}
<img src="/uploads/{{.ID}}/t/{{$FirstFile.ID}}.{{$FirstFile.Ext}}" class="card-img-top" alt="Uploaded picture">
{{ end }}
<div class="card-body">
{{ template "thread-card-title" .Title }}
{{ template "thread-card-text" .Text }}
<a href="/{{.ID}}" class="btn btn-outline-primary">Open</a>
</div>
</div>
</div>
{{ end }}