Vehicles paged by Redmine instead of will_paginate

The vehicle search, a customer's vehicles and the customer page's vehicle list use Redmine's paginator
(will_paginate came from redmine_qbo's Gemfile, which no longer has it). The customer page's list keeps
its own page parameter, without per-page links, and lists vehicles by year, make and model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-01 17:47:25 -05:00
1 parent 53991ed087
commit d842b9b724
4 files changed
+22 -9

No files matched your search

+5 -4
View File
@@ -40,11 +40,12 @@
</div>
<% end %>
<div class="actions">
<%= will_paginate vehicles, param_name: (local_assigns[:page_param] || :page) %>
</div>
<%# pages: a Redmine::Pagination::Paginator for the list (count: how many in all); per_page_links: false to leave out "Per page" %>
<% if local_assigns[:pages] %>
<span class="pagination"><%= pagination_links_full pages, count, per_page_links: local_assigns[:per_page_links] %></span>
<% end %>
<%=t(:label_matching)%> <%= vehicles.respond_to?(:total_entries) ? vehicles.total_entries : vehicles.size %> <%=t(:field_vehicles) %>
<%=t(:label_matching)%> <%= local_assigns[:count] || vehicles.size %> <%=t(:field_vehicles) %>
<% else %>
<p><%=t(:label_no_vehicles)%> <%= params[:search] %>.</p>
+1 -1
View File
@@ -1,4 +1,4 @@
<h2><%=t(:label_customer_vehicles)%> <span style="float:right"> <%= render partial: 'vehicles/search' %> </span> </h2>
<br/>
<%= render partial: 'vehicles/list', locals: {vehicles: @vehicles, show_customer: true, show_checkbox: false} %>
<%= render partial: 'vehicles/list', locals: {vehicles: @vehicles, pages: @vehicle_pages, count: @vehicle_count, show_customer: true, show_checkbox: false} %>