diff --git a/.gitignore b/.gitignore index 9dfa377bcf8..f5168681fb4 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,6 @@ bundler_stubs/* vendor/bundle/* *.db + +#ignore jetbrains ide file +*.iml diff --git a/app/views/layouts/crawler.html.erb b/app/views/layouts/crawler.html.erb index a2dfcf11a0b..f651d4e21b0 100644 --- a/app/views/layouts/crawler.html.erb +++ b/app/views/layouts/crawler.html.erb @@ -71,4 +71,5 @@ <%= raw SiteCustomization.custom_body_tag(session[:preview_style]) %> <%- end %> + <%= yield :after_body %> diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index b227aa3c620..efeaec35241 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -76,3 +76,11 @@ <% end %> <% content_for(:title) { "#{@topic_view.page_title}" } %> + +<% if @topic_view.print %> + <% content_for :after_body do %> + + <% end %> +<% end %> diff --git a/lib/topic_view.rb b/lib/topic_view.rb index d854c09ac7e..bfef06b1b9d 100644 --- a/lib/topic_view.rb +++ b/lib/topic_view.rb @@ -5,7 +5,7 @@ require_dependency 'gaps' class TopicView - attr_reader :topic, :posts, :guardian, :filtered_posts, :chunk_size + attr_reader :topic, :posts, :guardian, :filtered_posts, :chunk_size, :print attr_accessor :draft, :draft_key, :draft_sequence, :user_custom_fields, :post_custom_fields def self.slow_chunk_size @@ -41,6 +41,7 @@ class TopicView @user = user @guardian = Guardian.new(@user) @topic = find_topic(topic_id) + @print = options[:print].present? check_and_raise_exceptions options.each do |key, value| @@ -50,7 +51,7 @@ class TopicView @page = 1 if (!@page || @page.zero?) @chunk_size = case when options[:slow_platform] then TopicView.slow_chunk_size - when options[:print] then 1000 + when @print then 1000 else TopicView.chunk_size end @limit ||= @chunk_size