diff --git a/views/workOrder-view.ejs b/views/workOrder-view.ejs index 855000e7..21d4010d 100644 --- a/views/workOrder-view.ejs +++ b/views/workOrder-view.ejs @@ -30,169 +30,186 @@ <% } %> -
-
-
-
-

- Work Order Type
- <%= workOrder.workOrderType %> -

-

- Description
- <% if (workOrder.workOrderDescription) { %> - <%= workOrder.workOrderDescription %> - <% } else { %> - (No Description) - <% } %> -

-
-
-

- Open Date
- <%= workOrder.workOrderOpenDateString %> -

-

- Close Date
- <% if (workOrder.workOrderCloseDate) { %> - <%= workOrder.workOrderCloseDateString %> - <% } else { %> - (No Close Date) - <% } %> -

+
+
+
+
+
+
+

+ Work Order Type
+ <%= workOrder.workOrderType %> +

+

+ Description
+ <% if (workOrder.workOrderDescription) { %> + <%= workOrder.workOrderDescription %> + <% } else { %> + (No Description) + <% } %> +

+
+
+

+ Open Date
+ <%= workOrder.workOrderOpenDateString %> +

+

+ Close Date
+ <% if (workOrder.workOrderCloseDate) { %> + <%= workOrder.workOrderCloseDateString %> + <% } else { %> + (No Close Date) + <% } %> +

+
+
-
-
-
-

Related <%= configFunctions.getProperty("aliases.lots") %>

-
- <% - const tabToSelect = (workOrder.workOrderLotOccupancies.length > 0 || workOrder.workOrderLots.length === 0 ? "lotOccupancies" : "lots"); - %> - -
-
" id="relatedTab--lotOccupancies"> - <% if (workOrder.workOrderLotOccupancies.length === 0) { %> -
-

- There are no - <%= configFunctions.getProperty("aliases.lot").toLowerCase() %> - <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> - records associated with this work order. -

+
+

Related <%= configFunctions.getProperty("aliases.lots") %>

+
+ <% + const tabToSelect = (workOrder.workOrderLotOccupancies.length > 0 || workOrder.workOrderLots.length === 0 ? "lotOccupancies" : "lots"); + %> + +
+
" id="relatedTab--lotOccupancies"> + <% if (workOrder.workOrderLotOccupancies.length === 0) { %> +
+

+ There are no + <%= configFunctions.getProperty("aliases.lot").toLowerCase() %> + <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> + records associated with this work order. +

+
+ <% } else { %> + + + + + + + + + + + + + <% for (const lotOccupancy of workOrder.workOrderLotOccupancies) { %> + <% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %> + + + + + + + + + <% } %> + +
Occupancy Type<%= configFunctions.getProperty("aliases.lot") %>Start DateEnd Date<%= configFunctions.getProperty("aliases.occupants") %>
+ <% if (isActive) { %> + "> + <% } else { %> + "> + <% } %> + + + <%= lotOccupancy.occupancyType %> + + + <% if (lotOccupancy.lotId) { %> + <%= lotOccupancy.lotName %> + <% } else { %> + (No <%= configFunctions.getProperty("aliases.lot") %>) + <% } %> + <%= lotOccupancy.occupancyStartDateString %> + <% if (lotOccupancy.occupancyEndDate) { %> + <%= lotOccupancy.occupancyEndDateString %> + <% } else { %> + (No End Date) + <% } %> + + <% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %> + (No <%= configFunctions.getProperty("aliases.occupants") %>) + <% } else { %> + <% const occupant = lotOccupancy.lotOccupancyOccupants[0]; %> + <%= occupant.occupantName %> + <%= (lotOccupancy.lotOccupancyOccupants.length > 1 ? " plus " + (lotOccupancy.lotOccupancyOccupants.length - 1) : "") %> + <% } %> +
+ <% } %>
- <% } else { %> - - - - - - - - - - - - - <% for (const lotOccupancy of workOrder.workOrderLotOccupancies) { %> - <% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %> - - - - - - - - - <% } %> - -
Occupancy Type<%= configFunctions.getProperty("aliases.lot") %>Start DateEnd Date<%= configFunctions.getProperty("aliases.occupants") %>
- <% if (isActive) { %> - "> - <% } else { %> - "> - <% } %> - - - <%= lotOccupancy.occupancyType %> - - - <% if (lotOccupancy.lotId) { %> - <%= lotOccupancy.lotName %> - <% } else { %> - (No <%= configFunctions.getProperty("aliases.lot") %>) - <% } %> - <%= lotOccupancy.occupancyStartDateString %> - <% if (lotOccupancy.occupancyEndDate) { %> - <%= lotOccupancy.occupancyEndDateString %> - <% } else { %> - (No End Date) - <% } %> - - <% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %> - (No <%= configFunctions.getProperty("aliases.occupants") %>) - <% } else { %> - <% const occupant = lotOccupancy.lotOccupancyOccupants[0]; %> - <%= occupant.occupantName %> - <%= (lotOccupancy.lotOccupancyOccupants.length > 1 ? " plus " + (lotOccupancy.lotOccupancyOccupants.length - 1) : "") %> - <% } %> -
- <% } %> -
-
" id="relatedTab--lots"> - <% if (workOrder.workOrderLots.length === 0) { %> -
-

- There are no - <%= configFunctions.getProperty("aliases.lots").toLowerCase() %> - records associated with this work order. -

+
" id="relatedTab--lots"> + <% if (workOrder.workOrderLots.length === 0) { %> +
+

+ There are no + <%= configFunctions.getProperty("aliases.lots").toLowerCase() %> + records associated with this work order. +

+
+ <% } else { %> + + + + + + + + + + + <% for (const lot of workOrder.workOrderLots) { %> + + + + + + + <% } %> + +
<%= configFunctions.getProperty("aliases.lot") %><%= configFunctions.getProperty("aliases.map") %><%= configFunctions.getProperty("aliases.lot") %> TypeStatus
+ <%= lot.lotName %> + <%= lot.mapName %><%= lot.lotType %><%= lot.lotStatus %>
+ <% } %>
- <% } else { %> - - - - - - - - - - - <% for (const lot of workOrder.workOrderLots) { %> - - - - - - - <% } %> - -
<%= configFunctions.getProperty("aliases.lot") %><%= configFunctions.getProperty("aliases.map") %><%= configFunctions.getProperty("aliases.lot") %> TypeStatus
- <%= lot.lotName %> - <%= lot.mapName %><%= lot.lotType %><%= lot.lotStatus %>
- <% } %> +
+ + <% if (workOrder.workOrderComments.length > 0) { %> +
+

Work Order Comments

+
+ <% } %>
+ <% if (workOrder.workOrderMilestones.length > 0) { %> +
+
+

Milestones

+
+
+ <% } %>
<%- include('_footerA'); -%>