Files
redmine_qbo_calendar/app/views/customer_appointments/_calendar_event.html.erb
T
2026-08-06 16:05:33 -04:00

69 lines
1.5 KiB
ERB

<%
day_hours = 8.0
day_height = 120
hours = appointment.estimated_hours.to_f
height = [(hours / day_hours * day_height).round, 26].max
%>
<%= tag.div class: ['appointment-block', 'tooltip'],
style: "height: #{height}px;" do %>
<div class="appointment-card">
<div class="appointment-header">
<% if appointment.user %>
<%= avatar(
appointment.user,
size: 20,
class: "appointment-avatar"
) %>
<% end %>
<div class="appointment-title">
<%= link_to(
appointment.subject,
customer_appointment_path(appointment),
class: "appointment-link"
) %>
</div>
</div>
<% if appointment.customer %>
<div class="appointment-customer">
<%= appointment.customer.name %>
</div>
<% end %>
<% if appointment.vehicle %>
<div class="appointment-vehicle">
<%= appointment.vehicle.name %>
</div>
<% end %>
<div class="appointment-footer">
<span class="appointment-hours">
<%= number_with_precision(hours, precision: 1) %> hrs
</span>
<% if appointment.user %>
<span class="appointment-tech">
<%= appointment.user.firstname %>
</span>
<% end %>
</div>
</div>
<span class="tip">
<%= render(
partial: "customer_appointments/tooltip",
locals: { appointment: appointment }
) %>
</span>
<% end %>