about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-18 00:18:07 +0100
committerGitHub <noreply@github.com>2022-01-18 00:18:07 +0100
commitf6acc039ec95c6d1c8cc2e2955f2af31d27e928c (patch)
treefc366dca7470cb995709812b5bb25ecb288b16ec /app/views
parent430d4427916b44e6a7c16db1899dfef2eec140fc (diff)
parentb9ed7e0f55f082de429d5e7d545a5424de0052dd (diff)
Merge pull request #1660 from ClearlyClaire/glitch-soc/features/themes-multiple-packs
Refactor glitch-soc's theme handling
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/_theme.html.haml7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/views/layouts/_theme.html.haml b/app/views/layouts/_theme.html.haml
index 92de64b0d..5dba77621 100644
--- a/app/views/layouts/_theme.html.haml
+++ b/app/views/layouts/_theme.html.haml
@@ -2,12 +2,13 @@
   - if theme[:pack] != 'common' && theme[:common]
     = render partial: 'layouts/theme', object: theme[:common]
   - if theme[:pack]
-    = javascript_pack_tag theme[:flavour] ? "flavours/#{theme[:flavour]}/#{theme[:pack]}" : "core/#{theme[:pack]}", crossorigin: 'anonymous'
+    - pack_path = theme[:flavour] ? "flavours/#{theme[:flavour]}/#{theme[:pack]}" : "core/#{theme[:pack]}"
+    = javascript_pack_tag pack_path, crossorigin: 'anonymous'
     - if theme[:skin]
       - if !theme[:flavour] || theme[:skin] == 'default'
-        = stylesheet_pack_tag theme[:flavour] ? "flavours/#{theme[:flavour]}/#{theme[:pack]}" : "core/#{theme[:pack]}", media: 'all', crossorigin: 'anonymous'
+        = stylesheet_pack_tag pack_path, media: 'all', crossorigin: 'anonymous'
       - else
-        = stylesheet_pack_tag "skins/#{theme[:flavour]}/#{theme[:skin]}/#{theme[:pack]}", crossorigin: 'anonymous'
+        = stylesheet_pack_tag "skins/#{theme[:flavour]}/#{theme[:skin]}/#{theme[:pack]}", media: 'all', crossorigin: 'anonymous'
     - if theme[:preload]
       - theme[:preload].each do |link|
         %link{ href: asset_pack_path("#{link}.js"), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/