<commit_before>class ChannelItemView extends Backbone.Marionette.ItemView
  _.extend @prototype, ClassToggleMixin('active')

  tagName: 'li'
  className: 'sidebar-item'
  template: 'channels/single_menu_item'

  initialize: ->
    @model.on 'activate', @activeOn, @
    @model.on 'deactivate', @activeOff, @

  onRender: ->
    @activeOn() if @model.isActive()

class window.ChannelHeaderView extends Backbone.Marionette.ItemView
  tagName: 'ul'
  template: 'channels/list_header'

  templateHelpers: =>
    channel_listing_header: Factlink.Global.t.topics.capitalize()

class window.ChannelListView extends Backbone.Marionette.CollectionView
  itemView: ChannelItemView
  tagName: 'ul'

class window.ChannelsView extends Backbone.Marionette.Layout
  template: 'channels/channel_list'
  className: 'left-sidebar'

  regions:
    list:   '.channel-listing-container'
    header: '.channel-listing-header'

  onRender: ->
    @list.show new ChannelListView(collection: @collection)
    @header.show new ChannelHeaderView(@options)

  setActiveChannel: (channel)->
    if channel?
      @collection.setActive(channel)
    else
      @collection.unsetActive()
<commit_msg>Use identical topics/sidebar/item<commit_after>class ChannelItemView extends Backbone.Marionette.ItemView
  _.extend @prototype, ClassToggleMixin('active')

  tagName: 'li'
  className: 'sidebar-item'
  template: 'topics/sidebar/item'

  initialize: ->
    @model.on 'activate', @activeOn, @
    @model.on 'deactivate', @activeOff, @

  onRender: ->
    @activeOn() if @model.isActive()

class window.ChannelHeaderView extends Backbone.Marionette.ItemView
  tagName: 'ul'
  template: 'channels/list_header'

  templateHelpers: =>
    channel_listing_header: Factlink.Global.t.topics.capitalize()

class window.ChannelListView extends Backbone.Marionette.CollectionView
  itemView: ChannelItemView
  tagName: 'ul'

class window.ChannelsView extends Backbone.Marionette.Layout
  template: 'channels/channel_list'
  className: 'left-sidebar'

  regions:
    list:   '.channel-listing-container'
    header: '.channel-listing-header'

  onRender: ->
    @list.show new ChannelListView(collection: @collection)
    @header.show new ChannelHeaderView(@options)

  setActiveChannel: (channel)->
    if channel?
      @collection.setActive(channel)
    else
      @collection.unsetActive()

{'fraction_non_alphanumeric': 0.1127659574468085, 'fraction_numerical': 0.0, 'mean_word_length': 4.492990654205608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1074596', 'n_tokens_mistral': 736, 'n_tokens_neox': 709, 'n_words': 144}