diff --git a/templates/comment.html b/templates/comment.html index 6ca608c..7e8a846 100644 --- a/templates/comment.html +++ b/templates/comment.html @@ -1,126 +1,126 @@ -
-
-{{ if .State.Session }} - -{{ end }} -
-
- +
+
+{{- if .State.Session }} + +{{- end }} +
+
+ {{- if or (lt .P.Counts.Score -5) .P.Comment.Deleted -}} - [+] + [+] {{- else -}} - [-] + [-] {{- end -}} - - - {{- if .State.HideInstanceNames -}} - {{ .P.Creator.Name }} - {{- else -}} - {{ fullname .P.Creator }} - {{- end -}} - - {{.P.Counts.Score}} points {{ humanize .P.Comment.Published.Time }} - {{- if gt .P.Comment.Updated.ValueOrZero.Time.Unix .P.Comment.Published.Time.Unix -}} - * (last edited {{ humanize .P.Comment.Updated.ValueOrZero.Time }}) - {{ end }} -
-
-{{ if eq .Op "edit" }} - {{ template "create_comment.html" .State }} -{{ else }} - {{if .P.Comment.Deleted}} - [deleted] - {{else if .P.Comment.Removed }} - [removed by mod] - {{else}} -
- {{ markdown .State.Host .P.Comment.Content }} -
- {{end}} - {{ if eq .Op "source" }} -
- {{end}} -{{ end }} -
    -
  • permalink
  • -
  • fedilink
  • -{{ if ne .Op "source"}} -
  • source
  • -{{ else }} -
  • hide source
  • -{{ end }} -{{ if .State.Session }} - {{ if and (eq .P.Comment.CreatorID .State.Session.UserID) (ne .Op "edit") }} -
  • edit
  • - {{ if not .P.Comment.Deleted }} -
  • -
    - - - -
    -
  • - {{ end }} - {{ end }} -
  • - -
  • -
  • - -
  • -
  • - - reply -
  • -{{ end }} -{{ if and .ParentID .State.CommentID (not .State.XHR) }} -
  • - parent -
  • -{{ end }} -{{ if and .ParentID (or .State.Activities .State.Query) }} -
  • - context -
  • -{{ end }} -{{ if and .State.PostID (gt (add .P.Counts.ChildCount .ChildCount) 0) }} -
  • hideshow {{add .P.Counts.ChildCount .ChildCount }} child comments
  • -{{ end }} -
-
-
-{{ 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) }} -
- load more comments - ({{ sub .P.Counts.ChildCount .ChildCount}} replies) + + {{- if .State.HideInstanceNames -}} + {{ .P.Creator.Name }} + {{- else -}} + {{ fullname .P.Creator }} + {{- end -}} + + {{.P.Counts.Score}} points {{ humanize .P.Comment.Published.Time }} + {{- if gt .P.Comment.Updated.ValueOrZero.Time.Unix .P.Comment.Published.Time.Unix -}} + * (last edited {{ humanize .P.Comment.Updated.ValueOrZero.Time }}) + {{ end }} +
+
+{{- if eq .Op "edit" }} + {{ template "create_comment.html" .State }} +{{- else }} + {{- if .P.Comment.Deleted}} + [deleted] + {{- else if .P.Comment.Removed }} + [removed by mod] + {{- else}} +
+ {{ markdown .State.Host .P.Comment.Content }} +
+ {{- end}} + {{- if eq .Op "source" }} +
+ {{- end}} +{{- end }} +
    +
  • permalink
  • +
  • fedilink
  • +{{- if ne .Op "source"}} +
  • source
  • +{{- else }} +
  • hide source
  • +{{- end }} +{{- if .State.Session }} + {{- if and (eq .P.Comment.CreatorID .State.Session.UserID) (ne .Op "edit") }} +
  • edit
  • + {{- if not .P.Comment.Deleted }} +
  • +
    + + + +
    +
  • + {{- end }} + {{- end }} +
  • + +
  • +
  • + +
  • +
  • + + reply + +
  • +{{- end }} +{{- if and .ParentID .State.CommentID (not .State.XHR) }} +
  • + parent +
  • +{{- end }} +{{- if and .ParentID (or .State.Activities .State.Query) }} +
  • + context +
  • +{{- end }} +{{- if and .State.PostID (gt (add .P.Counts.ChildCount .ChildCount) 0) }} +
  • hideshow {{add .P.Counts.ChildCount .ChildCount }} child comments
  • +{{- end }} +
