<%= link_to issues_calendar_path do %> <%= l(:button_calendar) %> <% end %> <%= link_to customer_appointments_path do %> <%= l(:button_appointments) %> <% end %> <%= link_to edit_customer_appointment_path(@appointment) do %> <%= l(:button_edit) %> <% end %> <%= link_to customer_appointment_path(@appointment), method: :delete, data: { confirm: l(:text_are_you_sure) } do %> <%= l(:button_delete) %> <% end %>

<% if @appointment.date %>
<%= @appointment.date.strftime('%b').upcase %>
<%= @appointment.date.day %>
<% end %> <%= @appointment.subject %> <% if @appointment.date %> (<%= format_date(@appointment.date) %> <%= l(:label_at, default: 'at') %> <%= @appointment.date.strftime('%I:%M %p') %> <% if @appointment.respond_to?(:due_date) && @appointment.due_date.present? && @appointment.duration.to_i > 1 %> - <%= format_date(@appointment.due_date) %> <% end %>) <% end %>

<%# Quick Status Action Buttons %> <% statuses = CustomerAppointment.statuses current_status = @appointment.status.to_s.parameterize.underscore %>
<%= l(:label_change_status, default: 'Change Status:') %> <% statuses.reject { |s| s == current_status }.each do |status_key| %> <%= link_to status_key.humanize, customer_appointment_path(@appointment, customer_appointment: { status: status_key }), method: :patch, class: "quick-status-btn status-#{status_key.parameterize}" %> <% end %>
<%= l(:label_customer, default: 'Customer') %>:
<%= link_to_if @appointment.customer, @appointment.customer&.name, @appointment.customer %>
<%= l(:label_vehicle, default: 'Vehicle') %>:
<%= link_to_if @appointment.vehicle, @appointment.vehicle&.name, @appointment.vehicle %>
<%= l(:label_primary_phone, default: 'Primary phone') %>:
<%= @appointment.customer&.primary_phone %>
<%= l(:label_estimate, default: 'Estimate') %>:
<%= link_to_if @appointment.estimate, @appointment.estimate&.name, @appointment.estimate %>
<%= l(:field_status) %>:
<%= @appointment.status.to_s.humanize %>
<%= l(:label_time, default: 'Time') %>:
<%= @appointment.date ? @appointment.date.strftime('%I:%M %p') : '-' %>
<%= l(:field_user) %>:
<%= link_to_user(@appointment.user) %>
<%= l(:label_duration, default: 'Duration') %>:
<%= @appointment.duration %> <%= l(:label_days) %>
<%= l(:field_estimated_hours) %>:
<%= @appointment.estimated_hours %> <%= l(:label_hours) %>
<% if @appointment.description.present? %>

<%= l(:field_description) %>

<%= textilizable(@appointment, :description) %>
<% end %>
<%= call_hook :show_customer_appointment, { appointment: @appointment } %>