<commit_before>class SuperSimpleCms::Controllers::ViewerController < ApplicationController
  unloadable
  def index
    group = SuperSimpleCms::Group.find(:first, :order=>'position')
    # set_links(group.id)
    @page = SuperSimpleCms::Page.find(:first, :conditions=>['group_id = ? AND position = ?', group.id, 1])
    if @page
      @title = @page.title
      render :template => 'viewer/show'
    else
      render :file => "#{RAILS_ROOT}/public/404.html",  
      :status => 404 and return
    end
  end
  
  def show_group
    group = SuperSimpleCms::Group.find_by_group_name(params[:page_group])
    @page = SuperSimpleCms::Page.find(:first, 
                                      :conditions=>['perma_link = ? AND group_id = ?', params[:perma_link], group.id],  
                                      :order=>'position') if group
    if @page
      @title = @page.title
      set_links(group.id)
      render :template => 'viewer/show'
    else
      render :file => "#{RAILS_ROOT}/public/404.html",  
      :status => 404 and return
    end
  end
  
  def show
    group = SuperSimpleCms::Group.find(:first, :order=>'position')
    # set_links(group.id)<commit_msg>adding default current group to index<commit_after>class SuperSimpleCms::Controllers::ViewerController < ApplicationController
  unloadable
  def index
    @current_group = SuperSimpleCms::Group.find(:first, :order=>'position')
    # set_links(group.id)
    @page = SuperSimpleCms::Page.find(:first, :conditions=>['group_id = ? AND position = ?', @current_group.id, 1])
    if @page
      @title = @page.title
      render :template => 'viewer/show'
    else
      render :file => "#{RAILS_ROOT}/public/404.html",  
      :status => 404 and return
    end
  end
  
  def show_group
    group = SuperSimpleCms::Group.find_by_group_name(params[:page_group])
    @page = SuperSimpleCms::Page.find(:first, 
                                      :conditions=>['perma_link = ? AND group_id = ?', params[:perma_link], group.id],  
                                      :order=>'position') if group
    if @page
      @title = @page.title
      set_links(group.id)
      render :template => 'viewer/show'
    else
      render :file => "#{RAILS_ROOT}/public/404.html",  
      :status => 404 and return
    end
  end
  
  def show
    group = SuperSimpleCms::Group.find(:first, :order=>'position')
    # set_links(group.id)
{'fraction_non_alphanumeric': 0.135678391959799, 'fraction_numerical': 0.010887772194304857, 'mean_word_length': 2.6753846153846155, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6811407', 'n_tokens_mistral': 776, 'n_tokens_neox': 748, 'n_words': 148}