<commit_before>class window.ActivityItemView extends Backbone.Marionette.ItemView
  tryAppend: (model) -> false

  @classForModel: (model) ->
    switch model.get("action")
      when "created_comment", "created_fact_relation"
        CreatedFactRelationView
      when "created_sub_comment"
        CreatedSubCommentView
      when "believes", "doubts", "disbelieves"
        AddedOpinionView
      when "added_fact_to_channel" # TODO: rename actual activity to added_fact_to_topic
        AddedFactToTopicGroupView
      when 'followed_user'
        FollowedUserView
      else
        throw 'Unknown activity action: ' + model.get("action")


class CreatedFactRelationView extends ActivityItemView
  template: "activities/created_fact_relation"

class CreatedSubCommentView extends ActivityItemView
  template: "activities/created_sub_comment"

class AddedOpinionView extends ActivityItemView
  template: "activities/added_opinion"
  templateHelpers: =>
    translated_action: @_translatedAction()

  _translatedAction: ->
    switch @model.get('action')
      when "believes"
        Factlink.Global.t.fact_believe_past_singular_action_about
      when "believes"
        Factlink.Global.t.fact_disbelieve_past_singular_action_about
      when "believes"
        Factlink.Global.t.fact_doubt_past_singular_action_about

class FollowedUserView extends ActivityItemView
  tagName: 'span'
  className: 'separator-list-item'
  template: "activities/followed_user"
  templateHelpers: =>
    followed_user: @user().toJSON()

  onRender: ->
    UserPopoverContentView.makeTooltip @, @user(),
      selector: '.js-activity-user'
      $offsetParent: @options.$offsetParent

  user: -> @_user ?= new User(@model.get('activity').followed_user)

class AddedFactToTopicView extends ActivityItemView
  _.extend @prototype, Backbone.Factlink.PopoverMixin

  tagName: 'span'
  className: 'separator-list-item'
  template: 'activities/added_fact_to_topic'

  templateHelpers: ->
    topic: @topic().toJSON()<commit_msg>Fixed believes => disbelieves/doubts<commit_after>class window.ActivityItemView extends Backbone.Marionette.ItemView
  tryAppend: (model) -> false

  @classForModel: (model) ->
    switch model.get("action")
      when "created_comment", "created_fact_relation"
        CreatedFactRelationView
      when "created_sub_comment"
        CreatedSubCommentView
      when "believes", "doubts", "disbelieves"
        AddedOpinionView
      when "added_fact_to_channel" # TODO: rename actual activity to added_fact_to_topic
        AddedFactToTopicGroupView
      when 'followed_user'
        FollowedUserView
      else
        throw 'Unknown activity action: ' + model.get("action")


class CreatedFactRelationView extends ActivityItemView
  template: "activities/created_fact_relation"

class CreatedSubCommentView extends ActivityItemView
  template: "activities/created_sub_comment"

class AddedOpinionView extends ActivityItemView
  template: "activities/added_opinion"
  templateHelpers: =>
    translated_action: @_translatedAction()

  _translatedAction: ->
    switch @model.get('action')
      when "believes"
        Factlink.Global.t.fact_believe_past_singular_action_about
      when "disbelieves"
        Factlink.Global.t.fact_disbelieve_past_singular_action_about
      when "doubts"
        Factlink.Global.t.fact_doubt_past_singular_action_about

class FollowedUserView extends ActivityItemView
  tagName: 'span'
  className: 'separator-list-item'
  template: "activities/followed_user"
  templateHelpers: =>
    followed_user: @user().toJSON()

  onRender: ->
    UserPopoverContentView.makeTooltip @, @user(),
      selector: '.js-activity-user'
      $offsetParent: @options.$offsetParent

  user: -> @_user ?= new User(@model.get('activity').followed_user)

class AddedFactToTopicView extends ActivityItemView
  _.extend @prototype, Backbone.Factlink.PopoverMixin

  tagName: 'span'
  className: 'separator-list-item'
  template: 'activities/added_fact_to_topic'

  templateHelpers: ->
    topic: @topic().toJSON()
{'fraction_non_alphanumeric': 0.08989598811292719, 'fraction_numerical': 0.0, 'mean_word_length': 4.307490144546649, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, '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': '4821810', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1185, 'n_words': 229}