app/controllers/observations_controller.rb
def id_please
    params[:order_by] ||= "created_at"
    params[:order] ||= "desc"
    search_params, find_options = get_search_params(params)
    search_params = site_search_params(search_params)
    find_options.update(
      :per_page => 10,
      :include => [
        :user, 
        {:taxon => [:taxon_names]}, 
        :tags, 
        :photos, 
        {:identifications => [{:taxon => [:taxon_names]}, :user]}, 
        {:comments => [:user]}
      ]
    )
    if search_params[:has]
      search_params[:has] = (search_params[:has].split(',') + ['id_please']).flatten.uniq
    else
      search_params[:has] = 'id_please'
    end
    
    if search_params[:q].blank?
      get_paginated_observations(search_params, find_options)
    else
      search_observations(search_params, find_options)
    end
    
    @top_identifiers = User.order("identifications_count DESC").limit(5)
    if @site && @site.site_only_users
      @top_identifiers = @top_identifiers.where(:site_id => @site)
    end
  end
# shows observations in need of an ID
shows observations in need of an ID
shows observations in need of an ID
def id_please
    params[:order_by] ||= "created_at"
    params[:order] ||= "desc"
    search_params, find_options = get_search_params(params)
    search_params = site_search_params(search_params)
    find_options.update(
      :per_page => 10,
      :include => [
        :user, 
        {:taxon => [:taxon_names]}, 
        :tags, 
        :photos, 
        {:identifications => [{:taxon => [:taxon_names]}, :user]}, 
        {:comments => [:user]}
      ]
    )
    if search_params[:has]
      search_params[:has] = (search_params[:has].split(',') + ['id_please']).flatten.uniq
    else
      search_params[:has] = 'id_please'
    end
    if search_params[:q].blank?
      get_paginated_observations(search_params, find_options)
    else
      search_observations(search_params, find_options)
    end
    @top_identifiers = User.order("identifications_count DESC").limit(5)
    if @site && @site.site_only_users
      @top_identifiers = @top_identifiers.where(:site_id => @site)
    end
  end
def id_please params [ :order_by ] ||= "created_at" params [ :order ] ||= "desc" search_params , find_options = get_search_params ( params ) search_params = site_search_params ( search_params ) find_options . update ( :per_page => 10 , :include => [ :user , { :taxon => [ :taxon_names ] } , :tags , :photos , { :identifications => [ { :taxon => [ :taxon_names ] } , :user ] } , { :comments => [ :user ] } ] ) if search_params [ :has ] search_params [ :has ] = ( search_params [ :has ] . split ( ',' ) + [ 'id_please' ] ) . flatten . uniq else search_params [ :has ] = 'id_please' end if search_params [ :q ] . blank? get_paginated_observations ( search_params , find_options ) else search_observations ( search_params , find_options ) end @top_identifiers = User . order ( "identifications_count DESC" ) . limit ( 5 ) if @site && @site . site_only_users @top_identifiers = @top_identifiers . where ( :site_id => @site ) end end
shows observations in need of an ID
shows observations in need of an ID