mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
fix: access to thread id in post template
This commit is contained in:
parent
6280a5fc9f
commit
f4c2f9262e
@ -19,7 +19,7 @@ type Post struct {
|
|||||||
UpdatedAt time.Time `json:"-"`
|
UpdatedAt time.Time `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Post) getThreadID() int {
|
func (p Post) GetThreadID() int {
|
||||||
if p.IsParent {
|
if p.IsParent {
|
||||||
return p.ID
|
return p.ID
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<div class="files-container">
|
<div class="files-container">
|
||||||
{{ range $File := .Files }}
|
{{ range $File := .Files }}
|
||||||
<div class="file-container">
|
<div class="file-container">
|
||||||
<a href="/uploads/{{.getThreadID}}/o/{{$File.ID}}.{{$File.Ext}}" target="blank">
|
<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">
|
<img src="/uploads/{{$.GetThreadID}}/t/{{$File.ID}}.{{$File.Ext}}" class="file" alt="Uploaded picture">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user