<commit_before>Backbone = require "backbone"
_ = require 'underscore'
sd = require("sharify").data
mediator = require '../../../lib/mediator.coffee'
PathView = require '../../../components/path/client/path_view.coffee'
ChannelConnections = require '../../../collections/channel_connections.coffee'
Collaborators = require '../../../collections/collaborators.coffee'
EditableAttributeView = require '../../../components/editable_attribute/client/editable_attribute_view.coffee'
MetaEditableAttributeView = require '../../../components/editable_attribute/client/meta_editable_attribute_view.coffee'
ConnectView = require '../../../components/connect/client/connect_view.coffee'
ChannelCollaborationView = require './channel_collaboration_view.coffee'
ChannelConnectionsView = require './channel_connections_view.coffee'
ChannelVisibilityView = require '../../../components/channel_visibility/client/channel_visibility_view.coffee'
ChannelExportView = require '../../../components/channel_export/client/channel_export_view.coffee'
ShareLinkView = require '../../../components/share_link/client/share_link_view.coffee'

module.exports.ChannelPathView = class ChannelPathView extends PathView

  # _.extend PathView.prototype.events,
  events:
    'click .toggle-settings-trigger' : 'toggleSettings'
    'click .delete-channel' : 'showConfirmation'
    'click .delete-channel a' : 'showConfirmation'
    'click .delete-channel--confirmation__yes' : 'deleteChannel'
    'click .delete-channel--confirmation__no'  : 'hideConfirmation'
    'click .connect_button': 'loadConnectView'

  initialize: ->
    super
    mediator.on 'channel:is-editable', @setupEditableViews, @
    @model.on 'change:follower_count', @updateFollowerCount, @

  setupSubViews: ->
    super

  updateFollowerCount: ->
    @$('.js-channel-follower-count').html "<a href='#{@channel.href()}/followers'> #{@channel.get('follower_count')} Followers</a>"

  toggleSettings: (e)->
    @$('.metadata--container').toggleClass 'settings-is-active'
    if !$('.metadata__column').hasClass 'is-expanded'
      @$('.metadata__column').toggleClass 'is-expanded'

  showConfirmation: ->
    @$('.delete-channel--confirmation').addClass 'is-active'

  hideConfirmation: -><commit_msg>fixes follower count<commit_after>Backbone = require "backbone"
_ = require 'underscore'
sd = require("sharify").data
mediator = require '../../../lib/mediator.coffee'
PathView = require '../../../components/path/client/path_view.coffee'
ChannelConnections = require '../../../collections/channel_connections.coffee'
Collaborators = require '../../../collections/collaborators.coffee'
EditableAttributeView = require '../../../components/editable_attribute/client/editable_attribute_view.coffee'
MetaEditableAttributeView = require '../../../components/editable_attribute/client/meta_editable_attribute_view.coffee'
ConnectView = require '../../../components/connect/client/connect_view.coffee'
ChannelCollaborationView = require './channel_collaboration_view.coffee'
ChannelConnectionsView = require './channel_connections_view.coffee'
ChannelVisibilityView = require '../../../components/channel_visibility/client/channel_visibility_view.coffee'
ChannelExportView = require '../../../components/channel_export/client/channel_export_view.coffee'
ShareLinkView = require '../../../components/share_link/client/share_link_view.coffee'

module.exports.ChannelPathView = class ChannelPathView extends PathView

  # _.extend PathView.prototype.events,
  events:
    'click .toggle-settings-trigger' : 'toggleSettings'
    'click .delete-channel' : 'showConfirmation'
    'click .delete-channel a' : 'showConfirmation'
    'click .delete-channel--confirmation__yes' : 'deleteChannel'
    'click .delete-channel--confirmation__no'  : 'hideConfirmation'
    'click .connect_button': 'loadConnectView'

  initialize: ->
    super
    mediator.on 'channel:is-editable', @setupEditableViews, @
    @model.on 'change:follower_count', @updateFollowerCount, @

  setupSubViews: ->
    super

  updateFollowerCount: ->
    @$('.js-channel-follower-count').html "<a href='#{@model.href()}/followers'> #{@model.get('follower_count')} Followers</a>"

  toggleSettings: (e)->
    @$('.metadata--container').toggleClass 'settings-is-active'
    if !$('.metadata__column').hasClass 'is-expanded'
      @$('.metadata__column').toggleClass 'is-expanded'

  showConfirmation: ->
    @$('.delete-channel--confirmation').addClass 'is-active'

  hideConfirmation: ->
{'fraction_non_alphanumeric': 0.16171543444270717, 'fraction_numerical': 0.0, 'mean_word_length': 4.5352286773794805, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '1359425', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1299, 'n_words': 200}