mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-23 05:52:12 +00:00
145 lines
6.2 KiB
HTML
145 lines
6.2 KiB
HTML
<!DOCTYPE html>
|
||
<head>
|
||
<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" />
|
||
<link rel="shortcut icon" href="/{{.Host}}/icon.jpg">
|
||
<link rel="stylesheet" href="/_/static/style.css?v={{ .Version }}">
|
||
{{- if or (not .Dark) (is .Dark) }}
|
||
<link rel="stylesheet" href="/_/static/dark.css?v={{ .Version }}" {{ if not .Dark }}media="(prefers-color-scheme:dark)"{{ end }}>
|
||
{{- end }}
|
||
</head>
|
||
<body{{ if .HideSidebar }} class="sidetoggle"{{ end }}>
|
||
<noscript>
|
||
<link rel="stylesheet" href="/_/static/noscript.css?v={{ .Version }}">
|
||
</noscript>
|
||
{{ template "nav.html" . -}}
|
||
{{- if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }}
|
||
{{ template "nsfw.html" }}
|
||
{{- else }}
|
||
<main>
|
||
{{- template "sidebar.html" . }}
|
||
{{- if or (.Query) (.SearchType) (and (not .PostID) (not .User) (not .Activities) (eq .Op ""))}}
|
||
{{ template "menu.html" . }}
|
||
{{- end}}
|
||
|
||
{{- if or (ne .SearchType "") (ne .Query "") .Communities }}
|
||
<form class="search" method="GET">
|
||
<input type="hidden" name="sort" value="{{.Sort}}">
|
||
<input type="hidden" name="listingType" value="{{.Listing}}">
|
||
<div>search</div>
|
||
<div class="query">
|
||
<input type="text" name="q" value="{{.Query}}">
|
||
<input type="submit" value="search">
|
||
</div>
|
||
<div>
|
||
<select name="searchtype">
|
||
<option value="All"{{ if eq .SearchType "All" }} selected{{ end }}>all</option>
|
||
<option value="Posts"{{ if eq .SearchType "Posts" }} selected{{ end }}>posts</option>
|
||
<option value="Comments"{{ if eq .SearchType "Comments" }} selected{{ end }}>comments</option>
|
||
<option value="Communities"{{ if eq .SearchType "Communities" }} selected{{ end }}>communities</option>
|
||
<option value="Url"{{ if eq .SearchType "Url" }} selected{{ end }}>url</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>
|
||
</form>
|
||
{{- end}}
|
||
|
||
{{- if .Error }}
|
||
<div class="error">
|
||
{{.Error}}.
|
||
{{ if .Unknown }}
|
||
try remote instance: <a href="{{ .Unknown }}">{{ .Unknown }}</a>
|
||
{{ end }}
|
||
</div>
|
||
{{ end }}
|
||
|
||
{{- if eq .Op "create_community" "edit_community" }}
|
||
{{ template "create_community.html" . }}
|
||
{{- end }}
|
||
|
||
{{- range .Posts }}
|
||
{{ template "post.html" . }}
|
||
{{- end }}
|
||
|
||
{{- if eq .Op "create_post" "edit_post" }}
|
||
{{ template "create_post.html" . }}
|
||
{{- end }}
|
||
|
||
{{- if and .PostID .Posts}}
|
||
{{- if .CommentID}}
|
||
<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>
|
||
{{- else }}
|
||
<div id="comments" class="commentmenu">
|
||
{{- if .Comments}}{{if gt .Page 1}}(page {{ .Page }}) {{else if lt (index .Posts 0).Counts.Comments .CommentCount }}all{{else}}top{{end}} {{.CommentCount}} comments{{else}} no comments (yet){{end}}
|
||
<div>
|
||
sorted by:
|
||
<a {{ if eq .CommentSort "Hot"}}class="selected"{{end}} href="{{ .SortBy "Hot"}}">hot</a>
|
||
<a {{ if eq .CommentSort "Top"}}class="selected"{{end}} href="{{ .SortBy "Top"}}">top</a>
|
||
<a {{ if eq .CommentSort "Controversial"}}class="selected"{{end}} href="{{ .SortBy "Controversial"}}">controversial</a>
|
||
<a {{ if eq .CommentSort "New"}}class="selected"{{end}} href="{{ .SortBy "New"}}">new</a>
|
||
<a {{ if eq .CommentSort "Old"}}class="selected"{{end}} href="{{ .SortBy "Old"}}">old</a>
|
||
</div>
|
||
</div>
|
||
{{- if and .Session (ne .Op "edit_post") }}
|
||
<div class="create_comment">
|
||
{{ template "create_comment.html" . }}
|
||
</div>
|
||
{{- end }}
|
||
{{- end }}
|
||
{{- end}}
|
||
{{- if and .User .Activities }}
|
||
<div class="menu">
|
||
sorted by:
|
||
<a {{ if eq .Sort "New"}}class="selected"{{end}} href="{{ .SortBy "New"}}">new</a>
|
||
<a {{ if eq .Sort "TopAll"}}class="selected"{{end}} href="{{ .SortBy "TopAll"}}">top</a>
|
||
<a {{ if eq .Sort "Controversial"}}class="selected"{{end}} href="{{ .SortBy "Controversial"}}">controversial</a>
|
||
<a {{ if eq .Sort "Old"}}class="selected"{{end}} href="{{ .SortBy "Old"}}">old</a>
|
||
</div>
|
||
{{- end -}}
|
||
|
||
{{- range $i, $comment := .Comments }}
|
||
{{ template "comment.html" $comment }}
|
||
{{- end -}}
|
||
|
||
{{- if and .Comments .Posts (gt (index .Posts 0).Counts.Comments .CommentCount) (not .CommentID)}}
|
||
<div class="morecomments">
|
||
<a id="lmc" href="" data-page="2">load more comments</a>
|
||
</div>
|
||
{{- end -}}
|
||
|
||
{{- if eq .Op "send_message" }}
|
||
{{ template "send_message.html" . }}
|
||
{{- else }}
|
||
{{ template "activities.html" . }}
|
||
{{- end -}}
|
||
|
||
{{- range .Communities }}
|
||
{{ template "community.html" . }}
|
||
{{- end -}}
|
||
|
||
{{- 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 -}}
|
||
|
||
{{- if or .Query (eq .SearchType "Communities") (eq (len .Posts) 25) (and .Comments (gt (index .Posts 0).Counts.Comments .CommentCount) (not .CommentID)) (and .User (or (gt .User.PersonView.Counts.CommentCount 10) (gt .User.PersonView.Counts.PostCount 10))) }}
|
||
<div class="pager">
|
||
view more: {{if gt .Page 1 }}<a href="{{ .PrevPage }}">‹ prev</a>{{ end }} <a href="{{ .NextPage }}">next ›</a>
|
||
</div>
|
||
{{- if not .PostID }}
|
||
<input id="loadmore" type="submit" value="load more" data-page="2">
|
||
{{- end }}
|
||
{{- end }}
|
||
<script src="/_/static/utils.js?v={{ .Version }}"></script>
|
||
{{- if .Watch }}
|
||
<script src="/_/static/ws.js"></script>
|
||
{{- end }}
|
||
</main>
|
||
{{- end }}
|
||
</body>
|
||
</html>
|