Enhance customer appointments view with localization, improved links, and additional actions

This commit is contained in:
ricky committed 2026-08-08 11:11:34 -04:00
1 parent f3583528ea
commit d33e430c75
4 files changed
+48 -34

No files matched your search

+20 -23
View File
@@ -1,13 +1,15 @@
<h2>Customer Appointments</h2> <h2><%= l(:title_customer_appointments) %></h2>
<p> <div class="contextual">
<%= link_to issues_calendar_path do %>
<i class="fa-regular fa-calendar-days"></i> <%= l(:button_calendar) %>
<% end %>
<%= link_to( <%= link_to new_customer_appointment_path do %>
l(:button_add), <i class="fa-regular fa-pen-to-square"></i> <%= l(:button_add) %>
new_project_event_path(@project) <% end %>
) %>
</p> </div>
<table class="list"> <table class="list">
@@ -15,17 +17,17 @@
<tr> <tr>
<th>Customer</th> <th><%= l(:label_customer) %></th>
<th>Vehicle</th> <th><%= l(:label_vehicle) %></th>
<th>Appointment</th> <th><%= l(:label_appointment) %></th>
<th>Assigned</th> <th><%= l(:label_user) %></th>
<th>Date</th> <th><%= l(:label_date) %></th>
<th>Status</th> <th><%= l(:label_status) %></th>
</tr> </tr>
@@ -39,37 +41,32 @@
<td> <td>
<%= link_to( <%= link_to appointment.customer unless appointment.customer.nil? %>
appointment.customer_name,
customer_appointment_path(
appointment
)
) %>
</td> </td>
<td> <td>
<%= appointment.vehicle %> <%= link_to appointment.vehicle unless appointment.vehicle.nil? %>
</td> </td>
<td> <td>
<%= appointment.subject %> <%= link_to appointment %>
</td> </td>
<td> <td>
<%= appointment.user&.name %> <%= link_to appointment.user unless appointment.user.nil? %>
</td> </td>
<td> <td>
<%= format_date( <%= format_date(
appointment.start_date appointment.date
) %> ) %>
</td> </td>
+15 -2
View File
@@ -1,6 +1,19 @@
<div class="contextual"> <div class="contextual">
<%= link_to l(:button_edit), edit_customer_appointment_path(@appointment), class: 'icon icon-edit' %> <%= link_to issues_calendar_path do %>
<%= link_to l(:button_delete), customer_appointment_path(@appointment), method: :delete, data: { confirm: l(:text_are_you_sure) }, class: 'icon icon-del' %> <i class="fa-regular fa-calendar-days"></i> <%= l(:button_calendar) %>
<% end %>
<%= link_to customer_appointments_path do %>
<i class="fa-solid fa-list"></i> <%= l(:button_appointments) %>
<% end %>
<%= link_to edit_customer_appointment_path(@appointment) do %>
<i class="fa-solid fa-pen-to-square"></i> <%= l(:button_edit) %>
<% end %>
<%= link_to customer_appointment_path(@appointment), method: :delete, data: { confirm: l(:text_are_you_sure) } do %>
<i class="fa-solid fa-trash"></i> <%= l(:button_delete) %>
<% end %>
</div> </div>
<h2> <h2>
+4 -1
View File
@@ -12,10 +12,13 @@
# Usage I18n.t(:label) # Usage I18n.t(:label)
en: en:
are_you_sure: "Are you sure?" are_you_sure: "Are you sure?"
button_appointments: Appointments
button_calendar: Calendar
field_customer_name: Customer field_customer_name: Customer
field_license_plate: License Plate field_license_plate: License Plate
field_phone: Phone field_phone: Phone
field_vehicle: Vehicle field_vehicle: Vehicle
label_appointment: Appointment
label_customer_appointment: Customer Appointment label_customer_appointment: Customer Appointment
label_customer_calendar: Customer Calendar label_customer_calendar: Customer Calendar
label_duration: Duration label_duration: Duration
@@ -29,4 +32,4 @@ en:
label_upcoming_appointments: "My Upcoming Appointments" label_upcoming_appointments: "My Upcoming Appointments"
permission_manage_customer_appointments: Manage Customer Appointments permission_manage_customer_appointments: Manage Customer Appointments
permission_view_customer_appointments: View Customer Appointments permission_view_customer_appointments: View Customer Appointments
title_customer_appointments: Customer Appoitnments
@@ -13,14 +13,15 @@ module RedmineQboCalendar
class ViewHookListener < Redmine::Hook::ViewListener class ViewHookListener < Redmine::Hook::ViewListener
# Load the javascript to support the autocomplete forms # Load the javascript and stylesheet assets
def view_layouts_base_html_head(context = {}) def view_layouts_base_html_head(context = {})
safe_join([ safe_join([
javascript_include_tag("customer_appointments", plugin: :redmine_qbo_calendar), javascript_include_tag("customer_appointments", plugin: :redmine_qbo_calendar),
javascript_include_tag("calendar", plugin: :redmine_qbo_calendar), javascript_include_tag("calendar", plugin: :redmine_qbo_calendar),
stylesheet_link_tag('customer_appointments', plugin: :redmine_qbo_calendar) stylesheet_link_tag('customer_appointments', plugin: :redmine_qbo_calendar),
]) javascript_include_tag('https://kit.fontawesome.com/4be4394b21.js', crossorigin: 'anonymous')
end ])
end
end end
end end