<commit_before>/**
  This component handles rendering of what actions have been taken on a post. It uses
  buffer rendering for performance rather than a template.

  @class ActionsHistoryComponent
  @extends Em.Component
  @namespace Discourse
  @module Discourse
**/
export default Em.Component.extend({
  tagName: 'section',
  classNameBindings: [':post-actions', 'hidden'],
  actionsHistory: Em.computed.alias('post.actionsHistory'),
  emptyHistory: Em.computed.empty('actionsHistory'),
  hidden: Em.computed.and('emptyHistory', 'post.notDeleted'),
  shouldRerender: Discourse.View.renderIfChanged('actionsHistory.@each', 'actionsHistory.users.length', 'post.deleted'),

  // This was creating way too many bound ifs and subviews in the handlebars version.
  render: function(buffer) {

    if (!this.get('emptyHistory')) {
      this.get('actionsHistory').forEach(function(c) {
        buffer.push("<div class='post-action'>");

        var renderActionIf = function(property, dataAttribute, text) {
          if (!c.get(property)) { return; }
          buffer.push(" <span class='action-link " + dataAttribute  +"-action'><a href='#' data-" + dataAttribute + "='" + c.get('id') + "'>" + text + "</a>.</span>");
        };

        // TODO multi line expansion for flags
        var iconsHtml = "";
        if (c.get('usersExpanded')) {
          var postUrl;
          c.get('users').forEach(function(u) {
            iconsHtml += "<a href=\"" + Discourse.getURL("/users/") + (u.get('username_lower')) + "\">";
            if (u.post_url) {
              postUrl = postUrl || u.post_url;
            }
            iconsHtml += Discourse.Utilities.avatarImg({
              size: 'small',
              avatarTemplate: u.get('avatar_template'),
              title: u.get('username')
            });
            iconsHtml += "</a>";
          });

          var key = 'post.actions.people.' + c.get('actionType.name_key');
          if (postUrl) { key = key + "_with_url"; }<commit_msg>FIX: use CDN when expanding avatar templates<commit_after>/**
  This component handles rendering of what actions have been taken on a post. It uses
  buffer rendering for performance rather than a template.

  @class ActionsHistoryComponent
  @extends Em.Component
  @namespace Discourse
  @module Discourse
**/
export default Em.Component.extend({
  tagName: 'section',
  classNameBindings: [':post-actions', 'hidden'],
  actionsHistory: Em.computed.alias('post.actionsHistory'),
  emptyHistory: Em.computed.empty('actionsHistory'),
  hidden: Em.computed.and('emptyHistory', 'post.notDeleted'),
  shouldRerender: Discourse.View.renderIfChanged('actionsHistory.@each', 'actionsHistory.users.length', 'post.deleted'),

  // This was creating way too many bound ifs and subviews in the handlebars version.
  render: function(buffer) {

    if (!this.get('emptyHistory')) {
      this.get('actionsHistory').forEach(function(c) {
        buffer.push("<div class='post-action'>");

        var renderActionIf = function(property, dataAttribute, text) {
          if (!c.get(property)) { return; }
          buffer.push(" <span class='action-link " + dataAttribute  +"-action'><a href='#' data-" + dataAttribute + "='" + c.get('id') + "'>" + text + "</a>.</span>");
        };

        // TODO multi line expansion for flags
        var iconsHtml = "";
        if (c.get('usersExpanded')) {
          var postUrl;
          c.get('users').forEach(function(u) {
            iconsHtml += "<a href=\"" + Discourse.getURL("/users/") + (u.get('username_lower')) + "\">";
            if (u.post_url) {
              postUrl = postUrl || u.post_url;
            }
            iconsHtml += Discourse.Utilities.avatarImg({
              size: 'small',
              avatarTemplate: u.get('avatarTemplate'),
              title: u.get('username')
            });
            iconsHtml += "</a>";
          });

          var key = 'post.actions.people.' + c.get('actionType.name_key');
          if (postUrl) { key = key + "_with_url"; }
{'fraction_non_alphanumeric': 0.15727816550348953, 'fraction_numerical': 0.0, 'mean_word_length': 2.768075117370892, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '681453', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1139, 'n_words': 272}