# frozen_string_literal: true
class HomeController < ApplicationController
+ before_action :redirect_unauthenticated_to_permalinks!
before_action :authenticate_user!
+
+ before_action :set_pack
before_action :set_referrer_policy_header
def index
%title= content_for?(:page_title) ? safe_join([yield(:page_title).chomp.html_safe, title], ' - ') : title
- = stylesheet_pack_tag 'common', media: 'all'
- = stylesheet_pack_tag current_theme, media: 'all'
- = javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
- = javascript_pack_tag "locale_#{I18n.locale}", 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'
= csrf_meta_tags
+ %meta{ name: 'style-nonce', content: request.content_security_policy_nonce }
= stylesheet_link_tag '/inert.css', skip_pipeline: true, media: 'all', id: 'inert-style'
"@gamestdio/websocket": "^0.3.2",
"@rails/ujs": "^6.0.3",
"array-includes": "^3.1.1",
- "arrow-key-navigation": "^1.1.0",
+ "atrament": "0.2.4",
+ "arrow-key-navigation": "^1.2.0",
"autoprefixer": "^9.8.0",
"axios": "^0.19.2",
"babel-loader": "^8.1.0",