From 80413772d9a490cbb8b8d7c88e2c41ab0f7bc77e Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 3 Feb 2025 11:35:53 +0000 Subject: [PATCH] add /knots/{domain} pages --- appview/db/db.go | 6 +-- appview/pages/knot.html | 37 +++++++++++++ appview/pages/knots.html | 27 +++++++--- appview/pages/pages.go | 11 ++++ appview/state/middleware.go | 31 +++++++++++ appview/state/state.go | 104 +++++++++++++++++++++++++++++++++++- 6 files changed, 203 insertions(+), 13 deletions(-) create mode 100644 appview/pages/knot.html diff --git a/appview/db/db.go b/appview/db/db.go index b3504a6f..86dfc33b 100644 --- a/appview/db/db.go +++ b/appview/db/db.go @@ -189,9 +189,5 @@ func (d *DB) Register(domain string) error { where domain = ?; `, domain) - if err != nil { - return err - } - - return nil + return err } diff --git a/appview/pages/knot.html b/appview/pages/knot.html new file mode 100644 index 00000000..b57a103e --- /dev/null +++ b/appview/pages/knot.html @@ -0,0 +1,37 @@ +{{define "title"}}knot{{end}} + +{{define "content"}} + back to timeline + back to all knots +

{{.Registration.Domain}}

+

+ + opened by: {{.Registration.ByDid}} + {{ if $.IsOwner }} + (you) + {{ end }} +
+ on: {{.Registration.Created}}
+ {{ if .Registration.Registered }} + registered on: {{.Registration.Registered}} + {{ else }} + pending registration + + {{ end }} +

+ + {{ if .Registration.Registered }} +

members

+ {{ range $.Members }} +
    +
  1. {{.}}
  2. +
+ {{ else }} +

no members

+ {{ end }} + {{ end }} + + {{ if $.IsOwner }} + add member + {{ end }} +{{end}} diff --git a/appview/pages/knots.html b/appview/pages/knots.html index 1a27112c..b76a8883 100644 --- a/appview/pages/knots.html +++ b/appview/pages/knots.html @@ -13,20 +13,33 @@ -

existing registrations

-