mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-04 04:40:43 -04:00
69 lines
1.5 KiB
ERB
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 %> |