<commit_before>export default Ember.Component.extend({
  tagName: 'td',
  classNameBindings: [':posts', 'likesHeat'],
  attributeBindings: ['title'],

  ratio: function() {
    var likes = parseFloat(this.get('topic.like_count')),
        posts = parseFloat(this.get('topic.posts_count'));

    if (posts < 10) { return 0; }

    return (likes || 0) / posts;
  }.property('topic.like_count', 'topic.posts_count'),

  title: function() {
    return I18n.messageFormat('posts_likes_MF', {
      count: this.get('topic.posts_count'),
      ratio: this.get('ratioText')
    }).trim();
  }.property('topic.posts_count', 'likesHeat'),

  ratioText: function() {
    var ratio = this.get('ratio');

    if (ratio > Discourse.SiteSettings.topic_post_like_heat_high) { return 'high'; }
    if (ratio > Discourse.SiteSettings.topic_post_like_heat_medium) { return 'med'; }
    if (ratio > Discourse.SiteSettings.topic_post_like_heat_low) { return 'low'; }
    return '';
  }.property('ratio'),

  likesHeat: Discourse.computed.fmt('ratioText', 'heatmap-%@'),

  render: function(buffer) {
    var postsCount = this.get('topic.posts_count');

    buffer.push("<a href class='badge-posts " + this.get('likesHeat') + "'>");
    buffer.push(Discourse.Formatter.number(postsCount));
    buffer.push("</a>");
  },

  click: function() {
    var topic = this.get('topic');

    this.sendAction('action', {
      topic: topic,
      position: this.$('a').position()
    });

    return false;
  }

});<commit_msg>UX: fix position of the topic entrance box<commit_after>export default Ember.Component.extend({
  tagName: 'td',
  classNameBindings: [':posts', 'likesHeat'],
  attributeBindings: ['title'],

  ratio: function() {
    var likes = parseFloat(this.get('topic.like_count')),
        posts = parseFloat(this.get('topic.posts_count'));

    if (posts < 10) { return 0; }

    return (likes || 0) / posts;
  }.property('topic.like_count', 'topic.posts_count'),

  title: function() {
    return I18n.messageFormat('posts_likes_MF', {
      count: this.get('topic.posts_count'),
      ratio: this.get('ratioText')
    }).trim();
  }.property('topic.posts_count', 'likesHeat'),

  ratioText: function() {
    var ratio = this.get('ratio');

    if (ratio > Discourse.SiteSettings.topic_post_like_heat_high) { return 'high'; }
    if (ratio > Discourse.SiteSettings.topic_post_like_heat_medium) { return 'med'; }
    if (ratio > Discourse.SiteSettings.topic_post_like_heat_low) { return 'low'; }
    return '';
  }.property('ratio'),

  likesHeat: Discourse.computed.fmt('ratioText', 'heatmap-%@'),

  render: function(buffer) {
    var postsCount = this.get('topic.posts_count');

    buffer.push("<a href class='badge-posts " + this.get('likesHeat') + "'>");
    buffer.push(Discourse.Formatter.number(postsCount));
    buffer.push("</a>");
  },

  click: function() {
    var topic = this.get('topic');

    this.sendAction('action', {
      topic: topic,
      position: this.$('a').offset()
    });

    return false;
  }

});
{'fraction_non_alphanumeric': 0.17931720251905867, 'fraction_numerical': 0.003977461054027179, 'mean_word_length': 3.8365384615384617, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '4442307', 'n_tokens_mistral': 1031, 'n_tokens_neox': 976, 'n_words': 181}