From 9342705e6bfc4f0e4f999bd3c1bb70d425fcb598 Mon Sep 17 00:00:00 2001 From: Marcin Mikołajczak Date: Tue, 15 Dec 2020 02:04:56 +0100 Subject: Add app shortcuts (#15234) * Add app shortcuts Signed-off-by: mkljczk * Fix codeclimate issues Signed-off-by: mkljczk * Change shortcuts Signed-off-by: mkljczk * More consistent new-status icon Signed-off-by: mkljczk --- app/serializers/manifest_serializer.rb | 40 +++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'app/serializers/manifest_serializer.rb') diff --git a/app/serializers/manifest_serializer.rb b/app/serializers/manifest_serializer.rb index 21ec0d4be..dafe8f55b 100644 --- a/app/serializers/manifest_serializer.rb +++ b/app/serializers/manifest_serializer.rb @@ -7,7 +7,7 @@ class ManifestSerializer < ActiveModel::Serializer attributes :name, :short_name, :description, :icons, :theme_color, :background_color, :display, :start_url, :scope, - :share_target + :share_target, :shortcuts def name object.site_title @@ -64,4 +64,42 @@ class ManifestSerializer < ActiveModel::Serializer }, } end + + def shortcuts + [ + { + name: 'New toot', + url: '/web/statuses/new', + icons: [ + { + src: '/shortcuts/new-status.png', + type: 'image/png', + sizes: '192x192', + }, + ], + }, + { + name: 'Notifications', + url: '/web/notifications', + icons: [ + { + src: '/shortcuts/notifications.png', + type: 'image/png', + sizes: '192x192', + }, + ], + }, + { + name: 'Direct messages', + url: '/web/timelines/direct', + icons: [ + { + src: '/shortcuts/direct.png', + type: 'image/png', + sizes: '192x192', + }, + ], + }, + ] + end end -- cgit