%
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 %>
<% if appointment.customer %>
<%= appointment.customer.name %>
<% end %>
<% if appointment.vehicle %>
<%= appointment.vehicle.name %>
<% end %>
<%= render(
partial: "customer_appointments/tooltip",
locals: { appointment: appointment }
) %>
<% end %>