<commit_before>window.GenericActivityView = Backbone.View.extend({
  tagName: "div",
  className: "activity-block",

  initialize: function(options) {
    this.useTemplate("activities", "_generic_activity");
  },

  render: function() {
    $(this.el).html( Mustache.to_html(this.tmpl, this.model.toJSON()) );
    $('#facts_for_channel').append($(this.el));
    return this;
  },

  clickHandler: function(e) {
    document.location.href = this.model.url();
  }
});

ActivityAddedEvidenceView = GenericActivityView.extend({});
ActivityAddedSubchannelView = GenericActivityView.extend({});
ActivityWasFollowedView = GenericActivityView.extend({});

window.ActivityView = function(opts) {
  if (opts.model.get("action") === "added_evidence") {
    return new ActivityAddedEvidenceView(opts);
  } else if (opts.model.get("action") === "added_subchannel") {
    return new ActivityAddedSubchannelView(opts);
  } else if (opts.model.get("action") === "was_followed") {
    return new ActivityWasFollowedView(opts);
  } else {
    return new GenericActivityView(opts);
  }
};<commit_msg>Use the added_subchannel_activity template for this activity<commit_after>window.GenericActivityView = Backbone.View.extend({
  tagName: "div",
  className: "activity-block",

  initialize: function(options) {
    this.useTemplate("activities", "_generic_activity");
  },

  render: function() {
    $(this.el).html( Mustache.to_html(this.tmpl, this.model.toJSON()) );
    $('#facts_for_channel').append($(this.el));
    return this;
  },

  clickHandler: function(e) {
    document.location.href = this.model.url();
  }
});

ActivityAddedEvidenceView = GenericActivityView.extend({});
ActivityAddedSubchannelView = GenericActivityView.extend({
  initialize: function(options) {
    this.useTemplate("activities", "_added_subchannel_activity");
  }
});
ActivityWasFollowedView = GenericActivityView.extend({});

window.ActivityView = function(opts) {
  if (opts.model.get("action") === "added_evidence") {
    return new ActivityAddedEvidenceView(opts);
  } else if (opts.model.get("action") === "added_subchannel") {
    return new ActivityAddedSubchannelView(opts);
  } else if (opts.model.get("action") === "was_followed") {
    return new ActivityWasFollowedView(opts);
  } else {
    return new GenericActivityView(opts);
  }
};
{'fraction_non_alphanumeric': 0.15643906655142611, 'fraction_numerical': 0.0, 'mean_word_length': 5.2398921832884096, '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': '5524993', 'n_tokens_mistral': 709, 'n_tokens_neox': 696, 'n_words': 118}