about summary refs log tree commit diff
path: root/app/serializers/rest
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-09-14 00:04:30 +0200
committerGitHub <noreply@github.com>2017-09-14 00:04:30 +0200
commit9239e4ce4d4e958e62552d4a01183d0295c020f5 (patch)
tree8f33707c027e2c10b62c0c6fffe1eb3bf27d38ef /app/serializers/rest
parent06f26e09b4bff120181eaaeb70a833482368ea63 (diff)
Uploads for admin site settings (#4913)
* Improve OpenGraph tags for about pages

* Add thumbnail admin setting

* Fix error

* Fix up
Diffstat (limited to 'app/serializers/rest')
-rw-r--r--app/serializers/rest/instance_serializer.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb
index a97137909..2898011fd 100644
--- a/app/serializers/rest/instance_serializer.rb
+++ b/app/serializers/rest/instance_serializer.rb
@@ -1,8 +1,10 @@
 # frozen_string_literal: true
 
 class REST::InstanceSerializer < ActiveModel::Serializer
+  include RoutingHelper
+
   attributes :uri, :title, :description, :email,
-             :version, :urls, :stats
+             :version, :urls, :stats, :thumbnail
 
   def uri
     Rails.configuration.x.local_domain
@@ -24,6 +26,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
     Mastodon::Version.to_s
   end
 
+  def thumbnail
+    full_asset_url(instance_presenter.thumbnail.file.url) if instance_presenter.thumbnail
+  end
+
   def stats
     {
       user_count: instance_presenter.user_count,