micrach/templates/thread.html
2021-09-10 19:16:53 +03:00

43 lines
1007 B
HTML

{{$FirstPost:= index . 0}}
<html lang="en">
<head>
{{ template "static" }}
{{ template "meta" $FirstPost }}
</head>
<body>
<h1 class="display-1 text-center">Welcome to Micrach</h1>
<div class="container">
{{ template "post-form" $FirstPost.ID }}
<div class="row row-cols-auto gy-4">
{{range $Post := .}}
<div class="col col-sm-6 col-md-4 col-lg-3">
<div class="card">
{{ $length := len $Post.Files }} {{ if gt $length 0 }}
{{$FirstFile := index $Post.Files 0}}
<img
src="/uploads/{{$Post.ID}}/{{$FirstFile.Name}}"
class="card-img-top"
alt="Uploaded picture"
>
{{end}}
<div class="card-body">
{{ if ne $Post.Title "" }}
<h5 class="card-title">{{$Post.Title}}</h5>
{{ end }}
<p class="card-text">{{$Post.Text}}</p>
</div>
</div>
</div>
{{end}}
</div>
</div>
</body>
</html>