Files
redmine_qbo_vehicles/app/views/vehicles/_form.html.erb
T
Claude 9583bf52a8 Vehicle new/edit pages in Redmine's form style
- labelled_form_for with a "box tabular" form, like core Redmine forms:
  labels on the left, required fields (customer, VIN) marked with *
- Breadcrumb headings ("Vehicles » vehicle"), Create/Save buttons and a
  Cancel link (back to the vehicle, or the customer for new vehicles)
- Field order: customer, VIN, year, make, model, notes; the VIN field
  is limited to 17 characters and keeps focus
- Keeps redmine_qbo's customer autocomplete and the duplicate-VIN link

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-29 23:16:23 -04:00

27 lines
1.2 KiB
ERB

<%= error_messages_for 'vehicle' %>
<% if @existing_vehicle %>
<div class="flash warning">
<%= l(:text_vin_already_on_file) %>
<%= link_to @existing_vehicle.to_s, vehicle_path(@existing_vehicle) %>
</div>
<% end %>
<div class="box tabular">
<p>
<%# Customer autocomplete from redmine_qbo: fills the hidden customer_id %>
<%= f.text_field :customer, label: :field_customer, required: true, size: 60,
value: @vehicle.customer&.name, class: 'customer-name', autocomplete: 'off',
data: { autocomplete_url: '/customers/autocomplete' } %>
<%= f.hidden_field :customer_id, id: 'customer_id' %>
</p>
<p><%= f.text_field :vin, label: :field_vin, required: true, size: 20, maxlength: 17, autofocus: true %></p>
<p><%= f.number_field :year, label: :label_year, min: 1900, max: Date.today.year + 2, autocomplete: 'off' %></p>
<p><%= f.text_field :make, label: :label_make, size: 30, autocomplete: 'off' %></p>
<p><%= f.text_field :model, label: :label_model, size: 30, autocomplete: 'off' %></p>
<p>
<%= f.text_area :notes, label: :field_notes, rows: 8, class: 'wiki-edit', id: 'vehicle_notes' %>
<%= wikitoolbar_for 'vehicle_notes' %>
</p>
</div>