mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: TopicView were using Topic.relative_url instead of TopicView.relative_url on all methods.
This commit is contained in:
parent
6faedfa716
commit
9a46af59ad
1 changed files with 5 additions and 5 deletions
|
@ -80,7 +80,7 @@ class TopicView
|
||||||
end
|
end
|
||||||
|
|
||||||
def canonical_path
|
def canonical_path
|
||||||
path = @topic.relative_url
|
path = relative_url
|
||||||
path << if @post_number
|
path << if @post_number
|
||||||
page = ((@post_number.to_i - 1) / @limit) + 1
|
page = ((@post_number.to_i - 1) / @limit) + 1
|
||||||
(page > 1) ? "?page=#{page}" : ""
|
(page > 1) ? "?page=#{page}" : ""
|
||||||
|
@ -122,18 +122,18 @@ class TopicView
|
||||||
|
|
||||||
def prev_page_path
|
def prev_page_path
|
||||||
if prev_page > 1
|
if prev_page > 1
|
||||||
"#{@topic.relative_url}?page=#{prev_page}"
|
"#{relative_url}?page=#{prev_page}"
|
||||||
else
|
else
|
||||||
@topic.relative_url
|
relative_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_page_path
|
def next_page_path
|
||||||
"#{@topic.relative_url}?page=#{next_page}"
|
"#{relative_url}?page=#{next_page}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def absolute_url
|
def absolute_url
|
||||||
"#{Discourse.base_url}#{@topic.relative_url}"
|
"#{Discourse.base_url}#{relative_url}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def relative_url
|
def relative_url
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue