Merge commit '98237207e67697abffc6b141f2388e3d8c925260' into glitch-soc/merge-upstream

Conflicts:
- `app/helpers/application_helper.rb`:
  Upstream refactored some helpers and moved them in another file.
  Not a real conflict, but glitch-soc had adjacent glitch-only definitions.
  Kept glitch-soc definitions where they are and moved upstream ones
  as upstream did.
This commit is contained in:
Claire
2024-08-22 19:48:43 +02:00
121 changed files with 622 additions and 744 deletions

View File

@@ -7,10 +7,11 @@ class REST::InstanceSerializer < ActiveModel::Serializer
has_one :account, serializer: REST::AccountSerializer
end
include InstanceHelper
include RoutingHelper
attributes :domain, :title, :version, :source_url, :description,
:usage, :thumbnail, :languages, :configuration,
:usage, :thumbnail, :icon, :languages, :configuration,
:registrations, :api_versions
has_one :contact, serializer: ContactSerializer
@@ -33,6 +34,18 @@ class REST::InstanceSerializer < ActiveModel::Serializer
end
end
def icon
SiteUpload::ANDROID_ICON_SIZES.map do |size|
src = app_icon_path(size.to_i)
src = URI.join(root_url, src).to_s if src.present?
{
src: src || frontend_asset_url("icons/android-chrome-#{size}x#{size}.png"),
size: "#{size}x#{size}",
}
end
end
def usage
{
users: {