From 65f152b76243671d9c474ce0faef31a12beb06cf Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Sat, 9 May 2020 02:07:58 +0200 Subject: [PATCH] Move user theme to the end of the body --> turbolinks has turbo links again --- app/helpers/theme_helper.rb | 2 +- app/views/layouts/base.haml | 6 +++--- spec/helpers/theme_helper_spec.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/theme_helper.rb b/app/helpers/theme_helper.rb index 16c26297..13f74a0a 100644 --- a/app/helpers/theme_helper.rb +++ b/app/helpers/theme_helper.rb @@ -43,7 +43,7 @@ module ThemeHelper body += "}" - content_tag(:style, body, data: { "turbolinks-track": false }) + content_tag(:style, body) end def get_active_theme diff --git a/app/views/layouts/base.haml b/app/views/layouts/base.haml index 08cffd36..7e466fe6 100644 --- a/app/views/layouts/base.haml +++ b/app/views/layouts/base.haml @@ -12,13 +12,12 @@ %title= yield(:title) = javascript_include_tag 'i18n', 'data-turbolinks-track' => true = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true - = render_theme = javascript_include_tag 'application', 'data-turbolinks-track' => true - if user_signed_in? - if current_user.mod? = javascript_include_tag 'moderation', 'data-turbolinks-track' => true = csrf_meta_tags - %body#version1 + %body - if user_signed_in? = render 'navigation/main' - else @@ -37,4 +36,5 @@ = succeed ')' do = `git rev-parse --short HEAD`.strip %p.text-danger Debug params: - = debug params \ No newline at end of file + = debug params + = render_theme diff --git a/spec/helpers/theme_helper_spec.rb b/spec/helpers/theme_helper_spec.rb index 84467a90..3776192d 100644 --- a/spec/helpers/theme_helper_spec.rb +++ b/spec/helpers/theme_helper_spec.rb @@ -18,7 +18,7 @@ describe ThemeHelper, :type => :helper do end it "returns a theme" do - expect(helper.render_theme).to include('