about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-02-07 02:08:40 +0100
committerGitHub <noreply@github.com>2017-02-07 02:08:40 +0100
commit9d5fb49cd80ee31f83bf5364338bd829e3eae1d6 (patch)
treebb49d530bdb47d3576987d48a69698779b6504da /app/views
parent8a081ce588594154f93702ac2983cb7c0fca015a (diff)
parent28cbb6dc2176cb9ba57841c6dc52b9dbfaf074c8 (diff)
Merge pull request #603 from evanminto/activitypub-account
Expose ActivityStreams 2.0 representation of accounts
Diffstat (limited to 'app/views')
-rw-r--r--app/views/accounts/show.activitystreams2.rabl8
-rw-r--r--app/views/activitypub/base.activitystreams2.rabl1
-rw-r--r--app/views/activitypub/intransient.activitystreams2.rabl3
-rw-r--r--app/views/activitypub/types/person.activitystreams2.rabl3
4 files changed, 15 insertions, 0 deletions
diff --git a/app/views/accounts/show.activitystreams2.rabl b/app/views/accounts/show.activitystreams2.rabl
new file mode 100644
index 000000000..dabae3f29
--- /dev/null
+++ b/app/views/accounts/show.activitystreams2.rabl
@@ -0,0 +1,8 @@
+extends 'activitypub/types/person.activitystreams2.rabl'
+
+object @account
+
+attributes display_name: :name, username: :preferredUsername, note: :summary
+
+node(:icon)   { |account| full_asset_url(account.avatar.url(:original)) }
+node(:image)  { |account| full_asset_url(account.header.url(:original)) }
diff --git a/app/views/activitypub/base.activitystreams2.rabl b/app/views/activitypub/base.activitystreams2.rabl
new file mode 100644
index 000000000..c5e94997a
--- /dev/null
+++ b/app/views/activitypub/base.activitystreams2.rabl
@@ -0,0 +1 @@
+node(:'@context') { 'https://www.w3.org/ns/activitystreams' }
diff --git a/app/views/activitypub/intransient.activitystreams2.rabl b/app/views/activitypub/intransient.activitystreams2.rabl
new file mode 100644
index 000000000..968e451c2
--- /dev/null
+++ b/app/views/activitypub/intransient.activitystreams2.rabl
@@ -0,0 +1,3 @@
+extends 'activitypub/base.activitystreams2.rabl'
+
+node(:id) { request.original_url }
diff --git a/app/views/activitypub/types/person.activitystreams2.rabl b/app/views/activitypub/types/person.activitystreams2.rabl
new file mode 100644
index 000000000..487a60791
--- /dev/null
+++ b/app/views/activitypub/types/person.activitystreams2.rabl
@@ -0,0 +1,3 @@
+extends 'activitypub/intransient.activitystreams2.rabl'
+
+node(:type) { 'Person' }