2020-06-25 08:33:01 +09:00
|
|
|
- content_for :header_tags do
|
|
|
|
= render_initial_state
|
2023-06-11 00:43:13 +09:00
|
|
|
= javascript_pack_tag 'common', crossorigin: 'anonymous'
|
2020-08-12 06:15:32 +09:00
|
|
|
- if @theme
|
|
|
|
- if @theme[:supported_locales].include? I18n.locale.to_s
|
2023-07-30 20:42:06 +09:00
|
|
|
= preload_pack_asset "locales/#{@theme[:flavour]}/#{I18n.locale}-json.js"
|
2020-08-12 06:15:32 +09:00
|
|
|
- elsif @theme[:supported_locales].include? 'en'
|
2023-07-30 20:42:06 +09:00
|
|
|
= preload_pack_asset "locales/#{@theme[:flavour]}/en-json.js"
|
2020-08-12 06:15:32 +09:00
|
|
|
= render partial: 'layouts/theme', object: @core
|
|
|
|
= render partial: 'layouts/theme', object: @theme
|
2020-06-25 08:33:01 +09:00
|
|
|
|
2021-05-06 04:16:55 +09:00
|
|
|
:ruby
|
|
|
|
meta = @media_attachment.file.meta || {}
|
|
|
|
|
2020-06-25 08:33:01 +09:00
|
|
|
- if @media_attachment.video?
|
2024-01-10 18:35:01 +09:00
|
|
|
= react_component :video,
|
|
|
|
alt: @media_attachment.description,
|
|
|
|
blurhash: @media_attachment.blurhash,
|
|
|
|
detailed: true,
|
|
|
|
editable: true,
|
|
|
|
frameRate: meta.dig('original', 'frame_rate'),
|
|
|
|
height: 380,
|
|
|
|
inline: true,
|
|
|
|
media: [ActiveModelSerializers::SerializableResource.new(@media_attachment, serializer: REST::MediaAttachmentSerializer)].as_json,
|
|
|
|
preview: @media_attachment.thumbnail.present? ? @media_attachment.thumbnail.url : @media_attachment.file.url(:small),
|
|
|
|
src: @media_attachment.file.url(:original),
|
|
|
|
width: 670 do
|
2020-06-25 08:33:01 +09:00
|
|
|
%video{ controls: 'controls' }
|
|
|
|
%source{ src: @media_attachment.file.url(:original) }
|
|
|
|
- elsif @media_attachment.gifv?
|
2024-01-10 18:35:01 +09:00
|
|
|
= react_component :media_gallery,
|
|
|
|
autoplay: true,
|
|
|
|
height: 380,
|
|
|
|
media: [ActiveModelSerializers::SerializableResource.new(@media_attachment, serializer: REST::MediaAttachmentSerializer).as_json],
|
|
|
|
standalone: true do
|
2020-06-25 08:33:01 +09:00
|
|
|
%video{ autoplay: 'autoplay', muted: 'muted', loop: 'loop' }
|
|
|
|
%source{ src: @media_attachment.file.url(:original) }
|
|
|
|
- elsif @media_attachment.audio?
|
2024-01-10 18:35:01 +09:00
|
|
|
= react_component :audio,
|
|
|
|
accentColor: meta.dig('colors', 'accent'),
|
|
|
|
alt: @media_attachment.description,
|
|
|
|
backgroundColor: meta.dig('colors', 'background'),
|
|
|
|
duration: meta.dig(:original, :duration),
|
|
|
|
foregroundColor: meta.dig('colors', 'foreground'),
|
|
|
|
fullscreen: true,
|
|
|
|
height: 380,
|
|
|
|
poster: @media_attachment.thumbnail.present? ? @media_attachment.thumbnail.url : @media_attachment.account.avatar_static_url,
|
|
|
|
src: @media_attachment.file.url(:original),
|
|
|
|
width: 670 do
|
2020-06-25 08:33:01 +09:00
|
|
|
%audio{ controls: 'controls' }
|
|
|
|
%source{ src: @media_attachment.file.url(:original) }
|