Link appointment history from customer page and calendar

- Customer page list now shows a History link and a 'View all N past
  appointments' link; it also renders when a customer has history but
  nothing upcoming
- Calendar toolbar gets an Appointment History button
- Calendar tooltip gets a history icon next to the customer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
Claude committed 2026-10-28 15:43:25 -04:00
1 parent a4095b947f
commit 78fe22f004
6 files changed
+93 -61

No files matched your search

@@ -1,58 +1,49 @@
<h4><%=t(:label_appointments)%>:</h4>
<table class="list">
<div class="customer-appointments-simple">
<div class="contextual">
<%= link_to history_customer_appointments_path(customer_id: customer.id), title: l(:label_appointment_history) do %>
<i class="fa-solid fa-clock-rotate-left"></i> <%= l(:label_history) %>
<% end %>
</div>
<thead>
<h4><%= l(:label_upcoming_customer_appointments) %>:</h4>
<tr>
<% if appointments.any? %>
<table class="list">
<thead>
<tr>
<th><%= l(:label_appointment) %></th>
<th><%= l(:label_user) %></th>
<th><%= l(:label_date) %></th>
<th><%= l(:label_status) %></th>
</tr>
</thead>
<tbody>
<% appointments.each do |appointment| %>
<tr>
<td><%= link_to appointment %></td>
<td><%= link_to appointment.user unless appointment.user.nil? %></td>
<td><%= format_date(appointment.date) %></td>
<td>
<% if appointment.status.present? %>
<span class="status-badge status-<%= appointment.status.to_s.parameterize %>">
<%= appointment.status.to_s.humanize %>
</span>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_upcoming_appointments) %></p>
<% end %>
<th><%= l(:label_appointment) %></th>
<th><%= l(:label_user) %></th>
<th><%= l(:label_date) %></th>
<th><%= l(:label_status) %></th>
</tr>
</thead>
<tbody>
<% appointments.each do |appointment| %>
<tr>
<td>
<%= link_to appointment %>
</td>
<td>
<%= link_to appointment.user unless appointment.user.nil? %>
</td>
<td>
<%= format_date(
appointment.date
) %>
</td>
<td>
<%= appointment.status %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% if past_count.to_i > 0 %>
<p class="appointment-history-link">
<%= link_to history_customer_appointments_path(customer_id: customer.id) do %>
<i class="fa-solid fa-clock-rotate-left"></i>
<%= l(:label_view_past_appointments, count: past_count) %>
<% end %>
</p>
<% end %>
</div>
@@ -19,7 +19,13 @@
<% if appointment.customer %>
<tr>
<th><%= l(:label_customer) %></th>
<td><%= link_to appointment.customer %></td>
<td>
<%= link_to appointment.customer %>
<%= link_to history_customer_appointments_path(customer_id: appointment.customer_id),
title: l(:label_appointment_history), class: 'appointment-history-icon' do %>
<i class="fa-solid fa-clock-rotate-left"></i>
<% end %>
</td>
</tr>
<% end %>