From 48fefb76c0a908cc3fa00abc9c090ce3ac8cb560 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 24 Oct 2021 10:40:45 -0700 Subject: gofiber conversion, index, board posts, board post hooked up --- views/partials/bottom.html | 48 +++++++++++++++ views/partials/footer.html | 13 ++++ views/partials/posts.html | 122 ++++++++++++++++++++++++++++++++++++++ views/partials/postscripts.html | 3 + views/partials/top.html | 128 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 314 insertions(+) create mode 100644 views/partials/bottom.html create mode 100644 views/partials/footer.html create mode 100644 views/partials/posts.html create mode 100644 views/partials/postscripts.html create mode 100644 views/partials/top.html (limited to 'views/partials') diff --git a/views/partials/bottom.html b/views/partials/bottom.html new file mode 100644 index 0000000..35e8c4a --- /dev/null +++ b/views/partials/bottom.html @@ -0,0 +1,48 @@ + + + diff --git a/views/partials/footer.html b/views/partials/footer.html new file mode 100644 index 0000000..efbde4f --- /dev/null +++ b/views/partials/footer.html @@ -0,0 +1,13 @@ +
+ [Home] [Rules] [FAQ] +

All trademarks and copyrights on this page are owned by their respective parties.

+
+ +
+ Theme: + +
diff --git a/views/partials/posts.html b/views/partials/posts.html new file mode 100644 index 0000000..f82d2d5 --- /dev/null +++ b/views/partials/posts.html @@ -0,0 +1,122 @@ +{{ $board := .Board }} +{{ $len := len .Posts }} +{{ range .Posts }} +{{ $thread := . }} +{{ $opId := .Id }} +{{ if eq $board.InReplyTo "" }} +
+{{ end }} +
+
+ {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + [Delete Post] + {{ end }} + {{ if .Attachment }} + {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + [Ban Media] + [Delete Attachment] + [Mark Sensitive] + {{ end }} + File: {{ shortImg (index .Attachment 0).Name }} ({{ convertSize (index .Attachment 0).Size }}) + + +
{{ parseAttachment . false }}
+ + {{ end }} + {{ .Name }} + {{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} + {{ .TripCode }} + {{ .Published | timeToReadableLong }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} +

{{ parseContent $board.Actor $opId .Content $thread }}

+ {{ if .Replies }} + {{ $replies := .Replies }} + {{ if gt $replies.TotalItems 5 }} + {{ if gt $len 1 }} + {{ $replies.TotalItems }} replies{{ if gt $replies.TotalImgs 0}} and {{ $replies.TotalImgs }} images{{ end }}, Click here to view all. + {{ end }} + {{ end }} + {{ range $replies.OrderedItems }} +
+
+
>>
+
+ {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + [Delete Post] + {{ end }} + {{ if .Attachment }} + {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + [Ban Media] + [Delete Attachment] + [Mark Sensitive] + {{ end }} + File {{ shortImg (index .Attachment 0).Name }} ({{ convertSize (index .Attachment 0).Size }}) + + +
+
{{ parseAttachment . false }}
+ + {{ end }} + {{ .Name }} + {{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} + {{ .TripCode }} + {{ .Published | timeToReadableLong }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} + {{ $parentId := .Id }} + {{ if .Replies.OrderedItems }} + {{ range .Replies.OrderedItems }} + + + + {{ end }} + {{ end }} +

{{ parseContent $board.Actor $opId .Content $thread }}

+
+
+
+ {{ end }} + {{ end }} +
+
+{{ end }} diff --git a/views/partials/postscripts.html b/views/partials/postscripts.html new file mode 100644 index 0000000..f26e354 --- /dev/null +++ b/views/partials/postscripts.html @@ -0,0 +1,3 @@ + + + diff --git a/views/partials/top.html b/views/partials/top.html new file mode 100644 index 0000000..7c03c36 --- /dev/null +++ b/views/partials/top.html @@ -0,0 +1,128 @@ +
+

/{{ .Board.Name }}/ - {{ .Board.PrefName }}

+

{{ .Board.Summary }}

+ {{ $len := len .Posts }} + {{ if eq $len 0 }} + {{ if .Board.InReplyTo }} + + {{ else }} + + {{ end }} +
+
+ + + + + + + + + + + {{ if eq .Board.InReplyTo "" }} + + + + + {{ end }} + + + + + + + + + + + + +
+ [X] +
{{ if .Board.InReplyTo }}{{ end }}
+
Mark sensitive
+
+ +
+ +
+ + + + + + +
+
+ + {{ else }} + + {{ if eq (index .Posts 0).Type "Note" }} + {{ if .Board.InReplyTo }} + + {{ else }} + + {{ end }} + {{ $len := len .Posts }} +
+
+ + + + + + + + + + {{ if eq .Board.InReplyTo "" }} + + + + + {{ end }} + + + + + + + + + + + + +
+ [X] +
{{ if .Board.InReplyTo }}{{ end }}
+
Mark sensitive
+
+ +
+ +
+ + + + + +
+
+ +
+ {{ else }} +

Archived Post

+ {{ end }} + {{ end }} + + -- cgit v1.2.3