/ @begin web_filter
-case search_type
  -when Search::PARAM_BAND
    -filter_label =:band
  -when Search::PARAM_MUSICIAN
    -filter_label =:musician
  -when Search::PARAM_FEED
    -filter_label =:feed
  -when Search::PARAM_JAMTRACK
    -filter_label =:jamtrack
=content_tag(:div, :id => defined?(id) ? id : 'session-controls', :class => "#{filter_label}-filter filter-head") do
  =content_tag(:div, :class => "filter-element wrapper") do
    -if :feed==filter_label
      =content_tag(:div, 'Sort Feed by:', :class => 'filter-element desc')
      =select_tag("#{filter_label}_order_by", options_for_select(Search::F_SORT_OPTS), {:class => "#{filter_label}-order-by easydropdown" } )      
    -elsif :jamtrack !=filter_label
      =content_tag(:div, 'Order By:', :class => 'filter-element desc')
      =select_tag("#{filter_label}_order_by", options_for_select(Search::M_ORDERINGS), {:class => "#{filter_label}-order-by easydropdown"} )      
  =content_tag(:div, :class => 'filter-element wrapper') do
    / -if (:band==filter_label || :jamtrack==filter_label)
    /   =content_tag(:div, 'Genre:', :class => 'filter-element desc')
    /   =select_tag("#{filter_label}_genre",                                                                                                |
    /     options_for_select([['Any', '']].concat(JamRuby::Genre.all.collect { |ii| [ii.description, ii.id] })), {:class => 'easydropdown'}) |
    -if :jamtrack==filter_label
      =content_tag(:div, 'Filter JamTracks:', :class => 'filter-element desc')
      =select_tag("#{filter_label}_artist", options_for_select([['Any Band', '']].concat(JamTrack.all_artists.collect { |ii| [ii, ii] })), {:class => 'easydropdown'})
  =content_tag(:div, :class => 'filter-element wrapper') do
    -if :musician==filter_label || :jamtrack==filter_label
      / =content_tag(:div, 'Instrument:', :class => 'filter-element desc instrument-selector')
      =select_tag("#{filter_label}_instrument", options_for_select([['Any Instrument', '']].concat(JamRuby::Instrument.order('description').collect { |ii| [ii.description, ii.id] })), {:class=> "easydropdown"}) |
    -if :feed==filter_label
      / =content_tag(:div, 'Include Dates:', :class => 'filter-element desc')
      =select_tag("#{filter_label}_date", options_for_select(Search::DATE_OPTS), {:class => "easydropdown"})      
  =content_tag(:div, :class => 'filter-element wrapper') do
    -if :feed==filter_label
      =content_tag(:div, 'Show:', :class => 'filter-element desc')
      =select_tag("#{filter_label}_show", options_for_select(Search::SHOW_OPTS), {:class => "easydropdown"})      
    -elsif :musician==filter_label
      =content_tag(:div, 'Latency:', :class => 'filter-element desc latency-or-distance')
      =content_tag(:div, :class => 'query-distance-params') do
        =select_tag("musician_query_score", options_for_select(Search::M_SCORE_OPTS, Search::M_SCORE_DEFAULT), {:class => 'easydropdown'})
        =select_tag("musician_distance", options_for_select(Search::M_DISTANCE_OPTS, Search::M_DISTANCE_DEFAULT), {:class => 'easydropdown'})
      #musician-search-city.filter-element.desc
        to
        %a#musician-change-filter-city{:href => "#"}
          %span#musician-filter-city      
    -elsif :jamtrack==filter_label
      / =content_tag(:div, 'Availability:', :class => 'filter-element desc')
      / =select_tag("#{filter_label}_availability", options_for_select([['Any Availability', '']].concat(JamRuby::JamTrack::SALES_REGION), ''), {:class => "easydropdown"})
    -else
      =content_tag(:div, 'Within', :class => 'filter-element desc')
      =content_tag(:div, :class => 'query-distance-params') do
        -default_distance =:musician==filter_label ? Search::M_MILES_DEFAULT : Search::B_MILES_DEFAULT
        =select_tag("#{filter_label}_query_distance", options_for_select(Search::DISTANCE_OPTS, default_distance), {:class => 'easydropdown'})
      =content_tag(:div, :class => 'filter-element desc') do
        miles of #{content_tag(:span, current_user ? current_user.current_city(request.remote_ip) : '', :id => "#{filter_label}-filter-city")}      
  -if :feed==filter_label
    .btn-refresh-holder
      %a.button-grey.btn-refresh-entries{:href => "/client#/feed"} REFRESH
  -elsif :musician==filter_label
    .btn-refresh-holder
      %a.button-grey.btn-refresh-entries{:href => "/client#/musicians"} REFRESH