2024-05-12 04:09:05 +00:00
{{- if and (ne .State.Op "vote_post") (ne .State.Op "save_post") -}}
2024-06-21 21:21:42 +00:00
< div class = "post{{if .Post.Deleted}} deleted{{end}}{{ if .Post.FeaturedCommunity }} distinguished{{end}}{{if .Post.FeaturedLocal }} announcement{{end}}{{ if and (eq .Rank 0) (.State.CollapseMedia) }} collapse{{end}}" id = "p{{.Post.ID}}" >
2024-05-12 04:09:05 +00:00
{{- if gt .Rank 0 }}
2023-06-30 19:41:35 +00:00
< div class = "rank" > {{ .Rank }} < / div >
2024-05-12 04:09:05 +00:00
{{- end }}
2024-06-03 15:00:46 +00:00
< div class = "p" >
2024-05-12 04:09:05 +00:00
< div class = "score" >
{{- end }}
{{- if or (ne .State.Op "save_post") (eq .State.Op "vote_post") }}
{{- 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 = "▲" >
2024-05-12 04:09:05 +00:00
{{- if .MyVote.IsValid}}
2023-06-30 19:41:35 +00:00
< 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 >
2024-05-12 04:09:05 +00:00
{{- else }}
2024-06-03 15:00:46 +00:00
< div > < div > {{ .Counts.Score }}< / div > < / div >
2024-05-12 04:09:05 +00:00
{{- end }}
{{- end }}
{{- if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
2023-06-30 19:41:35 +00:00
< / div >
2023-08-08 21:26:30 +00:00
{{ if not .State.HideThumbnails }}
2023-07-09 02:33:49 +00:00
< div class = "thumb" >
2024-05-12 04:09:05 +00:00
< a class = "url" href = "{{ if .Post.URL.IsValid }}{{ .Post.URL }}{{ else }}/{{ .State.Host }}/post/{{ .Post.ID }}{{ end }}"
{{- if .State.LinksInNewWindow }} target="_blank" {{ 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 >
2023-07-09 02:33:49 +00:00
< / a >
< / div >
2023-08-08 21:26:30 +00:00
{{ end }}
2024-04-28 15:41:14 +00:00
< div class = "title{{ if .Read}} visited{{end}}" >
2024-05-12 04:09:05 +00:00
< a class = "url" href = "{{ if .Post.URL.IsValid }}{{ .Post.URL }}{{ else }}/{{ .State.Host }}/post/{{ .Post.ID }}{{ end }}"
{{- if .State.LinksInNewWindow }} target="_blank" {{ end }}>
{{ rmmarkdown .Post.Name }}
2023-09-14 19:40:32 +00:00
< / a >
2023-07-02 21:29:35 +00:00
({{ domain . }})
2023-06-30 19:41:35 +00:00
< / div >
2024-06-21 21:21:42 +00:00
< div class = "entry" >
< div class = "expando-button{{ if and (not (and .Post.Body.IsValid .Post.Body.String )) (not (isImage .Post.URL.String)) (not (isYoutube .Post.URL.String)) }} hidden{{else if and (eq .Rank 0) (not .State.CollapseMedia)}} open{{ end }}" > < / div >
2024-06-03 15:00:46 +00:00
< div >
2023-06-30 19:41:35 +00:00
< div class = "meta" >
2024-06-03 15:00:46 +00:00
< span >
2023-06-30 19:41:35 +00:00
submitted
2024-06-03 15:00:46 +00:00
< span title = "{{.Post.Published.Time}}" > {{ humanize .Post.Published.Time -}}< / span > < / span >
2023-12-17 01:09:35 +00:00
{{- if gt .Post.Updated.ValueOrZero.Time.Unix .Post.Published.Time.Unix -}}
2024-06-03 15:00:46 +00:00
< span > * (last edited < span title = "{{.Post.Updated.ValueOrZero.Time}}" > {{ humanize .Post.Updated.ValueOrZero.Time }}< / span > )< / span >
2023-06-30 19:41:35 +00:00
{{ end }}
2024-06-03 15:00:46 +00:00
< span > by
2023-12-16 14:43:43 +00:00
< a class = "submitter{{ if false}} admin{{end}}" href = "/{{ .State.Host }}/u/{{ fullname .Creator }}" >
2023-07-14 13:55:42 +00:00
{{- if .State.HideInstanceNames -}}
{{ .Creator.Name }}
{{- else -}}
{{ fullname .Creator }}
{{- end -}}
2024-06-03 15:00:46 +00:00
< / a > < / span >
< span > to
2023-09-03 16:48:04 +00:00
< a class = "community" href = "/{{ .State.Host }}/c/{{ fullcname .Community }}" >
2023-07-14 13:55:42 +00:00
c/{{ if .State.HideInstanceNames -}}
{{ .Community.Name }}
{{ else -}}
{{ fullcname .Community }}
{{ end }}
2024-06-03 15:00:46 +00:00
< / a > < / span >
2023-06-30 19:41:35 +00:00
< / div >
< div class = "buttons" >
2024-05-12 04:09:05 +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-28 21:00:58 +00:00
< a href = "{{ .Post.ApID}}" > fedilink< / a >
2024-05-12 04:09:05 +00:00
{{- if .State.Session }}
2023-09-03 16:48:04 +00:00
< a href = "/{{ .State.Host }}/post/{{ .Post.ID }}/block" rel = "xhr" target = "block{{ .Post.ID }}" > block< / a >
< span class = "blockpopup" name = "block{{.Post.ID}}" > < / span >
2024-06-03 15:00:46 +00:00
{{- end }}
2024-05-12 04:09:05 +00:00
{{- if and .State.Session (eq .State.Session.UserID .Post.CreatorID) }}
{{- if not .Post.Deleted }}< a href = "/{{ .State.Host }}/post/{{ .Post.ID }}?edit" > edit< / a > {{end}}
2023-06-30 19:41:35 +00:00
< form class = "link-btn" method = "POST" >
< input type = "hidden" name = "postid" value = "{{.Post.ID }}" >
< input type = "hidden" name = "op" value = "delete_post" >
2024-05-12 04:09:05 +00:00
{{- if .Post.Deleted }}
2023-06-30 19:41:35 +00:00
< input type = "submit" value = "undelete" >
< input type = "hidden" name = "undo" value = "1" >
2024-05-12 04:09:05 +00:00
{{- else }}
2023-06-30 19:41:35 +00:00
< input type = "submit" value = "delete" >
2024-05-12 04:09:05 +00:00
{{- end }}
2023-06-30 19:41:35 +00:00
< / form >
2024-05-12 04:09:05 +00:00
{{- end}}
{{- end }}
{{- if or (ne .State.Op "vote_post") (eq .State.Op "save_post") }}
{{- if .State.Session }}
2023-07-05 14:20:07 +00:00
< form class = "link-btn" method = "POST" >
< input type = "hidden" name = "postid" value = "{{.Post.ID }}" >
< input type = "hidden" name = "op" value = "save_post" >
2024-05-12 04:09:05 +00:00
{{- if .PostView.Saved }}
2023-07-05 14:20:07 +00:00
< input type = "submit" name = "submit" value = "unsave" >
2024-05-12 04:09:05 +00:00
{{- else }}
2023-07-05 14:20:07 +00:00
< input type = "submit" name = "submit" value = "save" >
2024-05-12 04:09:05 +00:00
{{- end }}
2023-07-05 14:20:07 +00:00
< / form >
2024-05-12 04:09:05 +00:00
{{- end}}
{{- end }}
{{- if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
{{- if .State.PostID }}
2023-07-10 15:53:15 +00:00
< a id = "hidechildren" class = "scripting" href = "" > hide all child comments< / a >
2024-05-12 04:09:05 +00:00
{{- end }}
{{- if and .State.Site .State.Site.MyUser.IsValid (not .State.Site.MyUser.ValueOrZero.LocalUserView.LocalUser.ShowReadPosts) }}
2023-07-20 23:36:12 +00:00
< form class = "link-btn" method = "POST" >
< input type = "hidden" name = "postid" value = "{{.Post.ID }}" >
< input type = "hidden" name = "op" value = "read_post" >
2024-05-12 04:09:05 +00:00
{{- if .Post.Deleted }}
2023-07-20 23:36:12 +00:00
< input type = "submit" name = "submit" value = "mark unread" >
2024-05-12 04:09:05 +00:00
{{- else }}
2023-07-20 23:36:12 +00:00
< input type = "submit" name = "submit" value = "mark read" >
2024-05-12 04:09:05 +00:00
{{- end }}
2023-07-20 23:36:12 +00:00
< / form >
2024-05-12 04:09:05 +00:00
{{- end }}
2023-06-30 19:41:35 +00:00
< / div >
2024-06-03 15:00:46 +00:00
< / div >
< / div >
< / div >
2024-06-21 21:21:42 +00:00
< div class = "expando{{ if and (eq .Rank 0) (not .State.CollapseMedia)}} open{{ end}}{{ if and (not .Post.Body.IsValid) (not (isImage .Post.URL.String))}} hide{{end}}{{ if and .Post.Body.IsValid (ne .Post.Body.String " " ) } } text { { end } } " >
2024-06-03 15:00:46 +00:00
{{- if or ((and .Post.Body.IsValid (ne .Post.Body.String ""))) (isImage .Post.URL.String)}}
{{- if gt .Rank 0 }}
< div class = "rank" > < / div >
{{- end }}
< div class = "score" > < div > < div > < / div > < / div > < / div >
{{ if not .State.HideThumbnails }}
< div class = "thumb" > < / div >
{{ end }}
{{- end }}
< div >
2024-05-12 04:09:05 +00:00
{{- if (and .Post.Body.IsValid (ne .Post.Body.String "")) }}
2024-06-21 21:21:42 +00:00
< div class = "md" >
{{ if .State.CollapseMedia }}
{{ collapsemedia (markdown .State.Host .Post.Body.String) }}
{{ else }}
{{ markdown .State.Host .Post.Body.String }}
{{ end }}
< / div >
2024-05-12 04:09:05 +00:00
{{- end }}
{{- if isImage .Post.URL.String}}
2024-06-21 21:21:42 +00:00
< img class = "image" loading = "lazy" src = "{{ .Post.URL }}" >
2024-05-12 04:09:05 +00:00
{{- end }}
2024-06-21 21:21:42 +00:00
< div class = "embed" > < / div >
2023-06-30 19:41:35 +00:00
< / div >
2023-12-22 17:39:25 +00:00
< / div >
2023-06-30 19:41:35 +00:00
< / div >
2024-05-12 04:09:05 +00:00
{{- end -}}