mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-11-18 02:40:37 -05:00
- 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
27 lines
1.2 KiB
ERB
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>
|