diff --git a/app/assets/javascripts/discourse/models/topic.js b/app/assets/javascripts/discourse/models/topic.js index 96316753c..8fea17f62 100755 --- a/app/assets/javascripts/discourse/models/topic.js +++ b/app/assets/javascripts/discourse/models/topic.js @@ -370,6 +370,10 @@ Discourse.Topic = Discourse.Model.extend({ return (postBelow ? postBelow.get('reply_to_post_number') : void 0) === post.get('post_number'); }, + hasExcerpt: function() { + return this.get('excerpt') && this.get('excerpt').length > 0; + }.property('excerpt'), + excerptTruncated: function() { var e = this.get('excerpt'); return( e && e.substr(e.length - 8,8) === '…' ); diff --git a/app/assets/javascripts/discourse/views/list/topic_list_item_view.js b/app/assets/javascripts/discourse/views/list/topic_list_item_view.js index ae37567fd..0c4a6c9d2 100644 --- a/app/assets/javascripts/discourse/views/list/topic_list_item_view.js +++ b/app/assets/javascripts/discourse/views/list/topic_list_item_view.js @@ -9,7 +9,7 @@ Discourse.TopicListItemView = Discourse.View.extend({ tagName: 'tr', templateName: 'list/topic_list_item', - classNameBindings: ['content.archived', ':topic-list-item'], + classNameBindings: ['content.archived', ':topic-list-item', 'content.hasExcerpt:has-excerpt'], attributeBindings: ['data-topic-id'], 'data-topic-id': (function() { diff --git a/app/assets/stylesheets/application/topic-list.css.scss b/app/assets/stylesheets/application/topic-list.css.scss index 0b92e9498..497333ec2 100755 --- a/app/assets/stylesheets/application/topic-list.css.scss +++ b/app/assets/stylesheets/application/topic-list.css.scss @@ -50,6 +50,10 @@ &.archived a { opacity: 0.6; } + &.has-excerpt .star { + vertical-align: top; + margin-top: 2px; + } } th, td {