0
0
Fork 0

Add logged-out access to the web UI (#18961)

This commit is contained in:
Eugen Rochko 2022-09-29 04:39:33 +02:00 committed by GitHub
parent 1a5150e9c3
commit 43b5d5e38d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 423 additions and 145 deletions

View file

@ -1,9 +1,11 @@
# frozen_string_literal: true
class InitialStateSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :meta, :compose, :accounts,
:media_attachments, :settings,
:languages
:languages, :server
has_one :push_subscription, serializer: REST::WebPushSubscriptionSerializer
has_one :role, serializer: REST::RoleSerializer
@ -82,6 +84,13 @@ class InitialStateSerializer < ActiveModel::Serializer
LanguagesHelper::SUPPORTED_LOCALES.map { |(key, value)| [key, value[0], value[1]] }
end
def server
{
hero: instance_presenter.hero&.file&.url || instance_presenter.thumbnail&.file&.url || asset_pack_path('media/images/preview.png'),
description: instance_presenter.site_short_description.presence || I18n.t('about.about_mastodon_html'),
}
end
private
def instance_presenter