feat: add date and id in post design

This commit is contained in:
Yanislav Igonin 2022-02-07 11:17:12 +02:00
parent a02884e6b5
commit 524b75e04d
2 changed files with 27 additions and 15 deletions

View File

@ -1,11 +1,16 @@
.post-container {
border: 1px solid rgba(0,0,0,.125);
border-radius: .25rem;
display: flex;
}
.post-info-container {
margin-bottom: 10px;
color: #6c757d;
}
.files-container {
display: flex;
margin-bottom: 10px;
}
.file-container {

View File

@ -1,20 +1,27 @@
{{ define "post" }}
<div class="post-container mb-4">
{{ $filesLength := len .Files }}
{{ if gt $filesLength 0 }}
<div class="files-container">
{{ range $File := .Files }}
<div class="file-container">
<a href="/uploads/{{$.GetThreadID}}/o/{{$File.ID}}.{{$File.Ext}}" target="blank">
<img src="/uploads/{{$.GetThreadID}}/t/{{$File.ID}}.{{$File.Ext}}" class="file" alt="Uploaded picture">
</a>
</div>
{{ end }}
</div>
{{ end }}
<div class="p-2">
<p class="card-text line-break text-break">{{.Text}}</p>
<div class="post-info-container">
<span>{{ .CreatedAt.Format "Jan 02, 2006 15:04:05" }}</span>
<span>#{{ .ID }}</span>
</div>
<div class="post-body-container">
{{ $filesLength := len .Files }}
{{ if gt $filesLength 0 }}
<div class="files-container">
{{ range $File := .Files }}
<div class="file-container">
<a href="/uploads/{{$.GetThreadID}}/o/{{$File.ID}}.{{$File.Ext}}" target="blank">
<img src="/uploads/{{$.GetThreadID}}/t/{{$File.ID}}.{{$File.Ext}}" class="file" alt="Uploaded picture">
</a>
</div>
{{ end }}
</div>
{{ end }}
<p class="card-text line-break text-break">{{.Text}}</p>
</div>
</div>
</div>
{{ end }}