<% if @vehicles.present? %>

  <% @vehicles.each do |vehicle| %>
    <div class="row">
      <div>
        <b><%= link_to "##{vehicle.id}", vehicle_path(vehicle) %> </b>
      </div>
      
      <div>
        <%= vehicle.to_s %>
        <br/>
        <%= vehicle.customer %>
        <br/>
        <%= vehicle.vin.scan(/.{1,9}/)[0] if vehicle.vin %><b><%=vehicle.vin.scan(/.{1,9}/)[1] if vehicle.vin%></b>
      </div>
    </div>
    <br/>
  <% end %>

  <div class="actions">
    <%= will_paginate @vehicles %>
  </div>

<p><%=t(:label_matching)%> <%=@vehicles.count%> <%=t(:field_vehicles) %> </p>

<% else %>
  <p><%=t(:label_no_vehicles)%> <%= params[:search] %>.</p>
<% end %>
