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