2023-07-12 15:23:13 +00:00
{{ if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
2023-07-10 15:53:15 +00:00
< div class = "post{{if .Post.Deleted}} deleted{{end}}{{ if or .Post.FeaturedCommunity .Post.FeaturedLocal }} distinguished{{end}}" >
2023-07-02 21:29:35 +00:00
{{ if gt .Rank 0 }}
2023-06-30 19:41:35 +00:00
< div class = "rank" > {{ .Rank }} < / div >
2023-07-02 21:29:35 +00:00
{{ end }}
< div class = "score" >
2023-06-30 19:41:35 +00:00
{{ end }}
2023-07-12 15:23:13 +00:00
{{ if or (ne .State.Op "save_post") (eq .State.Op "vote_post") }}
2023-06-30 19:41:35 +00:00
{{ if .State.Session }}
2023-07-10 15:53:15 +00:00
< form class = "link-btn {{ if lt .Rank 1 }}squish{{end}}{{ if eq .MyVote.String " 1 " } } like { { else if eq . MyVote . String " -1 " } } dislike { { end } } " method = "POST" >
2023-06-30 19:41:35 +00:00
< input type = "submit" name = "vote" value = "▲" >
{{ if .MyVote.IsValid}}
< input type = "hidden" name = "undo" value = "{{.MyVote.String}}" >
{{ end}}
< input type = "hidden" name = "op" value = "vote_post" >
< input type = "hidden" name = "postid" value = "{{.Post.ID }}" >
< div > {{ .Counts.Score }}< / div >
2023-07-02 21:29:35 +00:00
< input type = "submit" name = "vote" value = "▼" >
2023-06-30 19:41:35 +00:00
< / form >
{{ else }}
2023-07-06 15:20:35 +00:00
< div style = "margin-top: 19px;" > {{ .Counts.Score }}< / div >
2023-06-30 19:41:35 +00:00
{{ end }}
2023-07-12 15:23:13 +00:00
{{ end }}
{{ if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
2023-06-30 19:41:35 +00:00
< / div >
2023-07-09 02:33:49 +00:00
< div class = "thumb" >
< a class = "url" href = "{{ if .Post.URL.IsValid }}{{ .Post.URL }}{{ else }}/{{ .State.Host }}/post/{{ .Post.ID }}{{ end }}" >
< div { { if and . Post . NSFW ( not ( and . State . Community . State . Community . CommunityView . Community . NSFW ) ) } } class = "img-blur" { { end } } style = "background-image: url({{thumbnail .Post}})" > < / div >
< / a >
< / div >
2023-06-30 19:41:35 +00:00
< div class = "entry" >
< div class = "title" >
2023-07-05 15:22:46 +00:00
< a class = "url" href = "{{ if .Post.URL.IsValid }}{{ .Post.URL }}{{ else }}/{{ .State.Host }}/post/{{ .Post.ID }}{{ end }}" > {{ rmmarkdown .Post.Name }}< / a >
2023-07-02 21:29:35 +00:00
({{ domain . }})
2023-06-30 19:41:35 +00:00
< / div >
2023-07-04 02:43:16 +00:00
< div class = "expando-button {{ if and (not (and .Post.Body.IsValid .Post.Body.String )) (not (isImage .Post.URL.String)) }}hidden{{else if eq .Rank 0}}open{{ end }}" > < / div >
2023-06-30 19:41:35 +00:00
< div class = "meta" >
submitted
< span title = "{{.Post.Published.Time}}" > {{ humanize .Post.Published.Time -}}< / span >
{{- if gt .Post.Updated.Time.Unix .Post.Published.Time.Unix -}}
* (last edited < span title = "{{.Post.Updated.Time}}" > {{ humanize .Post.Updated.Time }}< / span > )
{{ end }}
by
< a href = "/{{ .State.Host }}/u/{{ fullname .Creator }}" > {{ fullname .Creator }}< / a >
to
2023-07-07 16:30:07 +00:00
< a href = "/{{ .State.Host }}/c/{{ fullcname .Community }}" > {{ fullcname .Community}}< / a >
2023-06-30 19:41:35 +00:00
< / div >
< div class = "buttons" >
2023-07-05 13:49:41 +00:00
{{ if .Post.NSFW }}< span class = "nsfw" > NSFW< / span > {{end}}
2023-06-30 19:41:35 +00:00
< a href = "/{{ .State.Host }}/post/{{ .Post.ID }}" > {{ .Counts.Comments }} comments< / a >
2023-07-05 13:49:41 +00:00
{{ if and .State.Session (eq .State.Session.UserID .Post.CreatorID) }}
2023-06-30 19:41:35 +00:00
{{ if not .Post.Deleted }}< a href = "/{{ .State.Host }}/post/{{ .Post.ID }}?edit" > edit< / a > {{end}}
< form class = "link-btn" method = "POST" >
< input type = "hidden" name = "postid" value = "{{.Post.ID }}" >
< input type = "hidden" name = "op" value = "delete_post" >
{{ if .Post.Deleted }}
< input type = "submit" value = "undelete" >
< input type = "hidden" name = "undo" value = "1" >
{{ else }}
< input type = "submit" value = "delete" >
{{ end }}
< / form >
2023-07-05 14:20:07 +00:00
{{ end}}
2023-07-12 15:23:13 +00:00
{{ end }}
{{ if or (ne .State.Op "vote_post") (eq .State.Op "save_post") }}
2023-07-05 14:20:07 +00:00
{{ if .State.Session }}
< form class = "link-btn" method = "POST" >
< input type = "hidden" name = "postid" value = "{{.Post.ID }}" >
< input type = "hidden" name = "op" value = "save_post" >
{{ if .PostView.Saved }}
< input type = "submit" name = "submit" value = "unsave" >
{{ else }}
< input type = "submit" name = "submit" value = "save" >
{{ end }}
< / form >
{{end}}
2023-07-12 15:23:13 +00:00
{{ end }}
{{ if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
2023-07-05 19:26:26 +00:00
{{ if .State.PostID }}
2023-07-10 15:53:15 +00:00
< a id = "hidechildren" class = "scripting" href = "" > hide all child comments< / a >
2023-07-05 19:26:26 +00:00
{{ end }}
2023-06-30 19:41:35 +00:00
< / div >
2023-07-07 16:30:07 +00:00
< / div >
< div > < / div >
< div class = "clearleft" > < / div >
2023-06-30 19:41:35 +00:00
< div class = "expando {{ if eq .Rank 0 }}open{{ end}}" >
{{ if (and .Post.Body.IsValid (ne .Post.Body.String "")) }}
2023-07-04 02:43:16 +00:00
< div class = "md" > {{ markdown .State.Host .Post.Body.String }}< / div >
2023-06-30 19:41:35 +00:00
{{ end }}
{{ if isImage .Post.URL.String}}
2023-07-05 20:20:34 +00:00
< div class = "image" style = "background-image: url({{.Post.URL}})" >
2023-06-30 19:41:35 +00:00
< img loading = "lazy" src = "{{ .Post.URL }}" >
2023-07-05 20:20:34 +00:00
< / div >
2023-06-30 19:41:35 +00:00
{{ end }}
2023-07-04 02:43:16 +00:00
< div class = "embed" > < / div >
2023-06-30 19:41:35 +00:00
< / div >
< / div >
2023-07-02 21:29:35 +00:00
{{ end }}