mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-02-13 17:43:58 -05:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12fb8b47ef | |||
| b02a40827d | |||
| 5165bc20b4 | |||
| f30d735e52 | |||
| a30d8f56d8 | |||
| d22fcd4f66 | |||
| f649d4e902 | |||
| 2db17f3675 |
@@ -64,6 +64,7 @@ class VehiclesController < ApplicationController
|
|||||||
@vin = @vehicle.vin.scan(/.{1,9}/) if @vehicle.vin
|
@vin = @vehicle.vin.scan(/.{1,9}/) if @vehicle.vin
|
||||||
@issues = @vehicle.issues.order(id: :desc)
|
@issues = @vehicle.issues.order(id: :desc)
|
||||||
@closed_issues = (@issues - @issues.open)
|
@closed_issues = (@issues - @issues.open)
|
||||||
|
flash[:error] = t :alert_no_customer if @vehicle.customer.nil?
|
||||||
rescue
|
rescue
|
||||||
flash[:error] = t :alert_vehicle_not_found
|
flash[:error] = t :alert_vehicle_not_found
|
||||||
render_404
|
render_404
|
||||||
|
|||||||
@@ -10,9 +10,5 @@
|
|||||||
|
|
||||||
<div class="vehicle_notes attribute">
|
<div class="vehicle_notes attribute">
|
||||||
<div class="label"><span><%=t(:field_notes)%></span>:</div>
|
<div class="label"><span><%=t(:field_notes)%></span>:</div>
|
||||||
<div class="value">
|
<pre class="value" id="note-display" style="text-align: left; white-space: pre-wrap; font-family: inherit; "><%=notes%></pre>
|
||||||
<pre id="note-display" style="text-align: left; white-space: pre-wrap; font-family: inherit; ">
|
|
||||||
<%=notes%>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t(:field_customer)%></th>
|
<th><%= t(:field_customer)%></th>
|
||||||
<td><%= link_to vehicle.customer.name, customer_path(vehicle.customer) %></td>
|
<td><%= vehicle.customer ? link_to(vehicle.customer.name, customer_path(vehicle.customer)) : t(:no_customer) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -2,26 +2,29 @@
|
|||||||
|
|
||||||
<% vehicles.each do |vehicle| %>
|
<% vehicles.each do |vehicle| %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div>
|
|
||||||
<b><%= link_to "##{vehicle.id}", vehicle_path(vehicle) %> </b>
|
<div class="container">
|
||||||
</div>
|
|
||||||
|
<%= 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 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>
|
|
||||||
<%= vehicle.to_s %>
|
|
||||||
<br/>
|
|
||||||
<%= vehicle.customer %>
|
|
||||||
<br/>
|
|
||||||
<%= vehicle.vin.scan(/.{1,9}/)[0] if vehicle.vin %><b><%=vehicle.vin.scan(/.{1,9}/)[1] if vehicle.vin%></b>
|
|
||||||
</div>
|
</div>
|
||||||
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<%= will_paginate vehicles %>
|
<%= will_paginate vehicles %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><%=t(:label_matching)%> <%=vehicles.count%> <%=t(:field_vehicles) %> </p>
|
<%=t(:label_matching)%> <%=vehicles.count%> <%=t(:field_vehicles) %>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<p><%=t(:label_no_vehicles)%> <%= params[:search] %>.</p>
|
<p><%=t(:label_no_vehicles)%> <%= params[:search] %>.</p>
|
||||||
|
|||||||
23
assets/stylesheets/style.css
Normal file
23
assets/stylesheets/style.css
Normal 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;
|
||||||
|
}
|
||||||
@@ -30,4 +30,7 @@ en:
|
|||||||
alert_vehicle_not_found: "Vehicle not found."
|
alert_vehicle_not_found: "Vehicle not found."
|
||||||
alert_vehicle_not_deleted: "Vehicle could not be deleted."
|
alert_vehicle_not_deleted: "Vehicle could not be deleted."
|
||||||
alert_vehicle_not_created: "Vehicle could not be created."
|
alert_vehicle_not_created: "Vehicle could not be created."
|
||||||
alert_vehicle_not_updated: "Vehicle could not be updated."
|
alert_vehicle_not_updated: "Vehicle could not be updated."
|
||||||
|
no_customer: "Customer no longer exists"
|
||||||
|
alert_no_customer: "Customer no longer exists, check for merged customers or deleted customers in Quick Books Online."
|
||||||
|
|
||||||
2
init.rb
2
init.rb
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo_vehicles do
|
|||||||
name 'Redmine QBO Vehicles plugin'
|
name 'Redmine QBO Vehicles plugin'
|
||||||
author 'Rick Barrette'
|
author 'Rick Barrette'
|
||||||
description 'This is a plugin for Redmine to intergrate with the redmine_qbo plugin to provide vehicle data tracking'
|
description 'This is a plugin for Redmine to intergrate with the redmine_qbo plugin to provide vehicle data tracking'
|
||||||
version '2026.1.7'
|
version '2026.2.2'
|
||||||
url 'https://github.com/rickbarrette/redmine_qbo_vehicles'
|
url 'https://github.com/rickbarrette/redmine_qbo_vehicles'
|
||||||
author_url 'https://barrettefabrication.com'
|
author_url 'https://barrettefabrication.com'
|
||||||
requires_redmine version_or_higher: '6.1.0'
|
requires_redmine version_or_higher: '6.1.0'
|
||||||
|
|||||||
23
lib/vehicles/hooks/view_hook_listener.rb
Normal file
23
lib/vehicles/hooks/view_hook_listener.rb
Normal 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
|
||||||
Reference in New Issue
Block a user