aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorFChannel <>2021-06-17 00:21:07 -0700
committerFChannel <>2021-06-17 00:21:07 -0700
commitcc24155859b65653495747bd0b38be9bcef33298 (patch)
treec46e5b7273534e9626d746855b3b036ee06c1006 /client.go
parentbf23a5c30ace0525e2ad67a979916af5ebab3001 (diff)
added html meta data as well as basic hover effect on links
Diffstat (limited to 'client.go')
-rw-r--r--client.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/client.go b/client.go
index e9ecd80..1c3ae93 100644
--- a/client.go
+++ b/client.go
@@ -47,6 +47,8 @@ type PageData struct {
Boards []Board
Posts []ObjectBase
Key string
+ PostId string
+ Instance Actor
}
type AdminPage struct {
@@ -158,8 +160,10 @@ func CatalogGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection C
returnData.Board.Restricted = actor.Restricted
returnData.Key = *Key
- returnData.Board.Post.Actor = actor
+ returnData.Board.Post.Actor = actor
+ returnData.Instance = GetActorFromDB(db, Domain)
+
returnData.Board.Captcha = Domain + "/" + GetRandomCaptcha(db)
returnData.Board.CaptchaCode = GetCaptchaCode(returnData.Board.Captcha)
@@ -196,6 +200,8 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){
returnData.Board.Captcha = Domain + "/" + GetRandomCaptcha(db)
returnData.Board.CaptchaCode = GetCaptchaCode(returnData.Board.Captcha)
+ returnData.Instance = GetActorFromDB(db, Domain)
+
returnData.Title = "/" + returnData.Board.Name + "/ - " + returnData.Board.PrefName
returnData.Key = *Key
@@ -212,7 +218,6 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){
if len(followCollection.OrderedItems) > 0 {
returnData.Board.InReplyTo = followCollection.OrderedItems[0].Id
returnData.Posts = append(returnData.Posts, followCollection.OrderedItems[0])
-
var actor Actor
actor = FingerActor(returnData.Board.InReplyTo)
returnData.Board.Post.Actor = &actor
@@ -228,6 +233,10 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){
}
}
+ if len(returnData.Posts) > 0 {
+ returnData.PostId = shortURL(returnData.Board.To, returnData.Posts[0].Id)
+ }
+
t.ExecuteTemplate(w, "layout", returnData)
}