<% 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.user %> <%= avatar( appointment.user, size: 20, class: "appointment-avatar" ) %> <% end %>
<%= link_to( appointment.subject, customer_appointment_path(appointment), class: "appointment-link" ) %>
<% if appointment.customer %>
<%= appointment.customer.name %>
<% end %> <% if appointment.vehicle %>
<%= appointment.vehicle.name %>
<% end %>
<%= render( partial: "customer_appointments/tooltip", locals: { appointment: appointment } ) %> <% end %>