mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-17 10:56:24 -07:00
Add filename to recentPost struct
This commit is contained in:
parent
cad707baf6
commit
0362645e2c
2 changed files with 3 additions and 1 deletions
|
@ -24,6 +24,7 @@ type recentPost struct {
|
|||
Board string
|
||||
URL string
|
||||
ThumbURL string
|
||||
Filename string
|
||||
FileDeleted bool
|
||||
MessageSample string
|
||||
}
|
||||
|
@ -81,6 +82,7 @@ func getRecentPosts() ([]recentPost, error) {
|
|||
Board: boardDir,
|
||||
URL: config.WebPath(boardDir, "res", topPostID+".html") + "#" + id,
|
||||
ThumbURL: config.WebPath(boardDir, "thumb", gcutil.GetThumbnailPath("post", filename)),
|
||||
Filename: filename,
|
||||
FileDeleted: filename == "deleted",
|
||||
MessageSample: message,
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<div id="recent-posts">
|
||||
{{- range $i, $post := $.recent_posts}}
|
||||
<div class="recent-post">
|
||||
{{if and (not $post.FileDeleted) (ne $post.ThumbURL "") -}}
|
||||
{{if and (not $post.FileDeleted) (ne $post.Filename "") -}}
|
||||
<a href="{{$post.URL}}" class="front-reply" target="_blank"><img src="{{$post.ThumbURL}}" alt="post thumbnail"/></a><br />
|
||||
{{else}}
|
||||
<div class="file-deleted-box" style="text-align:center; float:none;"><a href="{{$post.URL}}" class="front-reply" target="_blank">No file</a></div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue