mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-08 08:04:26 +00:00
whitespace
This commit is contained in:
parent
1fe8e5a5b5
commit
87a7662c94
|
@ -1,126 +1,126 @@
|
||||||
<div class="comment{{if or (lt .P.Counts.Score -5) .P.Comment.Deleted .P.Comment.Removed }} hidden{{end}}" id="c{{.P.Comment.ID}}">
|
<div class="comment{{if or (lt .P.Counts.Score -5) .P.Comment.Deleted .P.Comment.Removed }} hidden{{end}}" id="c{{.P.Comment.ID}}">
|
||||||
<div class="score">
|
<div class="score">
|
||||||
{{ if .State.Session }}
|
{{- if .State.Session }}
|
||||||
<form class="link-btn{{ if eq .P.MyVote.String "1"}} like{{ else if eq .P.MyVote.String "-1"}} dislike{{end}}" method="POST">
|
<form class="link-btn{{ if eq .P.MyVote.String "1"}} like{{ else if eq .P.MyVote.String "-1"}} dislike{{end}}" method="POST">
|
||||||
<input type="submit" name="submit" value="▲">
|
<input type="submit" name="submit" value="▲">
|
||||||
<div></div>
|
<div></div>
|
||||||
{{ if .P.MyVote.IsValid}}
|
{{- if .P.MyVote.IsValid}}
|
||||||
<input type="hidden" name="undo" value="{{.P.MyVote.String}}">
|
<input type="hidden" name="undo" value="{{.P.MyVote.String}}">
|
||||||
{{ end}}
|
{{- end}}
|
||||||
<input type="hidden" name="op" value="vote_comment">
|
<input type="hidden" name="op" value="vote_comment">
|
||||||
<input type="hidden" name="commentid" value="{{.P.Comment.ID }}">
|
<input type="hidden" name="commentid" value="{{.P.Comment.ID }}">
|
||||||
<input type="submit" name="submit" value="▼">
|
<input type="submit" name="submit" value="▼">
|
||||||
</form>
|
</form>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<a class="minimize" href="" for="c{{.P.Comment.ID}}">
|
<a class="minimize" href="" for="c{{.P.Comment.ID}}">
|
||||||
{{- if or (lt .P.Counts.Score -5) .P.Comment.Deleted -}}
|
{{- if or (lt .P.Counts.Score -5) .P.Comment.Deleted -}}
|
||||||
[+]
|
[+]
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
[-]
|
[-]
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</a>
|
|
||||||
<a class="creator{{ if .P.Comment.Distinguished}}{{if false}} admin{{end}} distinguished{{ else if .Submitter }} submitter{{end}}" href="/{{.State.Host}}/u/{{fullname .P.Creator}}">
|
|
||||||
{{- if .State.HideInstanceNames -}}
|
|
||||||
{{ .P.Creator.Name }}
|
|
||||||
{{- else -}}
|
|
||||||
{{ fullname .P.Creator }}
|
|
||||||
{{- end -}}
|
|
||||||
</a>
|
|
||||||
<b>{{.P.Counts.Score}} points</b> <span title="{{.P.Comment.Published.Time}}">{{ humanize .P.Comment.Published.Time }}</span>
|
|
||||||
{{- if gt .P.Comment.Updated.ValueOrZero.Time.Unix .P.Comment.Published.Time.Unix -}}
|
|
||||||
* (last edited <span title="{{.P.Comment.Updated.ValueOrZero.Time}}">{{ humanize .P.Comment.Updated.ValueOrZero.Time }}</span>)
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
{{ if eq .Op "edit" }}
|
|
||||||
{{ template "create_comment.html" .State }}
|
|
||||||
{{ else }}
|
|
||||||
{{if .P.Comment.Deleted}}
|
|
||||||
[deleted]
|
|
||||||
{{else if .P.Comment.Removed }}
|
|
||||||
[removed by mod]
|
|
||||||
{{else}}
|
|
||||||
<div {{ if and .Selected (not .State.XHR) (ne .State.Op "reply")}}class="highlight" {{end}}>
|
|
||||||
{{ markdown .State.Host .P.Comment.Content }}
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
{{ if eq .Op "source" }}
|
|
||||||
<div><textarea>{{.P.Comment.Content}}</textarea></div>
|
|
||||||
{{end}}
|
|
||||||
{{ end }}
|
|
||||||
<ul class="buttons">
|
|
||||||
<li><a href="/{{.State.Host}}/comment/{{.P.Comment.ID}}">permalink</a></li>
|
|
||||||
<li><a href="{{.P.Comment.ApID}}">fedilink</a></li>
|
|
||||||
{{ if ne .Op "source"}}
|
|
||||||
<li><a class="source" for="c{{.P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?source">source</a></li>
|
|
||||||
{{ else }}
|
|
||||||
<li><a class="source" for="c{{.P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?">hide source</a></li>
|
|
||||||
{{ end }}
|
|
||||||
{{ if .State.Session }}
|
|
||||||
{{ if and (eq .P.Comment.CreatorID .State.Session.UserID) (ne .Op "edit") }}
|
|
||||||
<li><a class="edit" for="c{{.P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?edit">edit</a></li>
|
|
||||||
{{ if not .P.Comment.Deleted }}
|
|
||||||
<li>
|
|
||||||
<form class="delete" method="POST">
|
|
||||||
<input type="hidden" name="commentid" value="{{.P.Comment.ID}}">
|
|
||||||
<input type="hidden" name="op" value="delete_comment">
|
|
||||||
<input type="submit" name="submit" value="delete">
|
|
||||||
</form>
|
|
||||||
</li>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
<li>
|
|
||||||
<form class="link-btn" method="POST">
|
|
||||||
<input type="hidden" name="commentid" value="{{.P.Comment.ID}}">
|
|
||||||
<input type="hidden" name="op" value="save_comment">
|
|
||||||
{{ if .P.Saved }}
|
|
||||||
<input type="submit" name="submit" value="unsave">
|
|
||||||
{{ else }}
|
|
||||||
<input type="submit" name="submit" value="save">
|
|
||||||
{{ end }}
|
|
||||||
</form>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<form class="link-btn" method="POST">
|
|
||||||
<input type="hidden" name="commentid" value="{{.P.Comment.ID}}">
|
|
||||||
<input type="hidden" name="op" value="block_user">
|
|
||||||
<input type="hidden" name="user_id" value="{{.P.Creator.ID}}">
|
|
||||||
<input type="submit" name="submit" value="block">
|
|
||||||
</form>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a class="reply" for="c{{.P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?reply">
|
|
||||||
reply
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
<a class="creator{{ if .P.Comment.Distinguished}}{{if false}} admin{{end}} distinguished{{ else if .Submitter }} submitter{{end}}" href="/{{.State.Host}}/u/{{fullname .P.Creator}}">
|
||||||
{{ end }}
|
{{- if .State.HideInstanceNames -}}
|
||||||
{{ if and .ParentID .State.CommentID (not .State.XHR) }}
|
{{ .P.Creator.Name }}
|
||||||
<li>
|
{{- else -}}
|
||||||
<a href="/{{.State.Host}}/comment/{{.ParentID}}">parent</a>
|
{{ fullname .P.Creator }}
|
||||||
</li>
|
{{- end -}}
|
||||||
{{ end }}
|
</a>
|
||||||
{{ if and .ParentID (or .State.Activities .State.Query) }}
|
<b>{{.P.Counts.Score}} points</b> <span title="{{.P.Comment.Published.Time}}">{{ humanize .P.Comment.Published.Time }}</span>
|
||||||
<li>
|
{{- if gt .P.Comment.Updated.ValueOrZero.Time.Unix .P.Comment.Published.Time.Unix -}}
|
||||||
<a href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?context=3">context</a>
|
* (last edited <span title="{{.P.Comment.Updated.ValueOrZero.Time}}">{{ humanize .P.Comment.Updated.ValueOrZero.Time }}</span>)
|
||||||
</li>
|
{{ end }}
|
||||||
{{ end }}
|
</div>
|
||||||
{{ if and .State.PostID (gt (add .P.Counts.ChildCount .ChildCount) 0) }}
|
<div class="content">
|
||||||
<li><a class="hidechildren" for="c{{.P.Comment.ID}}" href=""><span class="hide">hide</span><span class="show">show {{add .P.Counts.ChildCount .ChildCount }}</span> child comments</a></li>
|
{{- if eq .Op "edit" }}
|
||||||
{{ end }}
|
{{ template "create_comment.html" .State }}
|
||||||
</ul>
|
{{- else }}
|
||||||
</div>
|
{{- if .P.Comment.Deleted}}
|
||||||
<div class="children">
|
[deleted]
|
||||||
{{ if and (eq .State.Op "reply") (eq .State.CommentID .P.Comment.ID)}}
|
{{- else if .P.Comment.Removed }}
|
||||||
{{ template "create_comment.html" .State }}
|
[removed by mod]
|
||||||
{{ end}}
|
{{- else}}
|
||||||
{{ range $ci, $child := .C }}{{ template "comment.html" $child }}{{end}}
|
<div {{ if and .Selected (not .State.XHR) (ne .State.Op "reply")}}class="highlight" {{end}}>
|
||||||
{{ if and (ne .P.Counts.ChildCount .ChildCount) (not .State.Activities) (not .State.Query) }}
|
{{ markdown .State.Host .P.Comment.Content }}
|
||||||
<div class="morecomments">
|
</div>
|
||||||
<a class="loadmore" for="c{{ .P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?">load more comments</a>
|
{{- end}}
|
||||||
<span class="gray">({{ sub .P.Counts.ChildCount .ChildCount}} replies)</span>
|
{{- if eq .Op "source" }}
|
||||||
|
<div><textarea>{{.P.Comment.Content}}</textarea></div>
|
||||||
|
{{- end}}
|
||||||
|
{{- end }}
|
||||||
|
<ul class="buttons">
|
||||||
|
<li><a href="/{{.State.Host}}/comment/{{.P.Comment.ID}}">permalink</a></li>
|
||||||
|
<li><a href="{{.P.Comment.ApID}}">fedilink</a></li>
|
||||||
|
{{- if ne .Op "source"}}
|
||||||
|
<li><a class="source" for="c{{.P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?source">source</a></li>
|
||||||
|
{{- else }}
|
||||||
|
<li><a class="source" for="c{{.P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?">hide source</a></li>
|
||||||
|
{{- end }}
|
||||||
|
{{- if .State.Session }}
|
||||||
|
{{- if and (eq .P.Comment.CreatorID .State.Session.UserID) (ne .Op "edit") }}
|
||||||
|
<li><a class="edit" for="c{{.P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?edit">edit</a></li>
|
||||||
|
{{- if not .P.Comment.Deleted }}
|
||||||
|
<li>
|
||||||
|
<form class="delete" method="POST">
|
||||||
|
<input type="hidden" name="commentid" value="{{.P.Comment.ID}}">
|
||||||
|
<input type="hidden" name="op" value="delete_comment">
|
||||||
|
<input type="submit" name="submit" value="delete">
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
<li>
|
||||||
|
<form class="link-btn" method="POST">
|
||||||
|
<input type="hidden" name="commentid" value="{{.P.Comment.ID}}">
|
||||||
|
<input type="hidden" name="op" value="save_comment">
|
||||||
|
{{- if .P.Saved }}
|
||||||
|
<input type="submit" name="submit" value="unsave">
|
||||||
|
{{- else }}
|
||||||
|
<input type="submit" name="submit" value="save">
|
||||||
|
{{- end }}
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<form class="link-btn" method="POST">
|
||||||
|
<input type="hidden" name="commentid" value="{{.P.Comment.ID}}">
|
||||||
|
<input type="hidden" name="op" value="block_user">
|
||||||
|
<input type="hidden" name="user_id" value="{{.P.Creator.ID}}">
|
||||||
|
<input type="submit" name="submit" value="block">
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="reply" for="c{{.P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?reply">
|
||||||
|
reply
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .ParentID .State.CommentID (not .State.XHR) }}
|
||||||
|
<li>
|
||||||
|
<a href="/{{.State.Host}}/comment/{{.ParentID}}">parent</a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .ParentID (or .State.Activities .State.Query) }}
|
||||||
|
<li>
|
||||||
|
<a href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?context=3">context</a>
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .State.PostID (gt (add .P.Counts.ChildCount .ChildCount) 0) }}
|
||||||
|
<li><a class="hidechildren" for="c{{.P.Comment.ID}}" href=""><span class="hide">hide</span><span class="show">show {{add .P.Counts.ChildCount .ChildCount }}</span> child comments</a></li>
|
||||||
|
{{- end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="children">
|
||||||
|
{{- if and (eq .State.Op "reply") (eq .State.CommentID .P.Comment.ID)}}
|
||||||
|
{{ template "create_comment.html" .State }}
|
||||||
|
{{- end}}
|
||||||
|
{{ range $ci, $child := .C }}{{ template "comment.html" $child }}{{end}}
|
||||||
|
{{- if and (ne .P.Counts.ChildCount .ChildCount) (not .State.Activities) (not .State.Query) }}
|
||||||
|
<div class="morecomments">
|
||||||
|
<a class="loadmore" for="c{{ .P.Comment.ID}}" href="/{{.State.Host}}/comment/{{.P.Comment.ID}}?">load more comments</a>
|
||||||
|
<span class="gray">({{ sub .P.Counts.ChildCount .ChildCount}} replies)</span>
|
||||||
|
</div>
|
||||||
|
{{- end}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
@ -3,43 +3,43 @@
|
||||||
{{- else }} action="/{{.Host}}/post/{{.PostID}}"
|
{{- else }} action="/{{.Host}}/post/{{.PostID}}"
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
>
|
>
|
||||||
<div class="upload">
|
<div class="upload">
|
||||||
<label title="upload photo"><div>📷</div>
|
<label title="upload photo"><div>📷</div>
|
||||||
<input class="imgupload" type="file" name="file" accept="image/*">
|
<input class="imgupload" type="file" name="file" accept="image/*">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<textarea name="content" {{ if .XHR }}autofocus{{ end }}>
|
<textarea name="content" {{ if .XHR }}autofocus{{ end }}>
|
||||||
|
{{- if .Content }}
|
||||||
|
{{- .Content -}}
|
||||||
|
{{ else if and (eq .Op "edit") .Comments }}
|
||||||
|
{{- (index .Comments 0).P.Comment.Content -}}
|
||||||
|
{{ end -}}
|
||||||
|
</textarea>
|
||||||
|
</div>
|
||||||
|
{{- if eq .Op "edit" }}
|
||||||
|
<input type="hidden" name="op" value="edit_comment">
|
||||||
|
<input type="hidden" name="commentid" value="{{.CommentID}}">
|
||||||
|
{{- else }}
|
||||||
|
<input type="hidden" name="op" value="create_comment">
|
||||||
|
{{- end }}
|
||||||
|
<input type="hidden" name="parentid" value="{{.CommentID}}">
|
||||||
|
<input type="submit" name="submit" value="save">
|
||||||
|
{{- if or .Op .Content }}
|
||||||
|
<input type="submit" name="submit" value="cancel">
|
||||||
|
{{- end }}
|
||||||
|
<div class="right">
|
||||||
|
<a href="https://join-lemmy.org/docs/users/02-media.html" target="_blank">formatting help</a>
|
||||||
|
<input name="submit" type="submit" value="preview">
|
||||||
|
</div>
|
||||||
{{- if .Content }}
|
{{- if .Content }}
|
||||||
{{- .Content -}}
|
<div class="preview">
|
||||||
{{ else if and (eq .Op "edit") .Comments }}
|
<div class="comment">
|
||||||
{{- (index .Comments 0).P.Comment.Content -}}
|
<h3>Preview</h3>
|
||||||
{{ end -}}
|
<div class="content">
|
||||||
</textarea>
|
{{ markdown .Host .Content }}
|
||||||
</div>
|
</div>
|
||||||
{{ if eq .Op "edit" }}
|
|
||||||
<input type="hidden" name="op" value="edit_comment">
|
|
||||||
<input type="hidden" name="commentid" value="{{.CommentID}}">
|
|
||||||
{{ else }}
|
|
||||||
<input type="hidden" name="op" value="create_comment">
|
|
||||||
{{ end }}
|
|
||||||
<input type="hidden" name="parentid" value="{{.CommentID}}">
|
|
||||||
<input type="submit" name="submit" value="save">
|
|
||||||
{{ if or .Op .Content }}
|
|
||||||
<input type="submit" name="submit" value="cancel">
|
|
||||||
{{ end }}
|
|
||||||
<div class="right">
|
|
||||||
<a href="https://join-lemmy.org/docs/users/02-media.html" target="_blank">formatting help</a>
|
|
||||||
<input name="submit" type="submit" value="preview">
|
|
||||||
</div>
|
|
||||||
{{ if .Content }}
|
|
||||||
<div class="preview">
|
|
||||||
<div class="comment">
|
|
||||||
<h3>Preview</h3>
|
|
||||||
<div class="content">
|
|
||||||
{{ markdown .Host .Content }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{- end }}
|
||||||
{{ end }}
|
</form>
|
||||||
</form>
|
|
||||||
|
|
|
@ -12,18 +12,18 @@
|
||||||
<noscript>
|
<noscript>
|
||||||
<link rel="stylesheet" href="/_/static/noscript.css?v={{ .Version }}">
|
<link rel="stylesheet" href="/_/static/noscript.css?v={{ .Version }}">
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|
||||||
{{ template "nav.html" . -}}
|
{{ template "nav.html" . -}}
|
||||||
{{ if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }}
|
{{- if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }}
|
||||||
{{ template "nsfw.html" }}
|
{{ template "nsfw.html" }}
|
||||||
{{ else }}
|
{{- else }}
|
||||||
<main>
|
<main>
|
||||||
{{ if and (not .Community) .Tagline }}
|
{{- if and (not .Community) .Tagline }}
|
||||||
<h3>{{ markdown .Host .Tagline }}</h3>
|
<h3>
|
||||||
{{ end }}
|
{{ markdown .Host .Tagline }}
|
||||||
{{ template "menu.html" . }}
|
</h3>
|
||||||
|
{{- end }}
|
||||||
{{ if .Error }}
|
{{ template "menu.html" . }}
|
||||||
|
{{- if .Error }}
|
||||||
<div class="error">
|
<div class="error">
|
||||||
{{.Error}}.
|
{{.Error}}.
|
||||||
{{ if .Unknown }}
|
{{ if .Unknown }}
|
||||||
|
@ -32,16 +32,14 @@
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ range .Posts }}
|
{{- range .Posts }}
|
||||||
{{ template "post.html" . }}
|
{{ template "post.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{- if or (and (not .Op) (not .Activities) (not .Comments) (not .Posts) (not .Communities)) (and (not .Comments) .PostID) (and (not .Activities) (not .Query) .User) }}
|
||||||
{{ 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>
|
<div class="error">there doesn't seem to be anything here</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{- 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))) }}
|
||||||
{{ 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))) }}
|
|
||||||
<div class="pager">
|
<div class="pager">
|
||||||
view more: {{if gt .Page 1 }}<a href="{{ .PrevPage }}">‹ prev</a>{{ end }} <a href="{{ .NextPage }}">next ›</a>
|
view more: {{if gt .Page 1 }}<a href="{{ .PrevPage }}">‹ prev</a>{{ end }} <a href="{{ .NextPage }}">next ›</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,17 +12,16 @@
|
||||||
<noscript>
|
<noscript>
|
||||||
<link rel="stylesheet" href="/_/static/noscript.css?v={{ .Version }}">
|
<link rel="stylesheet" href="/_/static/noscript.css?v={{ .Version }}">
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|
||||||
{{ template "nav.html" . -}}
|
{{ template "nav.html" . -}}
|
||||||
{{ if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }}
|
{{- if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }}
|
||||||
{{ template "nsfw.html" }}
|
{{ template "nsfw.html" }}
|
||||||
{{ else }}
|
{{- else }}
|
||||||
<main>
|
<main>
|
||||||
{{ if or (.Query) (.SearchType) (and (not .PostID) (not .User) (not .Activities) (eq .Op ""))}}
|
{{- if or (.Query) (.SearchType) (and (not .PostID) (not .User) (not .Activities) (eq .Op ""))}}
|
||||||
{{ template "menu.html" . }}
|
{{ template "menu.html" . }}
|
||||||
{{ end}}
|
{{- end}}
|
||||||
|
|
||||||
{{ if or (ne .SearchType "") (ne .Query "") .Communities }}
|
{{- if or (ne .SearchType "") (ne .Query "") .Communities }}
|
||||||
<form class="search" method="GET">
|
<form class="search" method="GET">
|
||||||
<input type="hidden" name="sort" value="{{.Sort}}">
|
<input type="hidden" name="sort" value="{{.Sort}}">
|
||||||
<input type="hidden" name="listingType" value="{{.Listing}}">
|
<input type="hidden" name="listingType" value="{{.Listing}}">
|
||||||
|
@ -45,9 +44,9 @@
|
||||||
<input type="text" placeholder="anyone" name="username" value="{{.UserName}}"></label>
|
<input type="text" placeholder="anyone" name="username" value="{{.UserName}}"></label>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{{ end}}
|
{{- end}}
|
||||||
|
|
||||||
{{ if .Error }}
|
{{- if .Error }}
|
||||||
<div class="error">
|
<div class="error">
|
||||||
{{.Error}}.
|
{{.Error}}.
|
||||||
{{ if .Unknown }}
|
{{ if .Unknown }}
|
||||||
|
@ -56,26 +55,26 @@
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if eq .Op "create_community" "edit_community" }}
|
{{- if eq .Op "create_community" "edit_community" }}
|
||||||
{{ template "create_community.html" . }}
|
{{ template "create_community.html" . }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ range .Posts }}
|
{{- range .Posts }}
|
||||||
{{ template "post.html" . }}
|
{{ template "post.html" . }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ if eq .Op "create_post" "edit_post" }}
|
{{- if eq .Op "create_post" "edit_post" }}
|
||||||
{{ template "create_post.html" . }}
|
{{ template "create_post.html" . }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ if and .PostID .Posts}}
|
{{- if and .PostID .Posts}}
|
||||||
{{ if .CommentID}}
|
{{- if .CommentID}}
|
||||||
<div class="warning">you are viewing a single comment's thread<br>
|
<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>
|
<a href="../post/{{.PostID}}/#c{{.CommentID}}">view the rest of the comments</a>
|
||||||
</div>
|
</div>
|
||||||
{{ else }}
|
{{- else }}
|
||||||
<div id="comments" class="commentmenu">
|
<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}}
|
{{- 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>
|
<div>
|
||||||
sorted by:
|
sorted by:
|
||||||
<a {{ if eq .CommentSort "Hot"}}class="selected"{{end}} href="{{ .SortBy "Hot"}}">hot</a>
|
<a {{ if eq .CommentSort "Hot"}}class="selected"{{end}} href="{{ .SortBy "Hot"}}">hot</a>
|
||||||
|
@ -85,14 +84,14 @@
|
||||||
<a {{ if eq .CommentSort "Old"}}class="selected"{{end}} href="{{ .SortBy "Old"}}">old</a>
|
<a {{ if eq .CommentSort "Old"}}class="selected"{{end}} href="{{ .SortBy "Old"}}">old</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ if and .Session (ne .Op "edit_post") }}
|
{{- if and .Session (ne .Op "edit_post") }}
|
||||||
<div class="create_comment">
|
<div class="create_comment">
|
||||||
{{ template "create_comment.html" .}}
|
{{ template "create_comment.html" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end}}
|
{{- end}}
|
||||||
{{ if and .User .Activities }}
|
{{- if and .User .Activities }}
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
sorted by:
|
sorted by:
|
||||||
<a {{ if eq .Sort "New"}}class="selected"{{end}} href="{{ .SortBy "New"}}">new</a>
|
<a {{ if eq .Sort "New"}}class="selected"{{end}} href="{{ .SortBy "New"}}">new</a>
|
||||||
|
@ -100,48 +99,46 @@
|
||||||
<a {{ if eq .Sort "Controversial"}}class="selected"{{end}} href="{{ .SortBy "Controversial"}}">controversial</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>
|
<a {{ if eq .Sort "Old"}}class="selected"{{end}} href="{{ .SortBy "Old"}}">old</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range $i, $comment := .Comments }}
|
||||||
{{ range $i, $comment := .Comments }}
|
|
||||||
{{ template "comment.html" $comment }}
|
{{ template "comment.html" $comment }}
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{ if and .Comments .Posts (gt (index .Posts 0).Counts.Comments .CommentCount) (not .CommentID)}}
|
{{- if and .Comments .Posts (gt (index .Posts 0).Counts.Comments .CommentCount) (not .CommentID)}}
|
||||||
<div class="morecomments">
|
<div class="morecomments">
|
||||||
<a id="lmc" href="" data-page="2">load more comments</a>
|
<a id="lmc" href="" data-page="2">load more comments</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{ if eq .Op "send_message" }}
|
{{- if eq .Op "send_message" }}
|
||||||
{{ template "send_message.html" . }}
|
{{ template "send_message.html" . }}
|
||||||
{{ else }}
|
{{- else }}
|
||||||
{{ template "activities.html" . }}
|
{{ template "activities.html" . }}
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{ range .Communities }}
|
{{- range .Communities }}
|
||||||
{{ template "community.html" . }}
|
{{ template "community.html" . }}
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{ if or (and (not .Op) (not .Activities) (not .Comments) (not .Posts) (not .Communities)) (and (not .Comments) .PostID) (and (not .Activities) (not .Query) .User) }}
|
{{- 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>
|
<div class="error">there doesn't seem to be anything here</div>
|
||||||
{{ end }}
|
{{- 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))) }}
|
{{- 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">
|
<div class="pager">
|
||||||
view more: {{if gt .Page 1 }}<a href="{{ .PrevPage }}">‹ prev</a>{{ end }} <a href="{{ .NextPage }}">next ›</a>
|
view more: {{if gt .Page 1 }}<a href="{{ .PrevPage }}">‹ prev</a>{{ end }} <a href="{{ .NextPage }}">next ›</a>
|
||||||
</div>
|
</div>
|
||||||
{{ if not .PostID }}
|
{{- if not .PostID }}
|
||||||
<input id="loadmore" type="submit" value="load more" data-page="2">
|
<input id="loadmore" type="submit" value="load more" data-page="2">
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
||||||
<script src="/_/static/utils.js?v={{ .Version }}"></script>
|
<script src="/_/static/utils.js?v={{ .Version }}"></script>
|
||||||
{{ if .Watch }}
|
{{- if .Watch }}
|
||||||
<script src="/_/static/ws.js"></script>
|
<script src="/_/static/ws.js"></script>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ template "sidebar.html" . }}
|
{{- template "sidebar.html" . }}
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,29 +1,28 @@
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
listing:
|
listing:
|
||||||
<a href="{{ .ListBy "All"}}" {{if eq .Listing "All"}}class="selected"{{end}}>all</a>
|
<a href="{{ .ListBy "All"}}" {{if eq .Listing "All"}}class="selected"{{end}}>all</a>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a href="{{ .ListBy "Local"}}" {{if eq .Listing "Local"}}class="selected"{{end}}>local</a>
|
<a href="{{ .ListBy "Local"}}" {{if eq .Listing "Local"}}class="selected"{{end}}>local</a>
|
||||||
{{ if .Session }}
|
{{- if .Session }}
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a href="{{ .ListBy "Subscribed"}}" {{if eq .Listing "Subscribed"}}class="selected"{{end}}>subscribed</a>
|
<a href="{{ .ListBy "Subscribed"}}" {{if eq .Listing "Subscribed"}}class="selected"{{end}}>subscribed</a>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ if contains .Sort "Top" }}
|
{{- if contains .Sort "Top" }}
|
||||||
links from past:
|
links from past:
|
||||||
<a {{ if eq .Sort "TopHour"}}class="selected"{{end}} href="{{ .SortBy "TopHour"}}">1h</a>
|
<a {{ if eq .Sort "TopHour"}}class="selected"{{end}} href="{{ .SortBy "TopHour"}}">1h</a>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a {{ if eq .Sort "TopSixHour"}}class="selected"{{end}} href="{{ .SortBy "TopSixHour"}}">6h</a>
|
<a {{ if eq .Sort "TopSixHour"}}class="selected"{{end}} href="{{ .SortBy "TopSixHour"}}">6h</a>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a {{ if eq .Sort "TopTwelveHour"}}class="selected"{{end}} href="{{ .SortBy "TopTwelveHour"}}">12h</a>
|
<a {{ if eq .Sort "TopTwelveHour"}}class="selected"{{end}} href="{{ .SortBy "TopTwelveHour"}}">12h</a>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a {{ if eq .Sort "TopDay"}}class="selected"{{end}} href="{{ .SortBy "TopDay"}}">day</a>
|
<a {{ if eq .Sort "TopDay"}}class="selected"{{end}} href="{{ .SortBy "TopDay"}}">day</a>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a {{ if eq .Sort "TopWeek"}}class="selected"{{end}} href="{{ .SortBy "TopWeek"}}">week</a>
|
<a {{ if eq .Sort "TopWeek"}}class="selected"{{end}} href="{{ .SortBy "TopWeek"}}">week</a>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a {{ if eq .Sort "TopMonth"}}class="selected"{{end}} href="{{ .SortBy "TopMonth"}}">month</a>
|
<a {{ if eq .Sort "TopMonth"}}class="selected"{{end}} href="{{ .SortBy "TopMonth"}}">month</a>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a {{ if eq .Sort "TopYear"}}class="selected"{{end}} href="{{ .SortBy "TopYear"}}">year</a>
|
<a {{ if eq .Sort "TopYear"}}class="selected"{{end}} href="{{ .SortBy "TopYear"}}">year</a>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a {{ if eq .Sort "TopAll"}}class="selected"{{end}} href="{{ .SortBy "TopAll"}}">all time</a>
|
<a {{ if eq .Sort "TopAll"}}class="selected"{{end}} href="{{ .SortBy "TopAll"}}">all time</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,44 +1,38 @@
|
||||||
{{ $state := . }}
|
{{- $state := . -}}
|
||||||
<nav>
|
<nav>
|
||||||
<div class="communities">
|
<div class="communities">
|
||||||
{{ if .Session }}
|
{{- if .Session }}
|
||||||
<a id="openmycommunities" href="/{{.Host}}/search?searchtype=Communities&listingType=Subscribed&page=0">my communities ▼</a>
|
<a id="openmycommunities" href="/{{.Host}}/search?searchtype=Communities&listingType=Subscribed&page=0">my communities ▼</a>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<a href="/{{.Host}}">home</a>
|
<a href="/{{.Host}}">home</a>
|
||||||
<span> - </span>
|
<span> - </span>
|
||||||
<a href="/{{.Host}}?listingType=All">all</a>
|
<a href="/{{.Host}}?listingType=All">all</a>|
|
||||||
|
|
{{- $host := .Host -}}
|
||||||
{{ $host := .Host }}
|
{{- range $i, $c := .TopCommunities}}
|
||||||
{{ range $i, $c := .TopCommunities}}
|
{{- if or (ne $state.Listing "Local") $c.Community.Local }}
|
||||||
{{ if or (ne $state.Listing "Local") $c.Community.Local }}
|
<a href="/{{$host}}/c/{{fullcname $c.Community}}">{{$c.Community.Name}}</a><span> - </span>
|
||||||
<a href="/{{$host}}/c/{{fullcname $c.Community}}">{{$c.Community.Name}}</a>
|
{{- end }}
|
||||||
<span> - </span>
|
{{- end }}
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
<a href="/{{$host}}/search?searchtype=Communities&sort=TopAll{{ if eq .Listing "Local" }}&listingType=Local{{end}}" class="more">more »</a>
|
<a href="/{{$host}}/search?searchtype=Communities&sort=TopAll{{ if eq .Listing "Local" }}&listingType=Local{{end}}" class="more">more »</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="mycommunities">
|
<div id="mycommunities">
|
||||||
{{- if and .Session .Session.Communities }}
|
{{- if and .Session .Session.Communities }}
|
||||||
<a href="/{{.Host}}/search?searchtype=Communities&listingType=Subscribed&page=0">view all »</a>
|
<a href="/{{.Host}}/search?searchtype=Communities&listingType=Subscribed&page=0">view all »</a>
|
||||||
{{ range .Session.Communities }}
|
{{- range .Session.Communities }}
|
||||||
<a href="/{{ $state.Host}}/{{ if .Community.Local }}c/{{.Community.Name}}{{else}}{{ localize .Community.ActorID }}{{end}}">{{fullcname .Community }}</a>
|
<a href="/{{ $state.Host}}/{{ if .Community.Local }}c/{{.Community.Name}}{{else}}{{ localize .Community.ActorID }}{{end}}">{{fullcname .Community }}</a>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
{{ if .Session }}
|
{{- if .Session }}
|
||||||
<a href="/{{.Host}}/u/{{ .Session.UserName}}">{{ .Session.UserName }}</a>
|
<a href="/{{.Host}}/u/{{ .Session.UserName}}">{{ .Session.UserName }}</a>|
|
||||||
|
|
<a href="/{{.Host}}/inbox" class="mailbox{{ if .UnreadCount }} orangered{{end}}">✉</a>|
|
||||||
<a href="/{{.Host}}/inbox" class="mailbox{{ if .UnreadCount }} orangered{{end}}">✉</a>
|
<a id="opensettings" href="/{{.Host}}/settings">settings</a>|
|
||||||
|
|
|
||||||
<a id="opensettings" href="/{{.Host}}/settings">settings</a>
|
|
||||||
|
|
|
||||||
<form method="POST"><input type="submit" name="op" value="logout"></form>
|
<form method="POST"><input type="submit" name="op" value="logout"></form>
|
||||||
{{else}}
|
{{- else}}
|
||||||
<a href="/{{.Host}}/login">log in</a> or <a href="/{{.Host}}/login">sign up</a>
|
<a href="/{{.Host}}/login">log in</a> or <a href="/{{.Host}}/login">sign up</a>|
|
||||||
|
|
|
||||||
<a id="opensettings" href="/{{.Host}}/settings">settings</a>
|
<a id="opensettings" href="/{{.Host}}/settings">settings</a>
|
||||||
{{end}}
|
{{- end}}
|
||||||
</div>
|
</div>
|
||||||
<div id="settingspopup"></div>
|
<div id="settingspopup"></div>
|
||||||
<div class="spacer">
|
<div class="spacer">
|
||||||
|
@ -82,14 +76,13 @@
|
||||||
<li{{ if eq .Sort "MostComments" }} class="selected"{{end}}><a href="{{ .SortBy "MostComments" }}">most comments</a></li>
|
<li{{ if eq .Sort "MostComments" }} class="selected"{{end}}><a href="{{ .SortBy "MostComments" }}">most comments</a></li>
|
||||||
<li{{ if eq .Sort "NewComments" }} class="selected"{{end}}><a href="{{ .SortBy "NewComments" }}">new comments</a></li>
|
<li{{ if eq .Sort "NewComments" }} class="selected"{{end}}><a href="{{ .SortBy "NewComments" }}">new comments</a></li>
|
||||||
<li{{ if contains .Sort "Top" }} class="selected"{{end}}><a href="{{ .SortBy "TopDay" }}">top</a></li>
|
<li{{ if contains .Sort "Top" }} class="selected"{{end}}><a href="{{ .SortBy "TopDay" }}">top</a></li>
|
||||||
{{ if .Posts }}
|
{{- if .Posts }}
|
||||||
<li id="showimages"><a id="se" href="">show images</a></li>
|
<li id="showimages"><a id="se" href="">show images</a></li>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
{{- if and .PostID }}{{ $post := (index .Posts 0) }}{{ if $post.CrossPosts }}
|
||||||
{{ if and .PostID }}{{ $post := (index .Posts 0) }}{{ if $post.CrossPosts }}
|
|
||||||
<li><a href="/{{.Host}}/search?q={{ $post.Post.URL.String }}&searchtype=Url{{ if not $post.Post.Local }}&listingType=All{{end}}">other discussions ({{ $post.CrossPosts }})</a></li>
|
<li><a href="/{{.Host}}/search?q={{ $post.Post.URL.String }}&searchtype=Url{{ if not $post.Post.Local }}&listingType=All{{end}}">other discussions ({{ $post.CrossPosts }})</a></li>
|
||||||
{{ end }}{{ end }}
|
{{- end }}{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
{{ if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
|
{{- if and (ne .State.Op "vote_post") (ne .State.Op "save_post") -}}
|
||||||
<div class="post{{if .Post.Deleted}} deleted{{end}}{{ if .Post.FeaturedCommunity }} distinguished{{end}}{{if .Post.FeaturedLocal }} announcement{{end}}" id="p{{.Post.ID}}">
|
<div class="post{{if .Post.Deleted}} deleted{{end}}{{ if .Post.FeaturedCommunity }} distinguished{{end}}{{if .Post.FeaturedLocal }} announcement{{end}}" id="p{{.Post.ID}}">
|
||||||
{{ if gt .Rank 0 }}
|
{{- if gt .Rank 0 }}
|
||||||
<div class="rank"> {{ .Rank }} </div>
|
<div class="rank"> {{ .Rank }} </div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<div class="score">
|
<div class="score">
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ if or (ne .State.Op "save_post") (eq .State.Op "vote_post") }}
|
{{- if or (ne .State.Op "save_post") (eq .State.Op "vote_post") }}
|
||||||
{{ if .State.Session }}
|
{{- if .State.Session }}
|
||||||
<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">
|
<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">
|
||||||
<input type="submit" name="vote" value="▲">
|
<input type="submit" name="vote" value="▲">
|
||||||
{{ if .MyVote.IsValid}}
|
{{- if .MyVote.IsValid}}
|
||||||
<input type="hidden" name="undo" value="{{.MyVote.String}}">
|
<input type="hidden" name="undo" value="{{.MyVote.String}}">
|
||||||
{{ end}}
|
{{ end}}
|
||||||
<input type="hidden" name="op" value="vote_post">
|
<input type="hidden" name="op" value="vote_post">
|
||||||
|
@ -17,27 +17,25 @@
|
||||||
<div>{{ .Counts.Score }}</div>
|
<div>{{ .Counts.Score }}</div>
|
||||||
<input type="submit" name="vote" value="▼">
|
<input type="submit" name="vote" value="▼">
|
||||||
</form>
|
</form>
|
||||||
{{ else }}
|
{{- else }}
|
||||||
<div style="margin-top: 19px;">{{ .Counts.Score }}</div>
|
<div style="margin-top: 19px;">{{ .Counts.Score }}</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
|
{{- if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
|
||||||
</div>
|
</div>
|
||||||
{{ if not .State.HideThumbnails }}
|
{{ if not .State.HideThumbnails }}
|
||||||
<div class="thumb">
|
<div class="thumb">
|
||||||
<a class="url"
|
<a class="url" href="{{ if .Post.URL.IsValid }}{{ .Post.URL }}{{ else }}/{{ .State.Host }}/post/{{ .Post.ID }}{{ end }}"
|
||||||
href="{{ if .Post.URL.IsValid }}{{ .Post.URL }}{{ else }}/{{ .State.Host }}/post/{{ .Post.ID }}{{ end }}"
|
{{- if .State.LinksInNewWindow }} target="_blank" {{ 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>
|
||||||
<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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="entry">
|
<div class="entry">
|
||||||
<div class="title{{ if .Read}} visited{{end}}">
|
<div class="title{{ if .Read}} visited{{end}}">
|
||||||
<a class="url"
|
<a class="url" href="{{ if .Post.URL.IsValid }}{{ .Post.URL }}{{ else }}/{{ .State.Host }}/post/{{ .Post.ID }}{{ end }}"
|
||||||
href="{{ if .Post.URL.IsValid }}{{ .Post.URL }}{{ else }}/{{ .State.Host }}/post/{{ .Post.ID }}{{ end }}"
|
{{- if .State.LinksInNewWindow }} target="_blank" {{ end }}>
|
||||||
{{ if .State.LinksInNewWindow }} target="_blank" {{ end }}>
|
{{ rmmarkdown .Post.Name }}
|
||||||
{{ rmmarkdown .Post.Name }}
|
|
||||||
</a>
|
</a>
|
||||||
({{ domain . }})
|
({{ domain . }})
|
||||||
</div>
|
</div>
|
||||||
|
@ -66,66 +64,67 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
{{ if .Post.NSFW }}<span class="nsfw">NSFW</span>{{end}}
|
{{- if .Post.NSFW }}
|
||||||
|
<span class="nsfw">NSFW</span>{{end}}
|
||||||
<a href="/{{ .State.Host }}/post/{{ .Post.ID }}">{{ .Counts.Comments }} comments</a>
|
<a href="/{{ .State.Host }}/post/{{ .Post.ID }}">{{ .Counts.Comments }} comments</a>
|
||||||
<a href="{{ .Post.ApID}}">fedilink</a>
|
<a href="{{ .Post.ApID}}">fedilink</a>
|
||||||
{{ if .State.Session }}
|
{{- if .State.Session }}
|
||||||
<a href="/{{ .State.Host }}/post/{{ .Post.ID }}/block" rel="xhr" target="block{{ .Post.ID }}">block</a>
|
<a href="/{{ .State.Host }}/post/{{ .Post.ID }}/block" rel="xhr" target="block{{ .Post.ID }}">block</a>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<span class="blockpopup" name="block{{.Post.ID}}"></span>
|
<span class="blockpopup" name="block{{.Post.ID}}"></span>
|
||||||
{{ if and .State.Session (eq .State.Session.UserID .Post.CreatorID) }}
|
{{- 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}}
|
{{- if not .Post.Deleted }}<a href="/{{ .State.Host }}/post/{{ .Post.ID }}?edit">edit</a>{{end}}
|
||||||
<form class="link-btn" method="POST">
|
<form class="link-btn" method="POST">
|
||||||
<input type="hidden" name="postid" value="{{.Post.ID }}">
|
<input type="hidden" name="postid" value="{{.Post.ID }}">
|
||||||
<input type="hidden" name="op" value="delete_post">
|
<input type="hidden" name="op" value="delete_post">
|
||||||
{{ if .Post.Deleted }}
|
{{- if .Post.Deleted }}
|
||||||
<input type="submit" value="undelete">
|
<input type="submit" value="undelete">
|
||||||
<input type="hidden" name="undo" value="1">
|
<input type="hidden" name="undo" value="1">
|
||||||
{{ else }}
|
{{- else }}
|
||||||
<input type="submit" value="delete">
|
<input type="submit" value="delete">
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</form>
|
</form>
|
||||||
{{ end}}
|
{{- end}}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ if or (ne .State.Op "vote_post") (eq .State.Op "save_post") }}
|
{{- if or (ne .State.Op "vote_post") (eq .State.Op "save_post") }}
|
||||||
{{ if .State.Session }}
|
{{- if .State.Session }}
|
||||||
<form class="link-btn" method="POST">
|
<form class="link-btn" method="POST">
|
||||||
<input type="hidden" name="postid" value="{{.Post.ID }}">
|
<input type="hidden" name="postid" value="{{.Post.ID }}">
|
||||||
<input type="hidden" name="op" value="save_post">
|
<input type="hidden" name="op" value="save_post">
|
||||||
{{ if .PostView.Saved }}
|
{{- if .PostView.Saved }}
|
||||||
<input type="submit" name="submit" value="unsave">
|
<input type="submit" name="submit" value="unsave">
|
||||||
{{ else }}
|
{{- else }}
|
||||||
<input type="submit" name="submit" value="save">
|
<input type="submit" name="submit" value="save">
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{- end}}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
|
{{- if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
|
||||||
{{ if .State.PostID }}
|
{{- if .State.PostID }}
|
||||||
<a id="hidechildren" class="scripting" href="">hide all child comments</a>
|
<a id="hidechildren" class="scripting" href="">hide all child comments</a>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ if and .State.Site .State.Site.MyUser.IsValid (not .State.Site.MyUser.ValueOrZero.LocalUserView.LocalUser.ShowReadPosts) }}
|
{{- if and .State.Site .State.Site.MyUser.IsValid (not .State.Site.MyUser.ValueOrZero.LocalUserView.LocalUser.ShowReadPosts) }}
|
||||||
<form class="link-btn" method="POST">
|
<form class="link-btn" method="POST">
|
||||||
<input type="hidden" name="postid" value="{{.Post.ID }}">
|
<input type="hidden" name="postid" value="{{.Post.ID }}">
|
||||||
<input type="hidden" name="op" value="read_post">
|
<input type="hidden" name="op" value="read_post">
|
||||||
{{ if .Post.Deleted }}
|
{{- if .Post.Deleted }}
|
||||||
<input type="submit" name="submit" value="mark unread">
|
<input type="submit" name="submit" value="mark unread">
|
||||||
{{ else }}
|
{{- else }}
|
||||||
<input type="submit" name="submit" value="mark read">
|
<input type="submit" name="submit" value="mark read">
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</form>
|
</form>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="expando{{ if eq .Rank 0 }} open{{ end}}">
|
<div class="expando{{ if eq .Rank 0 }} open{{ end}}">
|
||||||
{{ if (and .Post.Body.IsValid (ne .Post.Body.String "")) }}
|
{{- if (and .Post.Body.IsValid (ne .Post.Body.String "")) }}
|
||||||
<div class="md">{{ markdown .State.Host .Post.Body.String }}</div>
|
<div class="md">{{ markdown .State.Host .Post.Body.String }}</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ if isImage .Post.URL.String}}
|
{{- if isImage .Post.URL.String}}
|
||||||
<img class="image" loading="lazy" src="{{ .Post.URL }}">
|
<img class="image" loading="lazy" src="{{ .Post.URL }}">
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<div class="embed"></div>
|
<div class="embed"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearleft"></div>
|
<div class="clearleft"></div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
{{ $host := .Host }}
|
{{- $host := .Host }}
|
||||||
<div class="{{ if .User }}user {{end}}side">
|
<div class="{{ if .User }}user {{end}}side">
|
||||||
|
|
||||||
<form method="GET" action="/{{.Host}}/search">
|
<form method="GET" action="/{{.Host}}/search">
|
||||||
<input type="text" placeholder="search" name="q" value="">
|
<input type="text" placeholder="search" name="q" value="">
|
||||||
{{ if .User }}
|
{{- if .User }}
|
||||||
<input type="hidden" name="username" value="{{.UserName}}">
|
<input type="hidden" name="username" value="{{.UserName}}">
|
||||||
{{ else if .Community }}
|
{{- else if .Community }}
|
||||||
<input type="hidden" name="communityname" value="{{fullcname .Community.CommunityView.Community}}">
|
<input type="hidden" name="communityname" value="{{fullcname .Community.CommunityView.Community}}">
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<input type="hidden" name="sort" value="New">
|
<input type="hidden" name="sort" value="New">
|
||||||
</form>
|
</form>
|
||||||
|
{{- if not .Session -}}
|
||||||
{{ if not .Session -}}
|
|
||||||
<form class="login" method="post">
|
<form class="login" method="post">
|
||||||
<input name="username" type="text" placeholder="username" maxlength="20">
|
<input name="username" type="text" placeholder="username" maxlength="20">
|
||||||
<input name="password" type="password" placeholder="password">
|
<input name="password" type="password" placeholder="password">
|
||||||
|
@ -19,79 +17,80 @@
|
||||||
<input type="submit" name="op" value="login">
|
<input type="submit" name="op" value="login">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{ if .User }}
|
{{- if .User }}
|
||||||
<h1>{{ .User.PersonView.Person.Name }}</h1>
|
<h1>{{ .User.PersonView.Person.Name }}</h1>
|
||||||
{{ if .Session }}
|
{{- if .Session }}
|
||||||
<div>
|
<div>
|
||||||
<form method="POST" class="block {{ if .UserBlocked }}unblock{{end}}">
|
<form method="POST" class="block {{ if .UserBlocked }}unblock{{end}}">
|
||||||
<input name="submit" type="submit" value="{{ if .UserBlocked}}unblock{{else}}block{{end}}">
|
<input name="submit" type="submit" value="{{ if .UserBlocked}}unblock{{else}}block{{end}}">
|
||||||
<input type="hidden" name="op" value="block_user">
|
<input type="hidden" name="op" value="block_user">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<div class="age">
|
<div class="age">
|
||||||
{{ if .Session }}<span class="left">✉ <a href="/{{ $host}}/u/{{ fullname .User.PersonView.Person }}/message">send a message</a></span>{{end}}
|
{{- if .Session }}
|
||||||
|
<span class="left">✉ <a href="/{{ $host}}/u/{{ fullname .User.PersonView.Person }}/message">send a message</a></span>
|
||||||
|
{{- end}}
|
||||||
<span title="{{ .User.PersonView.Person.Published.Time}}">joined {{ humanize .User.PersonView.Person.Published.Time }}</span>
|
<span title="{{ .User.PersonView.Person.Published.Time}}">joined {{ humanize .User.PersonView.Person.Published.Time }}</span>
|
||||||
</div>
|
</div>
|
||||||
{{ if .User.Moderates }}
|
{{- if .User.Moderates }}
|
||||||
MODERATOR OF
|
MODERATOR OF
|
||||||
<div class="moderators">
|
<div class="moderators">
|
||||||
{{ range $i, $mod := .User.Moderates }}
|
{{- range $i, $mod := .User.Moderates }}
|
||||||
<div><a href="/{{$host}}/c/{{ fullcname $mod.Community}}">{{ $mod.Community.Name }}</a></div>
|
<div><a href="/{{$host}}/c/{{ fullcname $mod.Community}}">{{ $mod.Community.Name }}</a></div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{ if and .PostID .Posts }}
|
{{- if and .PostID .Posts }}
|
||||||
<div class="stats">
|
<div class="stats">
|
||||||
this post was submitted on {{ (index .Posts 0).Post.Published.Time.Format "02 Jan 2006" }}
|
this post was submitted on {{ (index .Posts 0).Post.Published.Time.Format "02 Jan 2006" }}
|
||||||
<div><b><span>{{ (index .Posts 0).Counts.Score }}</span> points</b> ({{likedPerc (index .Posts 0).Counts}}% liked)</div>
|
<div><b><span>{{ (index .Posts 0).Counts.Score }}</span> points</b> ({{likedPerc (index .Posts 0).Counts}}% liked)</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{ if .Session }}
|
{{- if .Session }}
|
||||||
<div class="create">
|
<div class="create">
|
||||||
<a href="/{{$host}}/create_post{{ if .Community }}?communityname={{.CommunityName}}{{ end }}"><div>Create a post »</div></a>
|
<a href="/{{$host}}/create_post{{ if .Community }}?communityname={{.CommunityName}}{{ end }}"><div>Create a post »</div></a>
|
||||||
{{ if not .Community }}
|
{{ if not .Community }}
|
||||||
<a href="/{{$host}}/create_community"><div>Create a community »</div></a>
|
<a href="/{{$host}}/create_community"><div>Create a community »</div></a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{ if and .Site (not .Community) (not .User) }}
|
{{- if and .Site (not .Community) (not .User) }}
|
||||||
{{ if .Site.SiteView.Site.Banner.IsValid }}
|
{{- if .Site.SiteView.Site.Banner.IsValid }}
|
||||||
<div class="banner" style="background-image: url({{ .Site.SiteView.Site.Banner }})"></div>
|
<div class="banner" style="background-image: url({{ .Site.SiteView.Site.Banner }})"></div>
|
||||||
{{ else if .Site.SiteView.Site.Icon.IsValid }}
|
{{- else if .Site.SiteView.Site.Icon.IsValid }}
|
||||||
<div class="banner" style="background-image: url({{ .Site.SiteView.Site.Icon }})"></div>
|
<div class="banner" style="background-image: url({{ .Site.SiteView.Site.Icon }})"></div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<h1>{{ .Site.SiteView.Site.Name }}</h1>
|
<h1>{{ .Site.SiteView.Site.Name }}</h1>
|
||||||
{{ printer .Site.SiteView.Counts.Users }} readers <br>
|
{{ printer .Site.SiteView.Counts.Users }} readers <br>
|
||||||
<span class="green" title="Users active in the last day"></span>
|
<span class="green" title="Users active in the last day"></span>
|
||||||
{{ printer .Site.SiteView.Counts.UsersActiveDay }} users here now
|
{{ printer .Site.SiteView.Counts.UsersActiveDay }} users here now
|
||||||
{{ markdown .Host .Site.SiteView.Site.Sidebar.String }}
|
{{ markdown .Host .Site.SiteView.Site.Sidebar.String }}
|
||||||
<div class="age" title="{{ .Site.SiteView.Site.Published.Time}}">founded {{ humanize .Site.SiteView.Site.Published.Time }}</div>
|
<div class="age" title="{{ .Site.SiteView.Site.Published.Time}}">founded {{ humanize .Site.SiteView.Site.Published.Time }}</div>
|
||||||
{{ if .Site.Admins }}
|
{{- if .Site.Admins }}
|
||||||
ADMINS
|
ADMINS
|
||||||
<div class="moderators">
|
<div class="moderators">
|
||||||
{{ range $i, $mod := .Site.Admins }}
|
{{- range $i, $mod := .Site.Admins }}
|
||||||
<div><a href="/{{$host}}/u/{{ fullname $mod.Person}}">{{ fullname $mod.Person }}</a></div>
|
<div><a href="/{{$host}}/u/{{ fullname $mod.Person}}">{{ fullname $mod.Person }}</a></div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .Community }}
|
||||||
{{ if .Community }}
|
{{- if .Community.CommunityView.Community.Banner.IsValid }}
|
||||||
{{ if .Community.CommunityView.Community.Banner.IsValid }}
|
|
||||||
<div class="banner" style="background-image: url({{ .Community.CommunityView.Community.Banner }})"></div>
|
<div class="banner" style="background-image: url({{ .Community.CommunityView.Community.Banner }})"></div>
|
||||||
{{ else if .Community.CommunityView.Community.Icon.IsValid }}
|
{{- else if .Community.CommunityView.Community.Icon.IsValid }}
|
||||||
<div class="banner" style="background-image: url({{ .Community.CommunityView.Community.Icon }})"></div>
|
<div class="banner" style="background-image: url({{ .Community.CommunityView.Community.Icon }})"></div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<h1>{{ if ne .Community.CommunityView.Community.Title ""}}{{ .Community.CommunityView.Community.Title }}{{ else }}{{ .Community.CommunityView.Community.Name }}{{end}}</h1>
|
<h1>{{ if ne .Community.CommunityView.Community.Title ""}}{{ .Community.CommunityView.Community.Title }}{{ else }}{{ .Community.CommunityView.Community.Name }}{{end}}</h1>
|
||||||
{{ if .Session }}
|
{{- if .Session }}
|
||||||
<form method="POST" class="member {{ membership .Community.CommunityView.Subscribed }}">
|
<form method="POST" class="member {{ membership .Community.CommunityView.Subscribed }}">
|
||||||
<input name="op" type="submit" value="{{ membership .Community.CommunityView.Subscribed}}">
|
<input name="op" type="submit" value="{{ membership .Community.CommunityView.Subscribed}}">
|
||||||
<input name="communityid" type="hidden" value="{{ .Community.CommunityView.Community.ID }}">
|
<input name="communityid" type="hidden" value="{{ .Community.CommunityView.Community.ID }}">
|
||||||
|
@ -100,32 +99,32 @@
|
||||||
<input name="op" type="submit" value="{{ if .Community.CommunityView.Blocked}}unblock{{else}}block{{end}}">
|
<input name="op" type="submit" value="{{ if .Community.CommunityView.Blocked}}unblock{{else}}block{{end}}">
|
||||||
<input name="communityid" type="hidden" value="{{ .Community.CommunityView.Community.ID }}">
|
<input name="communityid" type="hidden" value="{{ .Community.CommunityView.Community.ID }}">
|
||||||
</form>
|
</form>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<div>
|
<div>
|
||||||
{{ .Community.CommunityView.Counts.Subscribers }} readers
|
{{ .Community.CommunityView.Counts.Subscribers }} readers
|
||||||
</div>
|
</div>
|
||||||
<span class="green" title="Users active in the last day"></span>
|
<span class="green" title="Users active in the last day"></span>
|
||||||
{{ .Community.CommunityView.Counts.UsersActiveDay }} users here now
|
{{ .Community.CommunityView.Counts.UsersActiveDay }} users here now
|
||||||
{{ if and .Session (isMod .Community .Session.UserName) }}
|
{{- if and .Session (isMod .Community .Session.UserName) }}
|
||||||
<p class="gray">you are a moderator of this community</p>
|
<p class="gray">you are a moderator of this community</p>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<p>{{ markdown .Host .Community.CommunityView.Community.Description.String }}</p>
|
<p>{{ markdown .Host .Community.CommunityView.Community.Description.String }}</p>
|
||||||
<div class="age" title="{{ .Community.CommunityView.Counts.Published.Time}}">
|
<div class="age" title="{{ .Community.CommunityView.Counts.Published.Time}}">
|
||||||
founded {{ humanize .Community.CommunityView.Counts.Published.Time }}
|
founded {{ humanize .Community.CommunityView.Counts.Published.Time }}
|
||||||
</div>
|
</div>
|
||||||
{{ if and .Session (isMod .Community .Session.UserName) }}
|
{{- if and .Session (isMod .Community .Session.UserName) }}
|
||||||
MODERATOR TOOLS
|
MODERATOR TOOLS
|
||||||
<div class="moderators">
|
<div class="moderators">
|
||||||
<a href="/{{.Host}}/c/{{.CommunityName}}/edit">community settings</a>
|
<a href="/{{.Host}}/c/{{.CommunityName}}/edit">community settings</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ if .Community.Moderators }}
|
{{- if .Community.Moderators }}
|
||||||
MODERATORS
|
MODERATORS
|
||||||
<div class="moderators">
|
<div class="moderators">
|
||||||
{{ range $i, $mod := .Community.Moderators }}
|
{{ range $i, $mod := .Community.Moderators }}
|
||||||
<div><a href="/{{$host}}/u/{{ fullname $mod.Moderator}}">{{ fullname $mod.Moderator }}</a></div>
|
<div><a href="/{{$host}}/u/{{ fullname $mod.Moderator}}">{{ fullname $mod.Moderator }}</a></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue