% html_title @vehicle.to_s %>
<%= render partial: 'vehicles/trail', locals: { vehicle: @vehicle, tail: @vehicle.to_s } %>
<%# Under the title, like the customer page (redmine_qbo's qbo-under-title) %>
<% if User.current.allowed_to?(:edit_vehicles, nil, global: true) %>
<%= link_to sprite_icon('edit', l(:button_edit)), edit_vehicle_path(@vehicle),
class: 'icon icon-edit', accesskey: accesskey(:edit) %>
<% end %>
<%# Vehicles with issues can't be deleted, to keep their service history %>
<% if User.current.allowed_to?(:delete_vehicles, nil, global: true) && !@vehicle.issues.exists? %>
<%= delete_link vehicle_path(@vehicle) %>
<% end %>
<% unless @vehicle.vin_decoded? %>
">
<% if @vehicle.error%>
<%= @vehicle.error %>
<% else %>
<%= t :notice_decoding_vin %>
<% end %>
<% end %>
<%= render partial: 'vehicles/details', locals: {vehicle: @vehicle} %>
<%=t(:label_estimates)%>:
<%= render partial: 'estimates/list', locals: {estimates: @vehicle.estimates} %>
<%=t(:label_invoices)%>:
<%= render partial: 'invoices/list', locals: {invoices: @vehicle.invoices} %>