mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:59:50 +08:00
Merge pull request #2754 from techAPJ/patch-1
hide category name for Uncategorized topics while oneboxing
This commit is contained in:
commit
1040a88389
|
@ -57,9 +57,10 @@ module Onebox
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
category_name = ''
|
||||||
category = topic.category
|
category = topic.category
|
||||||
if category
|
if category && !category.uncategorized?
|
||||||
category = "<a href=\"#{category.url}\" class=\"badge badge-category\" style=\"background-color: ##{category.color}; color: ##{category.text_color}\">#{category.name}</a>"
|
category_name = "<a href=\"#{category.url}\" class=\"badge badge-category\" style=\"background-color: ##{category.color}; color: ##{category.text_color}\">#{category.name}</a>"
|
||||||
end
|
end
|
||||||
|
|
||||||
quote = post.excerpt(SiteSetting.post_onebox_maxlength)
|
quote = post.excerpt(SiteSetting.post_onebox_maxlength)
|
||||||
|
@ -71,7 +72,7 @@ module Onebox
|
||||||
views: topic.views,
|
views: topic.views,
|
||||||
posters: posters,
|
posters: posters,
|
||||||
quote: quote,
|
quote: quote,
|
||||||
category: category,
|
category_name: category_name,
|
||||||
topic: topic.id
|
topic: topic.id
|
||||||
|
|
||||||
@template = 'topic'
|
@template = 'topic'
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class='title'>
|
<div class='title'>
|
||||||
<div class='quote-controls'></div>
|
<div class='quote-controls'></div>
|
||||||
{{{avatar}}}
|
{{{avatar}}}
|
||||||
<a href="{{original_url}}">{{title}}</a> {{{category}}}
|
<a href="{{original_url}}">{{title}}</a> {{{category_name}}}
|
||||||
</div>
|
</div>
|
||||||
<blockquote>{{{quote}}}
|
<blockquote>{{{quote}}}
|
||||||
<div class='topic-info'>
|
<div class='topic-info'>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user