Changed display format of vehicle lists

This commit is contained in:
2026-02-13 07:48:36 -05:00
parent f30d735e52
commit 5165bc20b4
3 changed files with 60 additions and 12 deletions

View File

@@ -2,27 +2,29 @@
<% vehicles.each do |vehicle| %>
<div class="row">
<div>
<%= check_box_tag "vehicle_ids[]", vehicle.id, false, onchange: "updateLink()", data: { url: vehicle_path(vehicle).html_safe, text: vehicle.to_s }, class: "appointment" %>
<b><%= link_to "##{vehicle.id}", vehicle_path(vehicle) %> </b>
<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" %>
<div class='label-main'>
<%= link_to vehicle.to_s, vehicle_path(vehicle) %>
</div>
<div>
<%= vehicle.to_s %>
<br/>
<%= vehicle.customer %>
<br/>
<div class="label-sub">
<%= vehicle.vin.scan(/.{1,9}/)[0] if vehicle.vin %><b><%=vehicle.vin.scan(/.{1,9}/)[1] if vehicle.vin%></b>
</div>
</div>
<br/>
</div>
<% end %>
<div class="actions">
<%= will_paginate vehicles %>
</div>
<p><%=t(:label_matching)%> <%=vehicles.count%> <%=t(:field_vehicles) %> </p>
<%=t(:label_matching)%> <%=vehicles.count%> <%=t(:field_vehicles) %>
<% else %>
<p><%=t(:label_no_vehicles)%> <%= params[:search] %>.</p>

View File

@@ -0,0 +1,23 @@
.container {
display: grid;
/* Column 1 for checkbox, Column 2 for text */
grid-template-columns: auto 1fr;
/* Row 1 for 'Vehicle', Row 2 for 'VIN' */
grid-template-rows: auto auto;
align-items: center;
gap: 0 10px; /* Adjust spacing between checkbox and text */
}
.checkbox {
/* This makes the checkbox take up both rows */
grid-row: span 2;
}
.label-main {
font-weight: bold;
}
.label-sub {
font-size: 0.85em;
color: #666;
}

View File

@@ -0,0 +1,23 @@
#The MIT License (MIT)
#
#Copyright (c) 2016 - 2026 rick barrette
#
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
module Vehicles
module Hooks
class ViewHookListener < Redmine::Hook::ViewListener
def view_layouts_base_html_head(context = {})
safe_join([
stylesheet_link_tag('style', plugin: :redmine_qbo_vehicles, media: :all)
])
end
end
end
end