linting
parent
e0761624bc
commit
4ab29dd5df
|
|
@ -1,16 +1,20 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type {
|
||||
RequestHandler
|
||||
} from "express";
|
||||
|
||||
import { addMap } from "../../helpers/lotOccupancyDB/addMap.js";
|
||||
import {
|
||||
addMap
|
||||
} from "../../helpers/lotOccupancyDB/addMap.js";
|
||||
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
|
||||
const mapId = addMap(request.body, request.session);
|
||||
const mapId = addMap(request.body, request.session);
|
||||
|
||||
response.json({
|
||||
success: true,
|
||||
mapId
|
||||
});
|
||||
response.json({
|
||||
success: true,
|
||||
mapId
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,20 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type {
|
||||
RequestHandler
|
||||
} from "express";
|
||||
|
||||
import { updateMap } from "../../helpers/lotOccupancyDB/updateMap.js";
|
||||
import {
|
||||
updateMap
|
||||
} from "../../helpers/lotOccupancyDB/updateMap.js";
|
||||
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
|
||||
const success = updateMap(request.body, request.session);
|
||||
const success = updateMap(request.body, request.session);
|
||||
|
||||
response.json({
|
||||
success,
|
||||
mapId: request.body.mapId
|
||||
});
|
||||
response.json({
|
||||
success,
|
||||
mapId: request.body.mapId
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -288,35 +288,35 @@
|
|||
<% for (const lotOccupancy of lot.lotOccupancies) { %>
|
||||
<% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %>
|
||||
<tr>
|
||||
<td class="has-text-centered">
|
||||
<% if (isActive) { %>
|
||||
<i class="fas fa-play" title="Current <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
|
||||
<% } else { %>
|
||||
<i class="fas fa-stop" title="Previous <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
|
||||
<% } %>
|
||||
</td>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
|
||||
<%= lotOccupancy.occupancyType %>
|
||||
</a>
|
||||
</td>
|
||||
<td><%= lotOccupancy.occupancyStartDateString %></td>
|
||||
<td>
|
||||
<% if (lotOccupancy.occupancyEndDate) { %>
|
||||
<%= lotOccupancy.occupancyEndDateString %>
|
||||
<% } else { %>
|
||||
(No End Date)
|
||||
<% } %>
|
||||
</td>
|
||||
<td>
|
||||
<% 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) : "") %>
|
||||
<% } %>
|
||||
</td>
|
||||
<td class="has-text-centered">
|
||||
<% if (isActive) { %>
|
||||
<i class="fas fa-play" title="Current <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
|
||||
<% } else { %>
|
||||
<i class="fas fa-stop" title="Previous <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
|
||||
<% } %>
|
||||
</td>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
|
||||
<%= lotOccupancy.occupancyType %>
|
||||
</a>
|
||||
</td>
|
||||
<td><%= lotOccupancy.occupancyStartDateString %></td>
|
||||
<td>
|
||||
<% if (lotOccupancy.occupancyEndDate) { %>
|
||||
<%= lotOccupancy.occupancyEndDateString %>
|
||||
<% } else { %>
|
||||
<span class="has-text-grey">(No End Date)</span>
|
||||
<% } %>
|
||||
</td>
|
||||
<td>
|
||||
<% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %>
|
||||
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.occupants") %>)</span>
|
||||
<% } else { %>
|
||||
<% const occupant = lotOccupancy.lotOccupancyOccupants[0]; %>
|
||||
<%= occupant.occupantName %>
|
||||
<%= (lotOccupancy.lotOccupancyOccupants.length > 1 ? " plus " + (lotOccupancy.lotOccupancyOccupants.length - 1) : "") %>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -86,7 +86,11 @@
|
|||
</p>
|
||||
<p>
|
||||
<strong>End Date</strong><br />
|
||||
<span class="has-text-grey"><%= (lotOccupancy.occupancyEndDateString === "" ? "(No End Date)" : lotOccupancy.occupancyEndDateString) %></span>
|
||||
<% if (lotOccupancy.occupancyEndDateString === "") { %>
|
||||
<span class="has-text-grey">(No End Date)</span>
|
||||
<% } else { %>
|
||||
<%= lotOccupancy.occupancyEndDateString %>
|
||||
<% } %>
|
||||
</p>
|
||||
</div>
|
||||
<% if (lotOccupancy.lotOccupancyFields.length > 0) { %>
|
||||
|
|
|
|||
Loading…
Reference in New Issue