]> cat aescling's git repositories - mastodon.git/commitdiff
Fix embedded player
authorThibaut Girka <thib@sitedethib.com>
Tue, 11 Aug 2020 21:15:32 +0000 (23:15 +0200)
committerThibG <thib@sitedethib.com>
Tue, 11 Aug 2020 22:00:42 +0000 (00:00 +0200)
(broken because I forgot to adapt it to glitch-soc's theming system)

app/controllers/media_controller.rb
app/views/media/player.html.haml

index ce015dd1b216d32c9086450331bbb0ad46b67c45..772fc42cb42142f45bde1bb46c72531345d2cd0f 100644 (file)
@@ -11,6 +11,7 @@ class MediaController < ApplicationController
   before_action :verify_permitted_status!
   before_action :check_playable, only: :player
   before_action :allow_iframing, only: :player
+  before_action :set_pack, only: :player
 
   content_security_policy only: :player do |p|
     p.frame_ancestors(false)
@@ -43,4 +44,8 @@ class MediaController < ApplicationController
   def allow_iframing
     response.headers['X-Frame-Options'] = 'ALLOWALL'
   end
+
+  def set_pack
+    use_pack 'public'
+  end
 end
index ae47750e9ab0e61900b8f0b260b8d5ae0b769582..bd5610a0b636ffb0f3f10e81d79fb0fbad2badba 100644 (file)
@@ -1,6 +1,13 @@
 - content_for :header_tags do
   = render_initial_state
-  = javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
+  = javascript_pack_tag "locales", integrity: true, crossorigin: 'anonymous'
+  - if @theme
+    - if @theme[:supported_locales].include? I18n.locale.to_s
+      = javascript_pack_tag "locales/#{@theme[:flavour]}/#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
+    - elsif @theme[:supported_locales].include? 'en'
+      = javascript_pack_tag "locales/#{@theme[:flavour]}/en", integrity: true, crossorigin: 'anonymous'
+  = render partial: 'layouts/theme', object: @core
+  = render partial: 'layouts/theme', object: @theme
 
 - if @media_attachment.video?
   = react_component :video, src: @media_attachment.file.url(:original), preview: @media_attachment.thumbnail.present? ? @media_attachment.thumbnail.url : @media_attachment.file.url(:small), blurhash: @media_attachment.blurhash, width: 670, height: 380, editable: true, detailed: true, inline: true, alt: @media_attachment.description do