<commit_before>class ChannelsController < ApplicationController

  layout "channels"
  
  before_filter :get_user

  before_filter :load_channel, 
    :only => [
      :show,
      :edit,
      :destroy,
      :update,
      :facts,
      :related_users,
      :activities]
  
  before_filter :authenticate_user!,
    :except => [
      :index,
      :show,
      :facts,
      :related_users
      ]

  # GET /:username/channels
  def index
    @channels = @user.graph_user.channels
    
    respond_to do |format|
      format.json { render :json => @channels.map {|ch| Channels::SingleMenuItem.for_channel_and_view(ch,self,@user)} }
      format.js
    end
  end

  # GET /:username/channels/1
  def show
    respond_to do |format|
      format.json { render :json => Channels::SingleMenuItem.for_channel_and_view(@channel,self,@user)}
      format.js
      format.html do
        @channel.mark_as_read
        render :action => "facts" <commit_msg>channels controller can now render its own "show"<commit_after>class ChannelsController < ApplicationController

  layout "channels"
  
  before_filter :get_user

  before_filter :load_channel, 
    :only => [
      :show,
      :edit,
      :destroy,
      :update,
      :facts,
      :related_users,
      :activities]
  
  before_filter :authenticate_user!,
    :except => [
      :index,
      :show,
      :facts,
      :related_users
      ]

  # GET /:username/channels
  def index
    @channels = @user.graph_user.channels
    
    respond_to do |format|
      format.json { render :json => @channels.map {|ch| Channels::SingleMenuItem.for_channel_and_view(ch,self,@user)} }
      format.js
    end
  end

  # GET /:username/channels/1
  def show
    respond_to do |format|
      format.json { render :json => Channels::SingleMenuItem.for_channel_and_view(@channel,self,@user)}
      format.js
      format.html do
        @channel.mark_as_read
{'fraction_non_alphanumeric': 0.10866141732283464, 'fraction_numerical': 0.0010498687664041995, 'mean_word_length': 2.6030245746691874, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '6949593', 'n_tokens_mistral': 624, 'n_tokens_neox': 604, 'n_words': 124}