From e4e410de1e3129fe7832e2bbe6326719c3e4d813 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 20 May 2020 10:04:53 -0400 Subject: alps theme: add contact details page --- plugins/carddav/routes.go | 4 +++- themes/alps/address-object.html | 50 +++++++++++++++++++++++++++++++++++++++++ themes/alps/assets/style.css | 10 ++++++++- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 themes/alps/address-object.html diff --git a/plugins/carddav/routes.go b/plugins/carddav/routes.go index 7660dbc..ea6030d 100644 --- a/plugins/carddav/routes.go +++ b/plugins/carddav/routes.go @@ -23,6 +23,7 @@ type AddressBookRenderData struct { type AddressObjectRenderData struct { alps.BaseRenderData + AddressBook *carddav.AddressBook AddressObject AddressObject } @@ -95,7 +96,7 @@ func registerRoutes(p *plugin) { return err } - c, err := p.client(ctx.Session) + c, addressBook, err := p.clientWithAddressBook(ctx.Session) if err != nil { return err } @@ -120,6 +121,7 @@ func registerRoutes(p *plugin) { return ctx.Render(http.StatusOK, "address-object.html", &AddressObjectRenderData{ BaseRenderData: *alps.NewBaseRenderData(ctx), + AddressBook: addressBook, AddressObject: AddressObject{ao}, }) }) diff --git a/themes/alps/address-object.html b/themes/alps/address-object.html new file mode 100644 index 0000000..25fa0c4 --- /dev/null +++ b/themes/alps/address-object.html @@ -0,0 +1,50 @@ +{{template "head.html" .}} +{{template "nav.html" .}} + +
+ + +
+
+
+
+
+
+ « Back +
+ +
+ +
+
+
+
+ +
+ {{$fn := .AddressObject.Card.Value "FN"}} +

{{$fn}}

+
+ {{range .AddressObject.Card.Values "EMAIL"}} +
Email address
+
{{.}}
+ {{end}} +
+
+
+
+
+ +{{template "foot.html"}} diff --git a/themes/alps/assets/style.css b/themes/alps/assets/style.css index 810452d..eab050b 100644 --- a/themes/alps/assets/style.css +++ b/themes/alps/assets/style.css @@ -184,7 +184,8 @@ main.message th { width: 5%;} main.message h1 { font-size: 1.2rem; padding: 0.5rem;} main.message pre, -main.message iframe { +main.message iframe, +main.contact .details { flex: 1 auto; padding: 1rem; margin: 0.3rem 0 0 0; @@ -214,6 +215,13 @@ main.message .message-header .parts ul { margin-left: 1rem; } +main.contact dl { + display: grid; + grid-template-columns: auto 1fr; + grid-template-rows: 1fr; + grid-gap: 1rem; +} + main.compose .actions { display: flex; flex-direction: row; -- cgit v1.2.3