FIX: print view wasn't working (#26433)
In e05628c079
we omitted the HTML view for logged in users but that view is used when printing.
This restore the HTML view when printing a topic page.
This commit is contained in:
parent
48cb7b7863
commit
c3e6e9cfdd
|
@ -430,7 +430,11 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def include_crawler_content?
|
||||
(crawler_layout? || !mobile_view? || !modern_mobile_device?) && !current_user
|
||||
if current_user
|
||||
params.key?(:print)
|
||||
else
|
||||
crawler_layout? || !mobile_view? || !modern_mobile_device?
|
||||
end
|
||||
end
|
||||
|
||||
def modern_mobile_device?
|
||||
|
|
|
@ -17,6 +17,13 @@ RSpec.describe ApplicationHelper do
|
|||
expect(helper.include_crawler_content?).to eq(false)
|
||||
end
|
||||
|
||||
it "sends crawler content to logged on users who wants to print" do
|
||||
helper.stubs(:current_user).returns(Fabricate(:user))
|
||||
helper.stubs(:params).returns(print: true)
|
||||
|
||||
expect(helper.include_crawler_content?).to eq(true)
|
||||
end
|
||||
|
||||
it "sends crawler content to old mobiles" do
|
||||
controller.stubs(:use_crawler_layout?).returns(false)
|
||||
|
||||
|
|
Loading…
Reference in New Issue