Allow admins to configure instance favicon and logo (#30040)
This commit is contained in:
parent
b152f936c1
commit
bc24c4792d
9 changed files with 87 additions and 19 deletions
|
@ -37,6 +37,8 @@ class Form::AdminSettings
|
|||
status_page_url
|
||||
captcha_enabled
|
||||
authorized_fetch
|
||||
app_icon
|
||||
favicon
|
||||
).freeze
|
||||
|
||||
INTEGER_KEYS = %i(
|
||||
|
@ -63,6 +65,8 @@ class Form::AdminSettings
|
|||
UPLOAD_KEYS = %i(
|
||||
thumbnail
|
||||
mascot
|
||||
app_icon
|
||||
favicon
|
||||
).freeze
|
||||
|
||||
OVERRIDEN_SETTINGS = {
|
||||
|
|
|
@ -19,7 +19,15 @@
|
|||
class SiteUpload < ApplicationRecord
|
||||
include Attachmentable
|
||||
|
||||
FAVICON_SIZES = [16, 32, 48].freeze
|
||||
APPLE_ICON_SIZES = [57, 60, 72, 76, 114, 120, 144, 152, 167, 180, 1024].freeze
|
||||
ANDROID_ICON_SIZES = [36, 48, 72, 96, 144, 192, 256, 384, 512].freeze
|
||||
|
||||
APP_ICON_SIZES = (APPLE_ICON_SIZES + ANDROID_ICON_SIZES).uniq.freeze
|
||||
|
||||
STYLES = {
|
||||
app_icon: APP_ICON_SIZES.each_with_object({}) { |size, hash| hash[size.to_s.to_sym] = "#{size}x#{size}#" }.freeze,
|
||||
favicon: FAVICON_SIZES.each_with_object({}) { |size, hash| hash[size.to_s.to_sym] = "#{size}x#{size}#" }.freeze,
|
||||
thumbnail: {
|
||||
'@1x': {
|
||||
format: 'png',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue