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