Refactor appointment model and views to use a single date field; update tooltip and calendar display for improved functionality

This commit is contained in:
ricky committed 2026-08-07 21:20:46 -04:00
1 parent 88a40b356c
commit 86533981bc
8 files changed
+66 -76

No files matched your search

@@ -24,10 +24,9 @@
<%= f.collection_select :user_id, User.active.sorted, :id, :name, { include_blank: true }, { label: false } %>
</p>
<p><%= f.datetime_local_field :start_date %></p>
<p><%= f.date_field :end_date, size: 10 %></p>
<p><%= f.datetime_local_field :date %></p>
<p><%= f.number_field :estimated_hours, step: 0.1, size: 6 %></p>
<p><%= f.number_field :estimated_hours, step: 1, size: 6 %></p>
<p><%= f.number_field :duration, step: 1, size: 6, label: :label_duration %></p>
<p><%= f.select :status, CustomerAppointment::STATUSES, label: :field_status %></p>
@@ -57,7 +57,7 @@
<tr>
<th><%= l(:label_end_date) %></th>
<td><%= format_date(appointment.end_date || appointment.start_date) %></td>
<td><%= format_date(appointment.due_date ) %></td>
</tr>
<tr>
+2 -47
View File
@@ -15,57 +15,12 @@
<span class="appointment-dates">
(<%= format_date(@appointment.start_date) %>
<% if @appointment.end_date && @appointment.start_date != @appointment.end_date %>
- <%= format_date(@appointment.end_date) %>
<% if @appointment.duration > 1 %>
- <%= format_date(@appointment.due_date) %>
<% end %>)
</span>
</h2>
<style>
.calendar-badge {
display: inline-block;
width: 38px;
border: 1px solid #b8c0c8;
border-radius: 4px;
overflow: hidden;
text-align: center;
vertical-align: middle;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
margin-right: 8px;
line-height: 1;
background: #fff;
}
.calendar-badge .month {
background-color: #c22b2b; /* Redmine primary red tone */
color: #ffffff;
font-size: 9px;
font-weight: bold;
padding: 3px 0 2px 0;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.calendar-badge .day {
color: #333333;
font-size: 16px;
font-weight: bold;
padding: 4px 0 3px 0;
}
.appointment-title {
vertical-align: middle;
}
.appointment-dates {
font-size: 70%;
color: #666;
margin-left: 8px;
font-weight: normal;
vertical-align: middle;
}
</style>
<div class="issue details">
<div class="attributes">
<div class="splitcontent">