<commit_before>import StringBuffer from 'discourse/mixins/string-buffer';

export default Discourse.View.extend(StringBuffer, {
  rerenderTriggers: ['controller.bulkSelectEnabled', 'topic.pinned'],
  tagName: 'tr',
  rawTemplate: 'list/topic_list_item.raw',
  classNameBindings: ['controller.checked',
                      ':topic-list-item',
                      'unboundClassNames'
       ],

  unboundClassNames: function(){
    var classes = [];
    var topic = this.get('topic');

    if(topic.get('hasExcerpt')){
      classes.push('has-excerpt');
    }

    _.each(['liked', 'archived', 'bookmarked'],function(name){
      if(topic.get(name)){
        classes.push(name);
      }
    });

    return classes.join(' ');
  }.property(),

  attributeBindings: ['data-topic-id'],
  'data-topic-id': Em.computed.alias('content.id'),
  titleColSpan: function(){<commit_msg>add category name as a css class to topic list item (props to @lagwagon) - closes #3129<commit_after>import StringBuffer from 'discourse/mixins/string-buffer';

export default Discourse.View.extend(StringBuffer, {
  rerenderTriggers: ['controller.bulkSelectEnabled', 'topic.pinned'],
  tagName: 'tr',
  rawTemplate: 'list/topic_list_item.raw',
  classNameBindings: ['controller.checked',
                      ':topic-list-item',
                      'unboundClassNames'
       ],

  unboundClassNames: function(){
    var classes = [];
    var topic = this.get('topic');

    if (topic.get('category')) {
      classes.push("category-" + topic.get('category.slug'));
    }

    if(topic.get('hasExcerpt')){
      classes.push('has-excerpt');
    }

    _.each(['liked', 'archived', 'bookmarked'],function(name){
      if(topic.get(name)){
        classes.push(name);
      }
    });

    return classes.join(' ');
  }.property(),

  attributeBindings: ['data-topic-id'],
  'data-topic-id': Em.computed.alias('content.id'),
  titleColSpan: function(){
{'fraction_non_alphanumeric': 0.16804979253112035, 'fraction_numerical': 0.002074688796680498, 'mean_word_length': 3.2210065645514225, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5710981', 'n_tokens_mistral': 618, 'n_tokens_neox': 587, 'n_words': 100}