<commit_before>(function(){
window.GenericNotificationView = Backbone.View.extend({
  tagName: "li",
  className: "activity",

  tmpl: Template.use("notifications", "_generic_activity"),

  render: function () {
    this.$el.html( this.tmpl.render(this.model.toJSON()) );

    if ( this.model.get('unread') === true ) {
      this.$el.addClass('unread');
    }

    return this;
  },

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

  markAsRead: function () {
    this.$el.removeClass('unread');
  }
});

var NotificationAddedEvidenceView = GenericNotificationView.extend({
  tmpl: Template.use("notifications", "_added_evidence_activity")
});

var NotificationAddedSubchannelView = GenericNotificationView.extend({
  tmpl: Template.use("notifications", "_added_subchannel_activity")
});

var NotificationOpinionatedView = GenericNotificationView.extend({
  tmpl: Template.use("notifications", "_opinionated_activity")
});

var NotificationInvitedView = GenericNotificationView.extend({
  tmpl: Template.use("notifications", "_invited_activity")
});

var NotificationNewChannelView = GenericNotificationView.extend({
  tmpl: Template.use("notifications", "_new_channel_activity")
});

var AddedFactToChannelView = GenericNotificationView.extend({
  tmpl: Template.use('notifications', '_added_fact_to_channel')
});

window.NotificationView = function(opts) {
  switch (opts.model.get("action")) {
    case "added_supporting_evidence":
    case "added_weakening_evidence":
      return new NotificationAddedEvidenceView(opts);

    case "added_subchannel":<commit_msg>use marionette for notifications<commit_after>(function(){
window.GenericNotificationView = Backbone.Marionette.ItemView.extend({
  tagName: "li",
  className: "activity",

  template: "notifications/_generic_activity",

  onRender: function () {
    if ( this.model.get('unread') === true ) {
      this.$el.addClass('unread');
    }
  },

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

  markAsRead: function () {
    this.$el.removeClass('unread');
  }
});

var NotificationAddedEvidenceView = GenericNotificationView.extend({
  template: "notifications/_added_evidence_activity"
});

var NotificationAddedSubchannelView = GenericNotificationView.extend({
  template: "notifications/_added_subchannel_activity"
});

var NotificationOpinionatedView = GenericNotificationView.extend({
  template: "notifications/_opinionated_activity"
});

var NotificationInvitedView = GenericNotificationView.extend({
  template: "notifications/_invited_activity"
});

var NotificationNewChannelView = GenericNotificationView.extend({
  template: "notifications/_new_channel_activity"
});

var AddedFactToChannelView = GenericNotificationView.extend({
  template: 'notifications/_added_fact_to_channel'
});

window.NotificationView = function(opts) {
  switch (opts.model.get("action")) {
    case "added_supporting_evidence":
    case "added_weakening_evidence":
      return new NotificationAddedEvidenceView(opts);

    case "added_subchannel":
{'fraction_non_alphanumeric': 0.13053385416666666, 'fraction_numerical': 0.0, 'mean_word_length': 5.844097995545657, 'pattern_counts': {'":': 6, '<': 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': '3303505', 'n_tokens_mistral': 910, 'n_tokens_neox': 868, 'n_words': 143}