mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-04-02 07:01:59 -04:00
added show_customer and show_checkbox options to vehicle list
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<h4><%=t(:field_vehicles)%>:</h4>
|
<h4><%=t(:field_vehicles)%>:</h4>
|
||||||
<%= render partial: 'vehicles/list', locals: { vehicles: customer.vehicles.paginate(page: params[:page]) } %>
|
<%= render partial: 'vehicles/list', locals: { vehicles: customer.vehicles.paginate(page: params[:page]), show_customer: false, show_checkbox: false } %>
|
||||||
<div style="float: right;">
|
<div style="float: right;">
|
||||||
<%= button_to t(:button_new_vehicle), new_customer_vehicle_path(customer), method: :get %>
|
<%= button_to t(:button_new_vehicle), new_customer_vehicle_path(customer), method: :get %>
|
||||||
</div>
|
</div>
|
||||||
@@ -5,7 +5,12 @@
|
|||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<%= check_box_tag "vehicle_ids[]", vehicle.id, false, onchange: "updateLink()", data: { url: vehicle_path(vehicle).html_safe, text: vehicle.to_s }, class: "appointment checkbox" %>
|
<% if show_checkbox %>
|
||||||
|
<%= check_box_tag "vehicle_ids[]", vehicle.id, false, onchange: "updateLink()", data: { url: vehicle_path(vehicle).html_safe, text: vehicle.to_s }, class: "appointment checkbox" %>
|
||||||
|
<% else %>
|
||||||
|
<div class='checkbox'>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class='label-main'>
|
<div class='label-main'>
|
||||||
<%= link_to vehicle.to_s, vehicle_path(vehicle) %>
|
<%= link_to vehicle.to_s, vehicle_path(vehicle) %>
|
||||||
@@ -13,6 +18,10 @@
|
|||||||
|
|
||||||
<div class="label-sub">
|
<div class="label-sub">
|
||||||
<a href="#" onclick="handleCopy(event)"><%= vehicle.vin.scan(/.{1,9}/)[0] if vehicle.vin %><b><%=vehicle.vin.scan(/.{1,9}/)[1] if vehicle.vin%></b></a>
|
<a href="#" onclick="handleCopy(event)"><%= vehicle.vin.scan(/.{1,9}/)[0] if vehicle.vin %><b><%=vehicle.vin.scan(/.{1,9}/)[1] if vehicle.vin%></b></a>
|
||||||
|
<% if show_customer %>
|
||||||
|
<br/>
|
||||||
|
<%= vehicle.customer %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<h2><%=t(:label_customer_vehicles)%> <span style="float:right"> <%= render partial: 'vehicles/search' %> </span> </h2>
|
<h2><%=t(:label_customer_vehicles)%> <span style="float:right"> <%= render partial: 'vehicles/search' %> </span> </h2>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<%= render partial: 'vehicles/list', locals: {vehicles: @vehicles} %>
|
<%= render partial: 'vehicles/list', locals: {vehicles: @vehicles, show_customer: true, show_checkbox: false} %>
|
||||||
|
|||||||
Reference in New Issue
Block a user