+
+
+{{- 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) }} +
+ load more comments + ({{ sub .P.Counts.ChildCount .ChildCount}} replies) +
+{{- end}} +
-{{end}} -
-
diff --git a/templates/create_comment.html b/templates/create_comment.html index ae0e02e..476a3f8 100644 --- a/templates/create_comment.html +++ b/templates/create_comment.html @@ -3,43 +3,43 @@ {{- else }} action="/{{.Host}}/post/{{.PostID}}" {{- end -}} > -
- -
-
- +
+ {{- if eq .Op "edit" }} + + + {{- else }} + + {{- end }} + + + {{- if or .Op .Content }} + + {{- end }} +
+ formatting help + +
{{- if .Content }} - {{- .Content -}} - {{ else if and (eq .Op "edit") .Comments }} - {{- (index .Comments 0).P.Comment.Content -}} - {{ end -}} - -
- {{ if eq .Op "edit" }} - - - {{ else }} - - {{ end }} - - - {{ if or .Op .Content }} - - {{ end }} -
- formatting help - -
- {{ if .Content }} -
-
-

Preview

-
- {{ markdown .Host .Content }} +
+
+

Preview

+
+ {{ markdown .Host .Content }} +
-
- {{ end }} - + {{- end }} + diff --git a/templates/frontpage.html b/templates/frontpage.html index 42c5f52..5797cda 100644 --- a/templates/frontpage.html +++ b/templates/frontpage.html @@ -12,18 +12,18 @@ - {{ template "nav.html" . -}} -{{ if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }} - {{ template "nsfw.html" }} -{{ else }} + {{- if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }} + {{ template "nsfw.html" }} + {{- else }}
- {{ if and (not .Community) .Tagline }} -

{{ markdown .Host .Tagline }}

- {{ end }} - {{ template "menu.html" . }} - - {{ if .Error }} + {{- if and (not .Community) .Tagline }} +

+ {{ markdown .Host .Tagline }} +

+ {{- end }} + {{ template "menu.html" . }} + {{- if .Error }}
{{.Error}}. {{ if .Unknown }} @@ -32,16 +32,14 @@
{{ end }} - {{ range .Posts }} + {{- range .Posts }} {{ template "post.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) }} + {{- if or (and (not .Op) (not .Activities) (not .Comments) (not .Posts) (not .Communities)) (and (not .Comments) .PostID) (and (not .Activities) (not .Query) .User) }}
there doesn't seem to be anything here
{{ 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))) }}
view more: {{if gt .Page 1 }}‹ prev{{ end }} next ›
diff --git a/templates/main.html b/templates/main.html index 158d102..8774116 100644 --- a/templates/main.html +++ b/templates/main.html @@ -12,17 +12,16 @@ - {{ template "nav.html" . -}} -{{ if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }} - {{ template "nsfw.html" }} -{{ else }} + {{- if and (not .ShowNSFW) .Community .Community.CommunityView.Community.NSFW }} + {{ template "nsfw.html" }} + {{- else }}
- {{ if or (.Query) (.SearchType) (and (not .PostID) (not .User) (not .Activities) (eq .Op ""))}} - {{ template "menu.html" . }} - {{ end}} + {{- if or (.Query) (.SearchType) (and (not .PostID) (not .User) (not .Activities) (eq .Op ""))}} + {{ template "menu.html" . }} + {{- end}} - {{ if or (ne .SearchType "") (ne .Query "") .Communities }} + {{- if or (ne .SearchType "") (ne .Query "") .Communities }}
- {{ end}} + {{- end}} - {{ if .Error }} + {{- if .Error }}
{{.Error}}. {{ if .Unknown }} @@ -56,26 +55,26 @@
{{ end }} - {{ if eq .Op "create_community" "edit_community" }} + {{- if eq .Op "create_community" "edit_community" }} {{ template "create_community.html" . }} - {{ end }} + {{- end }} - {{ range .Posts }} + {{- range .Posts }} {{ template "post.html" . }} - {{ end }} + {{- end }} - {{ if eq .Op "create_post" "edit_post" }} + {{- if eq .Op "create_post" "edit_post" }} {{ template "create_post.html" . }} - {{ end }} + {{- end }} - {{ if and .PostID .Posts}} - {{ if .CommentID}} + {{- if and .PostID .Posts}} + {{- if .CommentID}}
you are viewing a single comment's thread
view the rest of the comments
- {{ else }} + {{- else }}
- {{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}}
sorted by: hot @@ -85,14 +84,14 @@ old
- {{ if and .Session (ne .Op "edit_post") }} + {{- if and .Session (ne .Op "edit_post") }}
- {{ template "create_comment.html" .}} + {{ template "create_comment.html" . }}
- {{ end }} - {{ end }} - {{ end}} - {{ if and .User .Activities }} + {{- end }} + {{- end }} + {{- end}} + {{- if and .User .Activities }} - {{ end }} + {{- end -}} - - {{ range $i, $comment := .Comments }} + {{- range $i, $comment := .Comments }} {{ 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)}}
load more comments
- {{ end }} + {{- end -}} - {{ if eq .Op "send_message" }} + {{- if eq .Op "send_message" }} {{ template "send_message.html" . }} - {{ else }} + {{- else }} {{ template "activities.html" . }} - {{ end }} + {{- end -}} - {{ range .Communities }} + {{- range .Communities }} {{ 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) }}
there doesn't seem to be anything here
- {{ 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))) }}
view more: {{if gt .Page 1 }}‹ prev{{ end }} next ›
- {{ if not .PostID }} + {{- if not .PostID }} - {{ end }} - {{ end }} - + {{- end }} + {{- end }} - {{ if .Watch }} + {{- if .Watch }} - {{ end }} - {{ template "sidebar.html" . }} + {{- end }} + {{- template "sidebar.html" . }} -{{ end }} +{{- end }} diff --git a/templates/menu.html b/templates/menu.html index c6b0141..3f20487 100644 --- a/templates/menu.html +++ b/templates/menu.html @@ -1,29 +1,28 @@ - + diff --git a/templates/nav.html b/templates/nav.html index c36feab..98373f5 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,44 +1,38 @@ -{{ $state := . }} +{{- $state := . -}} diff --git a/templates/post.html b/templates/post.html index 86ec934..7da3256 100644 --- a/templates/post.html +++ b/templates/post.html @@ -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") -}}
- {{ if gt .Rank 0 }} + {{- if gt .Rank 0 }}
{{ .Rank }}
- {{ end }} -
-{{ end }} -{{ if or (ne .State.Op "save_post") (eq .State.Op "vote_post") }} -{{ if .State.Session }} + {{- end }} +
+{{- end }} +{{- if or (ne .State.Op "save_post") (eq .State.Op "vote_post") }} +{{- if .State.Session }} -{{ else }} +{{- else }}
{{ .Counts.Score }}
-{{ end }} -{{ end }} -{{ if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }} +{{- end }} +{{- end }} +{{- if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }}
{{ if not .State.HideThumbnails }} {{ end }}
@@ -66,66 +64,67 @@
- {{ if .Post.NSFW }}NSFW{{end}} + {{- if .Post.NSFW }} + NSFW{{end}} {{ .Counts.Comments }} comments fedilink - {{ if .State.Session }} + {{- if .State.Session }} block - {{ end }} + {{- end }} - {{ if and .State.Session (eq .State.Session.UserID .Post.CreatorID) }} - {{ if not .Post.Deleted }}edit{{end}} + {{- if and .State.Session (eq .State.Session.UserID .Post.CreatorID) }} + {{- if not .Post.Deleted }}edit{{end}} - {{ end}} -{{ end }} -{{ if or (ne .State.Op "vote_post") (eq .State.Op "save_post") }} - {{ if .State.Session }} + {{- end}} +{{- end }} +{{- if or (ne .State.Op "vote_post") (eq .State.Op "save_post") }} + {{- if .State.Session }} - {{end}} -{{ end }} -{{ if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }} - {{ if .State.PostID }} + {{- end}} +{{- end }} +{{- if and (ne .State.Op "vote_post") (ne .State.Op "save_post") }} + {{- if .State.PostID }} hide all child comments - {{ end }} - {{ if and .State.Site .State.Site.MyUser.IsValid (not .State.Site.MyUser.ValueOrZero.LocalUserView.LocalUser.ShowReadPosts) }} + {{- end }} + {{- if and .State.Site .State.Site.MyUser.IsValid (not .State.Site.MyUser.ValueOrZero.LocalUserView.LocalUser.ShowReadPosts) }} - {{ end }} + {{- end }}
-{{ if (and .Post.Body.IsValid (ne .Post.Body.String "")) }} +{{- if (and .Post.Body.IsValid (ne .Post.Body.String "")) }}
{{ markdown .State.Host .Post.Body.String }}
-{{ end }} -{{ if isImage .Post.URL.String}} +{{- end }} +{{- if isImage .Post.URL.String}} -{{ end }} +{{- end }}
-
+
-{{ end }} +{{- end -}} diff --git a/templates/sidebar.html b/templates/sidebar.html index 2fdf1ae..3069e01 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -1,17 +1,15 @@ -{{ $host := .Host }} +{{- $host := .Host }}
-
- {{ if .User }} + {{- if .User }} - {{ else if .Community }} + {{- else if .Community }} - {{ end }} + {{- end }}
- -{{ if not .Session -}} +{{- if not .Session -}}
-{{ end }} +{{- end -}} -{{ if .User }} +{{- if .User }}

{{ .User.PersonView.Person.Name }}

- {{ if .Session }} + {{- if .Session }}
- {{ end }} + {{- end }}
- {{ if .Session }}send a message{{end}} + {{- if .Session }} + send a message + {{- end}} joined {{ humanize .User.PersonView.Person.Published.Time }}
- {{ if .User.Moderates }} + {{- if .User.Moderates }} MODERATOR OF
- {{ range $i, $mod := .User.Moderates }} + {{- range $i, $mod := .User.Moderates }}
{{ $mod.Community.Name }}
- {{ end }} + {{- end }}
- {{ end }} -{{ end }} + {{- end }} +{{- end -}} -{{ if and .PostID .Posts }} +{{- if and .PostID .Posts }}
this post was submitted on {{ (index .Posts 0).Post.Published.Time.Format "02 Jan 2006" }}
{{ (index .Posts 0).Counts.Score }} points ({{likedPerc (index .Posts 0).Counts}}% liked)
-{{ end }} +{{- end -}} -{{ if .Session }} +{{- if .Session }}
Create a post »
{{ if not .Community }}
Create a community »
{{ end }}
-{{ end }} +{{- end -}} -{{ if and .Site (not .Community) (not .User) }} - {{ if .Site.SiteView.Site.Banner.IsValid }} +{{- if and .Site (not .Community) (not .User) }} + {{- if .Site.SiteView.Site.Banner.IsValid }} - {{ else if .Site.SiteView.Site.Icon.IsValid }} + {{- else if .Site.SiteView.Site.Icon.IsValid }} - {{ end }} + {{- end }}

{{ .Site.SiteView.Site.Name }}

{{ printer .Site.SiteView.Counts.Users }} readers
{{ printer .Site.SiteView.Counts.UsersActiveDay }} users here now {{ markdown .Host .Site.SiteView.Site.Sidebar.String }}
founded {{ humanize .Site.SiteView.Site.Published.Time }}
- {{ if .Site.Admins }} + {{- if .Site.Admins }} ADMINS
- {{ range $i, $mod := .Site.Admins }} + {{- range $i, $mod := .Site.Admins }}
{{ fullname $mod.Person }}
- {{ end }} + {{- end }}
- {{ end }} -{{ end }} + {{- end }} +{{- end -}} - -{{ if .Community }} - {{ if .Community.CommunityView.Community.Banner.IsValid }} +{{- if .Community }} + {{- if .Community.CommunityView.Community.Banner.IsValid }} - {{ else if .Community.CommunityView.Community.Icon.IsValid }} + {{- else if .Community.CommunityView.Community.Icon.IsValid }} - {{ end }} + {{- end }}

{{ if ne .Community.CommunityView.Community.Title ""}}{{ .Community.CommunityView.Community.Title }}{{ else }}{{ .Community.CommunityView.Community.Name }}{{end}}

- {{ if .Session }} + {{- if .Session }}
@@ -100,32 +99,32 @@
- {{ end }} + {{- end }}
{{ .Community.CommunityView.Counts.Subscribers }} readers
{{ .Community.CommunityView.Counts.UsersActiveDay }} users here now - {{ if and .Session (isMod .Community .Session.UserName) }} + {{- if and .Session (isMod .Community .Session.UserName) }}

you are a moderator of this community

- {{ end }} + {{- end }}

{{ markdown .Host .Community.CommunityView.Community.Description.String }}

founded {{ humanize .Community.CommunityView.Counts.Published.Time }}
- {{ if and .Session (isMod .Community .Session.UserName) }} + {{- if and .Session (isMod .Community .Session.UserName) }} MODERATOR TOOLS
community settings
- {{ end }} - {{ if .Community.Moderators }} + {{- end }} + {{- if .Community.Moderators }} MODERATORS
{{ range $i, $mod := .Community.Moderators }}
{{ fullname $mod.Moderator }}
{{ end }}
- {{ end }} -{{ end }} + {{- end }} +{{- end }}