From 2e4b3e9b06c14b7c98f8c3563ca4fac7c765e905 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 7 Aug 2017 11:28:56 -0400 Subject: [PATCH] Don't include all html builders on client and server side --- app/controllers/application_controller.rb | 4 +++- app/views/layouts/application.html.erb | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1484df2603b..22c06313627 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -448,7 +448,9 @@ class ApplicationController < ActionController::Base end DiscoursePluginRegistry.html_builders.each do |name, blk| - data[name] = blk.call(self) + if name.start_with?("client:") + data[name.sub(/^client:/, '')] = blk.call(self) + end end MultiJson.dump(data) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 93fadad04af..aa81f4b41ea 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -55,7 +55,7 @@ <%= yield :head %> - <%= raw build_plugin_html 'before-head-close' %> + <%= raw build_plugin_html 'server:before-head-close' %> @@ -87,6 +87,7 @@ <%- unless customization_disabled? || loading_admin? %> <%= theme_lookup("header") %> + <%= raw build_plugin_html 'server:header' %> <%- end %>
@@ -124,6 +125,6 @@ <%- unless customization_disabled? %> <%= raw theme_lookup("body_tag") %> <%- end %> - <%= raw build_plugin_html 'before-body-close' %> + <%= raw build_plugin_html 'server:before-body-close' %>