mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-03 20:40:43 -04:00
Added quick status action buttons
This commit is contained in:
1 parent
94e5b95257
commit
802db23048
2 files changed
+123
-36
No files matched your search
@@ -21,6 +21,21 @@
|
|||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
<%# Quick Status Action Buttons %>
|
||||||
|
<%
|
||||||
|
statuses = %w[scheduled checked_in in_progress ready completed cancelled]
|
||||||
|
current_status = @appointment.status.to_s.parameterize.underscore
|
||||||
|
%>
|
||||||
|
<div class="appointment-quick-actions">
|
||||||
|
<span class="quick-action-label"><%= l(:label_change_status, default: 'Change Status:') %></span>
|
||||||
|
<% 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 %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="issue details">
|
<div class="issue details">
|
||||||
<div class="attributes">
|
<div class="attributes">
|
||||||
<div class="splitcontent">
|
<div class="splitcontent">
|
||||||
@@ -46,7 +61,11 @@
|
|||||||
<div class="splitcontentright">
|
<div class="splitcontentright">
|
||||||
<div class="attribute">
|
<div class="attribute">
|
||||||
<div class="label"><%= l(:field_status) %>:</div>
|
<div class="label"><%= l(:field_status) %>:</div>
|
||||||
<div class="value"><%= @appointment.status %></div>
|
<div class="value">
|
||||||
|
<span class="status-badge status-<%= @appointment.status.to_s.parameterize %>">
|
||||||
|
<%= @appointment.status.to_s.humanize %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="attribute">
|
<div class="attribute">
|
||||||
<div class="label"><%= l(:field_user) %>:</div>
|
<div class="label"><%= l(:field_user) %>:</div>
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ table.cal td {
|
|||||||
background: #edf4ff;
|
background: #edf4ff;
|
||||||
border: 1px solid #c5d8f3;
|
border: 1px solid #c5d8f3;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-size: 0.9em; /* Matches Redmine calendar default text size */
|
font-size: 0.9em;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
overflow: visible !important; /* Allows tooltip popover to extend outside */
|
overflow: visible !important;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
min-width: 0; /* Prevents long flex children from expanding parent width */
|
min-width: 0;
|
||||||
cursor: pointer; /* Cue for clickability */
|
cursor: pointer;
|
||||||
transition: transform 0.1s ease, box-shadow 0.1s ease;
|
transition: transform 0.1s ease, box-shadow 0.1s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ table.cal td {
|
|||||||
|
|
||||||
.appointment-header {
|
.appointment-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start; /* Aligns avatar and hours nicely with wrapped top lines */
|
align-items: flex-start;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
@@ -88,7 +88,7 @@ table.cal td {
|
|||||||
.appointment-hours {
|
.appointment-hours {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
color: #444;
|
color: #444;
|
||||||
font-size: 0.85em; /* Slightly smaller than main text to keep layout balanced */
|
font-size: 0.85em;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ table.cal td {
|
|||||||
/* Multi-line wrapping for details */
|
/* Multi-line wrapping for details */
|
||||||
.appointment-detail {
|
.appointment-detail {
|
||||||
color: #555;
|
color: #555;
|
||||||
font-size: 0.9em; /* Matches calendar item body text */
|
font-size: 0.9em;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
@@ -112,7 +112,7 @@ table.cal td {
|
|||||||
/* Redmine Tooltip Popover (Hidden by Default & on Hover) */
|
/* Redmine Tooltip Popover (Hidden by Default & on Hover) */
|
||||||
.appointment-block .tip,
|
.appointment-block .tip,
|
||||||
.appointment-block:hover .tip {
|
.appointment-block:hover .tip {
|
||||||
display: none !important; /* Overrides built-in hover triggers */
|
display: none !important;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -127,7 +127,7 @@ table.cal td {
|
|||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Align tooltips to the right on Friday/Saturday columns to prevent viewport overflow */
|
/* Align tooltips to the right on Friday/Saturday columns */
|
||||||
table.cal td:nth-child(n+6) .appointment-block .tip {
|
table.cal td:nth-child(n+6) .appointment-block .tip {
|
||||||
left: auto;
|
left: auto;
|
||||||
right: 0;
|
right: 0;
|
||||||
@@ -215,7 +215,7 @@ table.cal td:nth-child(n+6) .appointment-block .tip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.calendar-badge .month {
|
.calendar-badge .month {
|
||||||
background-color: #c22b2b; /* Redmine primary red tone */
|
background-color: #c22b2b;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -243,7 +243,7 @@ h2 .appointment-title {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Status Colors & Indicator Bars */
|
/* Calendar Card Status Colors & Indicator Bars */
|
||||||
|
|
||||||
/* Scheduled - Blue */
|
/* Scheduled - Blue */
|
||||||
.appointment-block.scheduled .appointment-bar { background-color: #1f77d0; }
|
.appointment-block.scheduled .appointment-bar { background-color: #1f77d0; }
|
||||||
@@ -251,15 +251,19 @@ h2 .appointment-title {
|
|||||||
|
|
||||||
/* CheckedIn - Purple */
|
/* CheckedIn - Purple */
|
||||||
.appointment-block.checked-in .appointment-bar,
|
.appointment-block.checked-in .appointment-bar,
|
||||||
.appointment-block.checkedin .appointment-bar { background-color: #8e44ad; }
|
.appointment-block.checkedin .appointment-bar,
|
||||||
|
.appointment-block.checked_in .appointment-bar { background-color: #8e44ad; }
|
||||||
.appointment-block.checked-in,
|
.appointment-block.checked-in,
|
||||||
.appointment-block.checkedin { background: #f6f0fa; border-color: #e2d0fb; }
|
.appointment-block.checkedin,
|
||||||
|
.appointment-block.checked_in { background: #f6f0fa; border-color: #e2d0fb; }
|
||||||
|
|
||||||
/* InProgress - Orange */
|
/* InProgress - Orange */
|
||||||
.appointment-block.in-progress .appointment-bar,
|
.appointment-block.in-progress .appointment-bar,
|
||||||
.appointment-block.inprogress .appointment-bar { background-color: #e68a00; }
|
.appointment-block.inprogress .appointment-bar,
|
||||||
|
.appointment-block.in_progress .appointment-bar { background-color: #e68a00; }
|
||||||
.appointment-block.in-progress,
|
.appointment-block.in-progress,
|
||||||
.appointment-block.inprogress { background: #fff4df; border-color: #fce2b6; }
|
.appointment-block.inprogress,
|
||||||
|
.appointment-block.in_progress { background: #fff4df; border-color: #fce2b6; }
|
||||||
|
|
||||||
/* Ready - Teal */
|
/* Ready - Teal */
|
||||||
.appointment-block.ready .appointment-bar { background-color: #16a085; }
|
.appointment-block.ready .appointment-bar { background-color: #16a085; }
|
||||||
@@ -273,38 +277,102 @@ h2 .appointment-title {
|
|||||||
.appointment-block.cancelled .appointment-bar { background-color: #d9534f; }
|
.appointment-block.cancelled .appointment-bar { background-color: #d9534f; }
|
||||||
.appointment-block.cancelled { background: #fdf2f2; border-color: #f8c8c8; }
|
.appointment-block.cancelled { background: #fdf2f2; border-color: #f8c8c8; }
|
||||||
|
|
||||||
/* Enforce Vertical Centering on Table Cells */
|
/* Table List Alignment */
|
||||||
table.appointments td,
|
table.appointments td,
|
||||||
table.appointments th {
|
table.appointments th {
|
||||||
vertical-align: middle !important;
|
vertical-align: middle !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.appointments th.status,
|
table.appointments th.status,
|
||||||
table.appointments td.status {
|
table.appointments td.status {
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Status Badge Base Styles with Flex Alignment */
|
/* Quick Status Bar Container */
|
||||||
.status-badge {
|
.appointment-quick-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
margin: 12px 0 16px 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-action-label {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #555;
|
||||||
|
font-size: 0.85em;
|
||||||
|
margin-right: 4px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Shared Badge & Quick-Status Button Base Styling */
|
||||||
|
.status-badge,
|
||||||
|
.quick-status-btn {
|
||||||
display: inline-flex !important;
|
display: inline-flex !important;
|
||||||
align-items: center !important;
|
align-items: center !important;
|
||||||
justify-content: center !important;
|
justify-content: center !important;
|
||||||
padding: 3px 10px;
|
padding: 3px 10px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1 !important;
|
line-height: 1.2 !important;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
|
text-decoration: none !important;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
transition: opacity 0.15s ease, transform 0.1s ease;
|
||||||
|
}
|
||||||
|
|
||||||
/* Status Badge Colors */
|
.quick-status-btn:hover {
|
||||||
.status-badge.status-scheduled { background-color: #edf4ff; color: #1f77d0; border-color: #c5d8f3; }
|
opacity: 0.85;
|
||||||
.status-badge.status-checked-in,
|
transform: translateY(-1px);
|
||||||
.status-badge.status-checkedin { background-color: #f6f0fa; color: #8e44ad; border-color: #e2d0fb; }
|
}
|
||||||
.status-badge.status-in-progress,
|
|
||||||
.status-badge.status-inprogress { background-color: #fff4df; color: #e68a00; border-color: #fce2b6; }
|
/* Status Colors (Supports hyphen, underscore, and concatenated naming) */
|
||||||
.status-badge.status-ready { background-color: #e8f8f5; color: #16a085; border-color: #a3e4d7; }
|
|
||||||
.status-badge.status-completed { background-color: #edf9ee; color: #2d8a34; border-color: #c7eecb; }
|
/* Scheduled - Blue */
|
||||||
.status-badge.status-cancelled { background-color: #fdf2f2; color: #d9534f; border-color: #f8c8c8; }
|
.status-scheduled {
|
||||||
|
background-color: #edf4ff !important;
|
||||||
|
border-color: #c5d8f3 !important;
|
||||||
|
color: #1f77d0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* CheckedIn - Purple */
|
||||||
|
.status-checked-in,
|
||||||
|
.status-checkedin,
|
||||||
|
.status-checked_in {
|
||||||
|
background-color: #f6f0fa !important;
|
||||||
|
border-color: #e2d0fb !important;
|
||||||
|
color: #8e44ad !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* InProgress - Orange */
|
||||||
|
.status-in-progress,
|
||||||
|
.status-inprogress,
|
||||||
|
.status-in_progress {
|
||||||
|
background-color: #fff4df !important;
|
||||||
|
border-color: #fce2b6 !important;
|
||||||
|
color: #e68a00 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ready - Teal */
|
||||||
|
.status-ready {
|
||||||
|
background-color: #e8f8f5 !important;
|
||||||
|
border-color: #a3e4d7 !important;
|
||||||
|
color: #16a085 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Completed - Green */
|
||||||
|
.status-completed {
|
||||||
|
background-color: #edf9ee !important;
|
||||||
|
border-color: #c7eecb !important;
|
||||||
|
color: #2d8a34 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Cancelled - Red */
|
||||||
|
.status-cancelled {
|
||||||
|
background-color: #fdf2f2 !important;
|
||||||
|
border-color: #f8c8c8 !important;
|
||||||
|
color: #d9534f !important;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user