2023-06-30 19:41:35 +00:00
<!DOCTYPE html>
< head >
2023-07-02 21:29:35 +00:00
< title > {{if and .Posts .PostID }}{{ (index .Posts 0).Post.Name}} : {{.CommunityName}}{{else if and .Community (ne .Community.CommunityView.Community.Title "")}}{{.Community.CommunityView.Community.Title}}{{else if ne .CommunityName ""}}/c/{{.CommunityName}}{{ else if .User}}overview for {{.User.PersonView.Person.Name}}{{else}}{{ host .Host }}{{end}}< / title >
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
2023-06-30 19:41:35 +00:00
< link rel = "shortcut icon" href = "/{{.Host}}/icon.jpg" >
2023-07-05 20:20:34 +00:00
< link rel = "stylesheet" href = "/_/static/style.css?v=4" >
2023-06-30 19:41:35 +00:00
< / head >
2023-07-03 00:11:13 +00:00
< body { { if . Dark } } class = "dark" { { end } } >
2023-06-30 19:41:35 +00:00
< noscript >
< style >
2023-07-05 19:26:26 +00:00
.expando-button,
.minimize,
.hidechildren {
2023-06-30 19:41:35 +00:00
display: none;
}
2023-07-05 20:20:34 +00:00
.post .expando .image img {
visibility: visible;
}
2023-06-30 19:41:35 +00:00
< / style >
< / noscript >
{{ template "nav.html" . -}}
2023-07-05 13:49:41 +00:00
{{ if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }}
{{ template "nsfw.html" }}
{{ else }}
2023-07-03 00:11:13 +00:00
< main >
2023-07-05 13:49:41 +00:00
{{ if or (contains .Sort "Top") (and (not .PostID) (not .User) (not .Community) (not .Activities) (eq .Op ""))}}
2023-06-30 19:41:35 +00:00
{{ template "menu.html" . }}
2023-07-05 13:49:41 +00:00
{{ end}}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ if or (ne .Query "") .Communities }}
2023-06-30 19:41:35 +00:00
< form class = "search" method = "GET" >
< div > search< / div >
< div class = "query" >
< input type = "text" name = "q" value = "{{.Query}}" >
< input type = "submit" value = "search" >
< / div >
{{ if ne .SearchType "Communities" }}
< div >
< select name = "searchtype" >
< option value = "Posts" { { if eq . SearchType " Posts " } } selected { { end } } > posts< / option >
< option value = "Comments" { { if eq . SearchType " Comments " } } selected { { end } } > comments< / option >
< / select >
< label > from
< input type = "text" placeholder = "everywhere" name = "communityname" value = "{{.CommunityName}}" > < / label >
< label > by
< input type = "text" placeholder = "anyone" name = "username" value = "{{.UserName}}" > < / label >
< / div >
{{ else }}
< input type = "hidden" name = "searchtype" value = "Communities" >
{{ end }}
< / form >
2023-07-05 13:49:41 +00:00
{{ end}}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ if .Error }}
2023-06-30 19:41:35 +00:00
< div class = "error" > {{.Error}}< / div >
2023-07-05 13:49:41 +00:00
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ range .Communities }}
2023-06-30 19:41:35 +00:00
{{ template "community.html" . }}
2023-07-05 13:49:41 +00:00
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ if eq .Op "create_community" "edit_community" }}
{{ template "create_community.html" . }}
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ range .Posts }}
2023-06-30 19:41:35 +00:00
{{ template "post.html" . }}
2023-07-05 13:49:41 +00:00
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ if eq .Op "create_post" "edit_post" }}
{{ template "create_post.html" . }}
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ if and .PostID .Posts}}
{{ if .CommentID}}
2023-06-30 19:41:35 +00:00
< div class = "warning" > you are viewing a single comment's thread< br >
< a href = "../post/{{.PostID}}/#c{{.CommentID}}" > view the rest of the comments< / a >
< / div >
2023-07-05 13:49:41 +00:00
{{ else }}
2023-06-30 19:41:35 +00:00
< div class = "commentmenu" >
{{if .Comments}}{{if gt .Page 1}}next{{else if or (lt .CommentCount 200) (lt (index .Posts 0).Counts.Comments .CommentCount) }}all{{else}}top{{end}} {{.CommentCount}} comments{{else}} no comments (yet){{end}}
< div >
sorted by:
< a { { if eq . Sort " Hot " } } class = "selected" { { end } } href = "{{ .SortBy " Hot " } } " > hot< / a >
< a { { if eq . Sort " Top " } } class = "selected" { { end } } href = "{{ .SortBy " Top " } } " > top< / a >
< a { { if eq . Sort " New " } } class = "selected" { { end } } href = "{{ .SortBy " New " } } " > new< / a >
< a { { if eq . Sort " Old " } } class = "selected" { { end } } href = "{{ .SortBy " Old " } } " > old< / a >
< / div >
< / div >
2023-07-05 13:49:41 +00:00
{{ if and .Session (ne .Op "edit_post") }}
2023-06-30 19:41:35 +00:00
< form class = "savecomment" method = "POST" >
< div >
< textarea required name = "content" { { if ( index . Posts 0 ) . Post . Deleted } } disabled { { end } } > < / textarea >
< / div >
< input type = "hidden" name = "op" value = "create_comment" >
< input type = "submit" value = "save" { { if ( index . Posts 0 ) . Post . Deleted } } disabled { { end } } >
< / form >
2023-07-05 13:49:41 +00:00
{{ end }}
2023-06-30 19:41:35 +00:00
{{ end }}
2023-07-05 13:49:41 +00:00
{{ end}}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ range $i, $comment := .Comments }}
2023-06-30 19:41:35 +00:00
{{ template "comment.html" $comment }}
2023-07-05 13:49:41 +00:00
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ if eq .Op "send_message" }}
{{ template "send_message.html" . }}
{{ else }}
{{ template "activities.html" . }}
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ if or (and (not .Op) (not .Activities) (not .Comments) (not .Posts) (not .Communities)) (and (not .Comments) .PostID) (and (not .Activities) (not .Query) .User) }}
< div class = "error" > there doesn't seem to be anything here< / div >
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 13:49:41 +00:00
{{ if or .Query (eq .SearchType "Communities") (eq (len .Posts) 25) (and .Comments (and (eq .CommentCount 200) (gt (index .Posts 0).Counts.Comments .CommentCount))) (and .User (or (gt .User.PersonView.Counts.CommentCount 10) (gt .User.PersonView.Counts.PostCount 10))) }}
2023-06-30 19:41:35 +00:00
< div class = "pager" >
view more: {{if gt .Page 1 }}< a href = "{{ .PrevPage }}" > ‹ prev< / a > {{ end }} < a href = "{{ .NextPage }}" > next › < / a >
< / div >
2023-07-05 13:49:41 +00:00
{{ end }}
2023-06-30 19:41:35 +00:00
2023-07-05 15:00:14 +00:00
< script src = "/_/static/utils.js?2" > < / script >
2023-07-02 21:29:35 +00:00
{{ template "sidebar.html" . }}
2023-06-30 19:41:35 +00:00
< / main >
2023-07-05 13:49:41 +00:00
{{ end }}
2023-06-30 19:41:35 +00:00
< / body >
< / html >