#encoding: utf-8

module TimelineHelper

  def schritt
    current_found = false
    [
      ['Jahr', :years],
      ['Bundesland',:bula],
      ['Filtern nach Werten',:filter],
      ['Filtern nach Namen',:name],
      ['Filtern nach Attributen',:req_categories],
      ['Betrachtete Attribute',:categories],
      ['Ergebnis',:result]
    ].collect do |step|
      if current_found
        step[0]
      else
        if step[1].to_s == @controller.action_name
          current_found = true
          '<b>'+step[0]+'</b>'
        else
          link_to step[0], :action => step[1]
        end
      end
    end.join(' | ')
  end
  
  def preselect_category?(cat)
    if big_session[:timeline][:categories].respond_to?(:include?)
      return big_session[:timeline][:categories].include?(cat.to_s)
    elsif big_session[:timeline][:required_categories].respond_to?(:include?)
      return big_session[:timeline][:required_categories].include?(cat.to_s)
    else return true
    end
  end


end
