- if @term
  - content_for :title, "Crops matching \"#{@term}\""
  %h1 Crops matching "#{@term}"
  - if @crops
    %h2 #{@crops.size} total

- else
  - content_for :title, "Crop search"
  %h1 Crop search

- content_for :breadcrumbs do
    %li.breadcrumb-item= link_to 'Crops', crops_path
    %li.breadcrumb-item.active= link_to 'Search', search_crops_path(term: @term)

%div
  = form_tag search_crops_path, method: :get, id: 'crop-search', class: 'form-inline' do
    .form-group
      = label_tag :term, "Search crops:", class: 'sr-only'
      = text_field_tag 'term', nil,
                       class: 'search-query input-medium form-control',
                       placeholder: 'Search crops',
                       value: @term
    = submit_tag "Search", class: 'btn btn-primary'

- if @crops.empty?
  %h2 No results found
  %p
    Sorry, we couldn't find any crops that matched your search for "#{@term}".
  %p
    Try
    = link_to "browsing our crop database", crops_path
    instead.

- else
  .pagination= render 'layouts/pagination', collection: @crops

  .crops
    .row
      - @crops.each do |crop|
        .col-6.col-md-3= render 'crops/thumbnail', crop: crop


  .pagination= render 'layouts/pagination', collection: @crops

- if @term
  - content_for :title, "Crops matching \"#{@term}\""
  %h1 Crops matching "#{@term}"
  - if @crops
    %h2 #{@crops.size} total

- else
  - content_for :title, "Crop search"
  %h1 Crop search

- content_for :breadcrumbs do
  %li.breadcrumb-item= link_to 'Crops', crops_path
  %li.breadcrumb-item.active= link_to 'Search', search_crops_path(term: @term)

%div
  = form_tag search_crops_path, method: :get, id: 'crop-search', class: 'form-inline' do
    .form-group
      = label_tag :term, "Search crops:", class: 'sr-only'
      = text_field_tag 'term', nil,
                       class: 'search-query input-medium form-control',
                       placeholder: 'Search crops',
                       value: @term
    = submit_tag "Search", class: 'btn btn-primary'

- if @crops.empty?
  %h2 No results found
  %p
    Sorry, we couldn't find any crops that matched your search for "#{@term}".
  %p
    Try
    = link_to "browsing our crop database", crops_path
    instead.

- else
  .pagination= render 'layouts/pagination', collection: @crops

  .crops
    .row
      - @crops.each do |crop|
        .col-6.col-md-3= render 'crops/thumbnail', crop: crop


  .pagination= render 'layouts/pagination', collection: @crops

Fix tabulation error in haml
Fix tabulation error in haml
