Finalized theme loading and stuff
This commit is contained in:
10
app/views/layouts/_theme.html.haml
Normal file
10
app/views/layouts/_theme.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
- if theme
|
||||
- if theme[:pack] != 'common' && theme[:common]
|
||||
= render partial: 'layouts/theme', object: theme[:common]
|
||||
- if theme[:pack]
|
||||
= javascript_pack_tag theme[:name] ? "themes/#{theme[:name]}/#{theme[:pack]}" : "core/#{theme[:pack]}", integrity: true, crossorigin: 'anonymous'
|
||||
- if theme[:stylesheet]
|
||||
= stylesheet_pack_tag theme[:name] ? "themes/#{theme[:name]}/#{theme[:pack]}" : "core/#{theme[:pack]}", integrity: true, media: 'all'
|
||||
- if theme[:preload]
|
||||
- theme[:preload].each do |link|
|
||||
%link{ href: asset_pack_path("#{link}.js"), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
|
@ -1,6 +1,3 @@
|
||||
- content_for :header_tags do
|
||||
= javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
|
||||
|
||||
- content_for :content do
|
||||
.admin-wrapper
|
||||
.sidebar-wrapper
|
||||
|
@ -18,16 +18,16 @@
|
||||
= ' - '
|
||||
= title
|
||||
|
||||
= stylesheet_pack_tag 'common', media: 'all'
|
||||
= javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
|
||||
= javascript_pack_tag "locales", integrity: true, crossorigin: 'anonymous'
|
||||
= javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
|
||||
= csrf_meta_tags
|
||||
|
||||
- if controller_name != 'home'
|
||||
= stylesheet_pack_tag 'application', integrity: true, media: 'all'
|
||||
|
||||
= yield :header_tags
|
||||
|
||||
-# These must come after :header_tags to ensure our initial state has been defined.
|
||||
= render partial: 'layouts/theme', object: @core
|
||||
= render partial: 'layouts/theme', object: @theme
|
||||
|
||||
- body_classes ||= @body_classes || ''
|
||||
- body_classes += ' system-font' if current_account&.user&.setting_system_font_ui
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
- content_for :header_tags do
|
||||
= javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
|
||||
|
||||
- content_for :content do
|
||||
.container
|
||||
.logo-container
|
||||
|
@ -4,10 +4,9 @@
|
||||
%meta{ charset: 'utf-8' }/
|
||||
%meta{ name: 'robots', content: 'noindex' }/
|
||||
|
||||
= stylesheet_pack_tag 'common', media: 'all'
|
||||
= javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
|
||||
= stylesheet_pack_tag 'application', integrity: true, media: 'all'
|
||||
= javascript_pack_tag 'embed', integrity: true, crossorigin: 'anonymous'
|
||||
= javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
|
||||
= javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
|
||||
%body.embed
|
||||
= render partial: 'layouts/theme', object: @core
|
||||
= render partial: 'layouts/theme', object: @theme
|
||||
= yield
|
||||
|
@ -5,8 +5,8 @@
|
||||
%meta{ charset: 'utf-8' }/
|
||||
%title= safe_join([yield(:page_title), Setting.default_settings['site_title']], ' - ')
|
||||
%meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/
|
||||
= stylesheet_pack_tag 'common', media: 'all'
|
||||
= stylesheet_pack_tag 'application', integrity: true, media: 'all'
|
||||
= render partial: 'layouts/theme', object: @core
|
||||
= render partial: 'layouts/theme', object: @theme
|
||||
%body.error
|
||||
.dialog
|
||||
%img{ alt: Setting.default_settings['site_title'], src: '/oops.gif' }/
|
||||
|
@ -1,6 +1,3 @@
|
||||
- content_for :header_tags do
|
||||
= javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
|
||||
|
||||
- content_for :content do
|
||||
- if user_signed_in?
|
||||
.account-header
|
||||
|
@ -1,6 +1,3 @@
|
||||
- content_for :header_tags do
|
||||
= javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
|
||||
|
||||
- content_for :content do
|
||||
.container= yield
|
||||
.footer
|
||||
|
Reference in New Issue
Block a user