diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-08-19 11:45:16 -0300 |
---|---|---|
committer | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-08-19 11:45:16 -0300 |
commit | 6f8744c1ad53b4056dc6245f8ac6b5fb903aef8f (patch) | |
tree | 16ebf235044be87d3d37dcb22bb4a49bd141c191 | |
parent | a4801a3c1680ea63e264ead5acb9e6285b25ad07 (diff) |
data-utc
-rw-r--r-- | client.go | 6 | ||||
-rw-r--r-- | main.go | 1 | ||||
-rw-r--r-- | static/posts.html | 7 |
3 files changed, 12 insertions, 2 deletions
@@ -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 @@ -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 @@ <span class="subject"><b>{{ .Name }}</b></span> <span class="name"><b>{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }}</b></span> <span class="tripcode"> {{ .TripCode }} </span> - <span>{{ .Published | timeToReadableLong }} <a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/{{ short $board.Actor.Outbox $opId }}#{{ short $board.Actor.Outbox .Id }}">No.</a> <a id="{{ .Id }}-link" title="{{ .Id }}" {{ if eq .Type "Note" }} href="javascript:quote('{{ $board.Actor.Id }}', '{{ $opId }}', '{{ .Id }}')" {{ end }}>{{ short $board.Actor.Outbox .Id }}</a> {{ if ne .Type "Tombstone" }}<a href="javascript:report('{{ $board.Actor.Id }}', '{{ .Id }}')">[Report]</a>{{ end }}</span> + <span class="timestamp" data-utc="{{.Published | timeToUnix}}">{{ .Published | timeToReadableLong }} <a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/{{ short $board.Actor.Outbox $opId }}#{{ short $board.Actor.Outbox .Id }}">No.</a> <a id="{{ .Id }}-link" title="{{ .Id }}" {{ if eq .Type "Note" }} href="javascript:quote('{{ $board.Actor.Id }}', '{{ $opId }}', '{{ .Id }}')" {{ end }}>{{ short $board.Actor.Outbox .Id }}</a> {{ if ne .Type "Tombstone" }}<a href="javascript:report('{{ $board.Actor.Id }}', '{{ .Id }}')">[Report]</a>{{ end }}</span> <p id="{{ .Id }}-content" style="white-space: pre-wrap; margin: 10px 30px 10px 30px;">{{ parseContent $board.Actor $opId .Content $thread }}</p> {{ if .Replies }} {{ $replies := .Replies }} @@ -100,7 +100,10 @@ } </script> {{ end }} - <span class="subject"><b>{{ .Name }}</b></span><span class="name"><b>{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }}</b></span><span class="tripcode"> {{ .TripCode }} </span><span>{{ .Published | timeToReadableLong }} <a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/{{ short $board.Actor.Outbox $opId }}#{{ short $board.Actor.Outbox .Id }}">No. </a><a id="{{ .Id }}-link" title="{{ .Id }}" {{ if eq .Type "Note" }} href="javascript:quote('{{ $board.Actor.Id }}', '{{ $opId }}', '{{ .Id }}')" {{ end }}>{{ short $board.Actor.Outbox .Id }}</a> {{ if ne .Type "Tombstone" }}<a href="javascript:report('{{ $board.Actor.Id }}', '{{ .Id }}')">[Report]</a>{{ end }}</span> + <span class="subject"><b>{{ .Name }}</b></span> + <span class="name"><b>{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }}</b></span> + <span class="tripcode"> {{ .TripCode }} </span> + <span class="timestamp" data-utc="{{ .Published | timeToUnix }}">{{ .Published | timeToReadableLong }} <a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/{{ short $board.Actor.Outbox $opId }}#{{ short $board.Actor.Outbox .Id }}">No. </a><a id="{{ .Id }}-link" title="{{ .Id }}" {{ if eq .Type "Note" }} href="javascript:quote('{{ $board.Actor.Id }}', '{{ $opId }}', '{{ .Id }}')" {{ end }}>{{ short $board.Actor.Outbox .Id }}</a> {{ if ne .Type "Tombstone" }}<a href="javascript:report('{{ $board.Actor.Id }}', '{{ .Id }}')">[Report]</a>{{ end }}</span> {{ $parentId := .Id }} {{ if .Replies.OrderedItems }} {{ range .Replies.OrderedItems }} |