micrach/templates/thread.html

57 lines
1.3 KiB
HTML
Raw Normal View History

2021-09-11 14:59:16 +03:00
{{ $FirstPost:= index . 0 }}
2021-09-05 00:36:55 +03:00
<html lang="en">
<head>
2021-09-05 15:38:08 +03:00
{{ template "static" }}
{{ template "meta" $FirstPost }}
2021-09-12 00:30:48 +03:00
<link
href="/static/post.css"
rel="stylesheet"
>
2021-09-05 00:36:55 +03:00
</head>
<body>
2021-09-12 00:30:48 +03:00
<h1 class="display-1 text-center">
{{ if ne $FirstPost.Title "" }}
{{$FirstPost.Title}}
{{ else }}
Welcome to Micrach
{{ end }}
</h1>
2021-09-05 00:36:55 +03:00
<div class="container">
{{ template "post-form" $FirstPost.ID }}
2021-09-05 00:36:55 +03:00
2021-09-12 00:30:48 +03:00
<div id="postsСontainer">
2021-09-05 00:36:55 +03:00
{{range $Post := .}}
2021-09-12 00:30:48 +03:00
<div class="post-container mb-4">
2021-09-05 00:36:55 +03:00
2021-09-12 00:30:48 +03:00
{{ $filesLength := len $Post.Files }}
{{ if gt $filesLength 0 }}
<div class="files-container">
{{ range $File := $Post.Files }}
<div class="file-container">
<a href="/uploads/{{$FirstPost.ID}}/{{$File.ID}}.{{$File.Ext}}" target="blank">
<img
src="/uploads/{{$FirstPost.ID}}/{{$File.ID}}.{{$File.Ext}}"
class="file"
alt="Uploaded picture"
>
</a>
</div>
2021-09-10 19:16:53 +03:00
{{ end }}
2021-09-12 00:30:48 +03:00
</div>
{{ end }}
<div class="data-container p-2">
2021-09-05 00:36:55 +03:00
<p class="card-text">{{$Post.Text}}</p>
</div>
2021-09-12 00:30:48 +03:00
2021-09-05 00:36:55 +03:00
</div>
{{end}}
</div>
</div>
</body>
</html>