mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 23:53:39 +08:00
Add class to page based on topic category
This commit is contained in:
parent
664d2016d0
commit
63ce01893b
|
@ -52,6 +52,10 @@ Discourse.Topic = Discourse.Model.extend({
|
||||||
return null;
|
return null;
|
||||||
}.property('category_id', 'categoryName'),
|
}.property('category_id', 'categoryName'),
|
||||||
|
|
||||||
|
categoryClass: function() {
|
||||||
|
return 'category-' + Discourse.Category.slugFor(this.get('category'));
|
||||||
|
}.property('category'),
|
||||||
|
|
||||||
shareUrl: function(){
|
shareUrl: function(){
|
||||||
var user = Discourse.User.current();
|
var user = Discourse.User.current();
|
||||||
return this.get('url') + (user ? '?u=' + user.get('username_lower') : '');
|
return this.get('url') + (user ? '?u=' + user.get('username_lower') : '');
|
||||||
|
|
|
@ -16,7 +16,8 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
||||||
classNameBindings: ['controller.multiSelect:multi-select',
|
classNameBindings: ['controller.multiSelect:multi-select',
|
||||||
'topic.archetype',
|
'topic.archetype',
|
||||||
'topic.category.read_restricted:read_restricted',
|
'topic.category.read_restricted:read_restricted',
|
||||||
'topic.deleted:deleted-topic'],
|
'topic.deleted:deleted-topic',
|
||||||
|
'topic.categoryClass'],
|
||||||
menuVisible: true,
|
menuVisible: true,
|
||||||
SHORT_POST: 1200,
|
SHORT_POST: 1200,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user