Merge remote-tracking branch 'parent/main' into upstream-20240507
This commit is contained in:
commit
89b71363ae
70 changed files with 1739 additions and 445 deletions
|
@ -1,21 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ManifestSerializer < ActiveModel::Serializer
|
||||
include ApplicationHelper
|
||||
include RoutingHelper
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
ICON_SIZES = %w(
|
||||
36
|
||||
48
|
||||
72
|
||||
96
|
||||
144
|
||||
192
|
||||
256
|
||||
384
|
||||
512
|
||||
).freeze
|
||||
|
||||
attributes :id, :name, :short_name,
|
||||
:icons, :theme_color, :background_color,
|
||||
:display, :start_url, :scope,
|
||||
|
@ -37,9 +26,12 @@ class ManifestSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def icons
|
||||
ICON_SIZES.map do |size|
|
||||
SiteUpload::ANDROID_ICON_SIZES.map do |size|
|
||||
src = site_icon_path('app_icon', size.to_i)
|
||||
src = URI.join(root_url, src).to_s if src.present?
|
||||
|
||||
{
|
||||
src: frontend_asset_url("icons/android-chrome-#{size}x#{size}.png"),
|
||||
src: src || frontend_asset_url("icons/android-chrome-#{size}x#{size}.png"),
|
||||
sizes: "#{size}x#{size}",
|
||||
type: 'image/png',
|
||||
purpose: 'any maskable',
|
||||
|
|
9
app/serializers/oauth_metadata_serializer.rb
Normal file
9
app/serializers/oauth_metadata_serializer.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class OauthMetadataSerializer < ActiveModel::Serializer
|
||||
attributes :issuer, :authorization_endpoint, :token_endpoint,
|
||||
:revocation_endpoint, :scopes_supported,
|
||||
:response_types_supported, :response_modes_supported,
|
||||
:grant_types_supported, :token_endpoint_auth_methods_supported,
|
||||
:service_documentation, :app_registration_endpoint
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue