1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-01 00:08:21 +09:00

Replace SVG asset with Custom mascot (#8766)

This commit is contained in:
ashleyhull-versent 2018-10-08 09:20:45 +11:00 committed by Eugen Rochko
parent 774ac47373
commit 2dba313100
7 changed files with 15 additions and 3 deletions

View File

@ -19,6 +19,7 @@ module Admin
theme theme
thumbnail thumbnail
hero hero
mascot
min_invite_role min_invite_role
activity_api_enabled activity_api_enabled
peers_api_enabled peers_api_enabled
@ -41,6 +42,7 @@ module Admin
UPLOAD_SETTINGS = %w( UPLOAD_SETTINGS = %w(
thumbnail thumbnail
hero hero
mascot
).freeze ).freeze
def edit def edit

View File

@ -44,4 +44,8 @@ class InstancePresenter
def hero def hero
@hero ||= Rails.cache.fetch('site_uploads/hero') { SiteUpload.find_by(var: 'hero') } @hero ||= Rails.cache.fetch('site_uploads/hero') { SiteUpload.find_by(var: 'hero') }
end end
def mascot
@mascot ||= Rails.cache.fetch('site_uploads/mascot') { SiteUpload.find_by(var: 'mascot') }
end
end end

View File

@ -25,7 +25,7 @@
%span= t 'about.status_count_after', count: @instance_presenter.status_count %span= t 'about.status_count_after', count: @instance_presenter.status_count
.row__mascot .row__mascot
.landing-page__mascot .landing-page__mascot
= image_tag asset_pack_path('elephant_ui_plane.svg'), alt: '' = image_tag @instance_presenter.mascot&.file&.url || asset_pack_path('elephant_ui_plane.svg'), alt: ''
.column-2 .column-2
.landing-page__information.contact-widget .landing-page__information.contact-widget

View File

@ -63,7 +63,7 @@
%span= t 'about.status_count_after', count: @instance_presenter.status_count %span= t 'about.status_count_after', count: @instance_presenter.status_count
.row__mascot .row__mascot
.landing-page__mascot .landing-page__mascot
= image_tag asset_pack_path('elephant_ui_plane.svg'), alt: '' = image_tag @instance_presenter.mascot&.file&.url || asset_pack_path('elephant_ui_plane.svg'), alt: ''
- else - else
.column-2.non-preview .column-2.non-preview
@ -95,7 +95,7 @@
%span= t 'about.status_count_after', count: @instance_presenter.status_count %span= t 'about.status_count_after', count: @instance_presenter.status_count
.row__mascot .row__mascot
.landing-page__mascot .landing-page__mascot
= image_tag asset_pack_path('elephant_ui_plane.svg'), alt: '' = image_tag @instance_presenter.mascot&.file&.url || asset_pack_path('elephant_ui_plane.svg'), alt: ''
- if Setting.timeline_preview - if Setting.timeline_preview
.column-3 .column-3

View File

@ -26,6 +26,8 @@
= f.input :thumbnail, as: :file, wrapper: :with_block_label, label: t('admin.settings.thumbnail.title'), hint: t('admin.settings.thumbnail.desc_html') = f.input :thumbnail, as: :file, wrapper: :with_block_label, label: t('admin.settings.thumbnail.title'), hint: t('admin.settings.thumbnail.desc_html')
.fields-row__column.fields-row__column-6.fields-group .fields-row__column.fields-row__column-6.fields-group
= f.input :hero, as: :file, wrapper: :with_block_label, label: t('admin.settings.hero.title'), hint: t('admin.settings.hero.desc_html') = f.input :hero, as: :file, wrapper: :with_block_label, label: t('admin.settings.hero.title'), hint: t('admin.settings.hero.desc_html')
.fields-row__column.fields-row__column-6.fields-group
= f.input :mascot, as: :file, wrapper: :with_block_label, label: t('admin.settings.mascot.title'), hint: t('admin.settings.mascot.desc_html')
%hr.spacer/ %hr.spacer/

View File

@ -368,6 +368,9 @@ en:
hero: hero:
desc_html: Displayed on the frontpage. At least 600x100px recommended. When not set, falls back to instance thumbnail desc_html: Displayed on the frontpage. At least 600x100px recommended. When not set, falls back to instance thumbnail
title: Hero image title: Hero image
mascot:
desc_html: Displayed on multiple pages. At least 293px × 205px recommended. When not set, falls back to instance thumbnail
title: Mascot image
peers_api_enabled: peers_api_enabled:
desc_html: Domain names this instance has encountered in the fediverse desc_html: Domain names this instance has encountered in the fediverse
title: Publish list of discovered instances title: Publish list of discovered instances

View File

@ -18,6 +18,7 @@ describe 'about/show.html.haml', without_verify_partial_doubles: true do
open_registrations: false, open_registrations: false,
thumbnail: nil, thumbnail: nil,
hero: nil, hero: nil,
mascot: nil,
user_count: 0, user_count: 0,
status_count: 0, status_count: 0,
contact_account: nil, contact_account: nil,