mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Merge pull request #2938 from riking/include_raw
Add ?include_raw parameter to topic views
This commit is contained in:
commit
8432acf0af
2 changed files with 2 additions and 1 deletions
|
@ -441,7 +441,7 @@ class TopicsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform_show_response
|
def perform_show_response
|
||||||
topic_view_serializer = TopicViewSerializer.new(@topic_view, scope: guardian, root: false)
|
topic_view_serializer = TopicViewSerializer.new(@topic_view, scope: guardian, root: false, include_raw: !!params[:include_raw])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html do
|
format.html do
|
||||||
|
|
|
@ -21,6 +21,7 @@ module PostStreamSerializerMixin
|
||||||
object.posts.each_with_index do |p, idx|
|
object.posts.each_with_index do |p, idx|
|
||||||
highest_number_in_posts = p.post_number if p.post_number > highest_number_in_posts
|
highest_number_in_posts = p.post_number if p.post_number > highest_number_in_posts
|
||||||
ps = PostSerializer.new(p, scope: scope, root: false)
|
ps = PostSerializer.new(p, scope: scope, root: false)
|
||||||
|
ps.add_raw = true if @options[:include_raw]
|
||||||
ps.topic_view = object
|
ps.topic_view = object
|
||||||
p.topic = object.topic
|
p.topic = object.topic
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue