aboutsummaryrefslogtreecommitdiff
path: root/plugins/carddav/public
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-02-05 14:58:56 +0100
committerSimon Ser <contact@emersion.fr>2020-02-05 14:58:56 +0100
commit1bd930f0438ebce5fd0e27aca0f5d5e1c5bcc750 (patch)
tree2ed420695bf816e34adf38c02d06998a154be918 /plugins/carddav/public
parent3263a89185e27031dbde7007eb4b71db4cd3c54f (diff)
downloadalps-1bd930f0438ebce5fd0e27aca0f5d5e1c5bcc750.tar.gz
alps-1bd930f0438ebce5fd0e27aca0f5d5e1c5bcc750.zip
plugins/carddav: add basic contacts view
Diffstat (limited to 'plugins/carddav/public')
-rw-r--r--plugins/carddav/public/address-book.html34
-rw-r--r--plugins/carddav/public/address-object.html22
2 files changed, 56 insertions, 0 deletions
diff --git a/plugins/carddav/public/address-book.html b/plugins/carddav/public/address-book.html
new file mode 100644
index 0000000..f521564
--- /dev/null
+++ b/plugins/carddav/public/address-book.html
@@ -0,0 +1,34 @@
+{{template "head.html"}}
+
+<h1>koushin</h1>
+
+<p>
+ <a href="/">Back</a>
+</p>
+
+<h2>Contacts: {{.AddressBook.Name}}</h2>
+
+<form method="get" action="">
+ <input type="search" name="query" value="{{.Query}}">
+ <input type="submit" value="Search">
+</form>
+
+{{if .AddressObjects}}
+ <ul>
+ {{range .AddressObjects}}
+ <li>
+ <a href="/contacts/{{.Card.Value "UID" | pathescape}}">
+ {{.Card.Value "FN"}}
+ </a>
+ {{$email := .Card.PreferredValue "EMAIL"}}
+ {{if $email}}
+ &lt;<a href="/compose?to={{$email}}">{{$email}}</a>&gt;
+ {{end}}
+ </li>
+ {{end}}
+ </ul>
+{{else}}
+ <p>No contact.</p>
+{{end}}
+
+{{template "foot.html"}}
diff --git a/plugins/carddav/public/address-object.html b/plugins/carddav/public/address-object.html
new file mode 100644
index 0000000..2c96fd4
--- /dev/null
+++ b/plugins/carddav/public/address-object.html
@@ -0,0 +1,22 @@
+{{template "head.html"}}
+
+<h1>koushin</h1>
+
+<p>
+ <a href="/contacts">Back</a>
+</p>
+
+{{$fn := .AddressObject.Card.Value "FN"}}
+
+<h2>Contact: {{$fn}}</h2>
+
+<ul>
+ <li><strong>Name</strong>: {{$fn}}</li>
+ {{range .AddressObject.Card.Values "EMAIL"}}
+ <li><strong>E-mail</strong>:
+ <a href="/compose?to={{.}}">{{.}}</a>
+ </li>
+ {{end}}
+</ul>
+
+{{template "foot.html"}}