From 6f8744c1ad53b4056dc6245f8ac6b5fb903aef8f Mon Sep 17 00:00:00 2001 From: KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> Date: Thu, 19 Aug 2021 11:45:16 -0300 Subject: data-utc --- client.go | 6 ++++++ main.go | 1 + static/posts.html | 7 +++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 79e4bb1..d45e72d 100644 --- a/client.go +++ b/client.go @@ -111,6 +111,10 @@ func timeToReadableLong(t time.Time) string { return t.Format("01/02/06(Mon)03:04:05") } +func timeToUnix(t time.Time) string { + return fmt.Sprint(t.Unix()) +} + func IndexGet(w http.ResponseWriter, r *http.Request, db *sql.DB) { t := template.Must(template.New("").Funcs(template.FuncMap{ "mod": mod, @@ -259,6 +263,7 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co return i + j }, "timeToReadableLong": timeToReadableLong, + "timeToUnix": timeToUnix, "sub": sub}).ParseFiles("./static/main.html", "./static/nposts.html", "./static/top.html", "./static/bottom.html", "./static/posts.html")) actor := collection.Actor @@ -462,6 +467,7 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB) { return template.HTML(link) }, "timeToReadableLong": timeToReadableLong, + "timeToUnix": timeToUnix, "sub": sub}).ParseFiles("./static/main.html", "./static/npost.html", "./static/top.html", "./static/bottom.html", "./static/posts.html")) path := r.URL.Path diff --git a/main.go b/main.go index 6c3e9b7..131211e 100644 --- a/main.go +++ b/main.go @@ -30,6 +30,7 @@ var Port = ":" + GetConfigValue("instanceport", "3000") var TP = GetConfigValue("instancetp", "") var Instance = GetConfigValue("instance", "") var Domain = TP + "" + Instance +var TorInstance = IsOnion(Instance) var authReq = []string{"captcha", "email", "passphrase"} diff --git a/static/posts.html b/static/posts.html index e3c989c..7110dd9 100644 --- a/static/posts.html +++ b/static/posts.html @@ -48,7 +48,7 @@ {{ .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 }} @@ -100,7 +100,10 @@ } {{ end }} - {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published | timeToReadableLong }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} + {{ .Name }} + {{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} + {{ .TripCode }} + {{ $parentId := .Id }} {{ if .Replies.OrderedItems }} {{ range .Replies.OrderedItems }} -- cgit v1.2.3