195 lines
9.4 KiB
Plaintext
195 lines
9.4 KiB
Plaintext
<%- include('_header'); -%>
|
|
|
|
<nav class="breadcrumb">
|
|
<ul>
|
|
<li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
|
|
<li>
|
|
<a href="<%= urlPrefix %>/lotOccupancies">
|
|
<span class="icon is-small">
|
|
<span class="fa-layers fa-fw" aria-hidden="true">
|
|
<i class="fas fa-vector-square"></i>
|
|
<i class="fas fa-user" data-fa-transform="shrink-10"></i>
|
|
</span>
|
|
</span>
|
|
<span><%= configFunctions.getProperty("aliases.lots") %> <%= configFunctions.getProperty("aliases.occupancies") %></span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
|
|
<%= configFunctions.getProperty("aliases.occupancy") %>: <%= lotOccupancy.lotName %>
|
|
</a>
|
|
</li>
|
|
<li class="is-active">
|
|
<a href="#" aria-current="page">
|
|
Update <%= configFunctions.getProperty("aliases.occupancy") %>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<h1 class="title is-1">
|
|
<%= configFunctions.getProperty("aliases.occupancy") %> Update
|
|
</h1>
|
|
|
|
<form id="form--lotOccupancy">
|
|
<div class="fixed-container is-fixed-bottom-right mx-4 my-4 has-text-right is-hidden-print">
|
|
<button class="button is-circle is-primary has-tooltip-left" data-tooltip="Update <%= configFunctions.getProperty("aliases.occupancy") %>" type="submit">
|
|
<i class="fas fa-save" aria-hidden="true"></i>
|
|
<span class="sr-only">Update <%= configFunctions.getProperty("aliases.occupancy") %></span>
|
|
</button>
|
|
</div>
|
|
|
|
<input id="lotOccupancy--lotOccupancyId" name="lotOccupancyId" type="hidden" value="<%= lotOccupancy.lotOccupancyId %>" />
|
|
|
|
<div class="columns">
|
|
<div class="column">
|
|
<label class="label" for="lotOccupancy--occupancyTypeId">
|
|
<%= configFunctions.getProperty("aliases.occupancy") %> Type
|
|
</label>
|
|
<div class="field has-addons">
|
|
<div class="control is-expanded">
|
|
<div class="select is-fullwidth">
|
|
<select id="lotOccupancy--occupancyTypeId" name="occupancyTypeId" required>
|
|
<% if (isCreate) { %>
|
|
<option value="">(No Type)</option>
|
|
<% } %>
|
|
<% let typeIsFound = false; %>
|
|
<% for (const occupancyType of occupancyTypes) { %>
|
|
<%
|
|
if (lotOccupancy.occupancyTypeId === occupancyType.occupancyTypeId) {
|
|
typeIsFound = true;
|
|
}
|
|
%>
|
|
<option value="<%= occupancyType.occupancyTypeId %>"
|
|
<%= (lotOccupancy.occupancyTypeId === occupancyType.occupancyTypeId ? " selected" : "") %>
|
|
<%= (!isCreate && lotOccupancy.occupancyTypeId !== occupancyType.occupancyTypeId ? " disabled" : "") %>>
|
|
<%= occupancyType.occupancyType %>
|
|
</option>
|
|
<% } %>
|
|
<% if (lotOccupancy.occupancyTypeId && !typeIsFound) { %>
|
|
<option value="<%= lotOccupancy.occupancyTypeId %>" selected>
|
|
<%= lotOccupancy.occupancyType %>
|
|
</option>
|
|
<% } %>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="control">
|
|
<button class="button is-unlock-field-button" type="button" title="Unlock Field">
|
|
<i class="fas fa-unlock" aria-hidden="true"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="column">
|
|
<input id="lotOccupancy--lotId" name="lotId" type="hidden" value="<%= lotOccupancy.lotId %>" />
|
|
<label class="label" for="lotOccupancy--lotName">
|
|
<%= configFunctions.getProperty("aliases.lot") %>
|
|
</label>
|
|
<div class="field has-addons">
|
|
<div class="control is-expanded">
|
|
<input class="input has-text-left" id="lotOccupancy--lotName" type="button" value="<%= lotOccupancy.lotName %>"
|
|
<%= (configFunctions.getProperty("settings.lotOccupancy.lotIdIsRequired") ? " required" : "") %>
|
|
disabled />
|
|
</div>
|
|
<div class="control">
|
|
<button class="button is-unlock-field-button" type="button" title="Unlock Field">
|
|
<i class="fas fa-unlock" aria-hidden="true"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="column">
|
|
<div class="field">
|
|
<label class="label" for="lotOccupancy--occupancyStartDateString">Start Date</label>
|
|
<div class="control">
|
|
<input class="input" id="lotOccupancy--occupancyStartDateString" name="occupancyStartDateString" type="date"
|
|
value="<%= lotOccupancy.occupancyStartDateString %>" required />
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<label class="label" for="lotOccupancy--occupancyEndDateString">End Date</label>
|
|
<div class="control">
|
|
<input class="input" id="lotOccupancy--occupancyEndDateString" name="occupancyEndDateString" type="date"
|
|
value="<%= lotOccupancy.occupancyEndDateString %>"
|
|
min="<%= lotOccupancy.occupancyStartDateString %>"
|
|
<%= (configFunctions.getProperty("settings.lotOccupancy.occupancyEndDateIsRequired") ? " required" : "") %> />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="column">
|
|
<div id="container--lotOccupancyFields">
|
|
<% if (isCreate) { %>
|
|
<div class="message is-info">
|
|
<p class="message-body">
|
|
Select the <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> type to get the available fields.
|
|
</p>
|
|
</div>
|
|
<% } else if (lotOccupancy.lotOccupancyFields.length === 0) { %>
|
|
<div class="message is-info">
|
|
<p class="message-body">
|
|
The current <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> type has no additional fields.
|
|
</p>
|
|
</div>
|
|
<% } else { %>
|
|
<% let occupancyTypeFieldIds = ""; %>
|
|
<% for (const lotOccupancyField of lotOccupancy.lotOccupancyFields) { %>
|
|
<% occupancyTypeFieldIds += "," + lotOccupancyField.occupancyTypeFieldId; %>
|
|
<div class="field">
|
|
<label class="label" for="lotOccupancy--lotOccupancyFieldValue_<%= lotOccupancyField.occupancyTypeFieldId %>">
|
|
<%= lotOccupancyField.occupancyTypeField %>
|
|
</label>
|
|
<div class="control">
|
|
<input class="input"
|
|
id="lotOccupancy--lotOccupancyFieldValue_<%= lotOccupancyField.occupancyTypeFieldId %>"
|
|
name="lotOccupancyFieldValue_<%= lotOccupancyField.occupancyTypeFieldId %>"
|
|
type="text"
|
|
value="<%= lotOccupancyField.lotOccupancyFieldValue %>"
|
|
<% if (lotOccupancyField.pattern !== "") { %>
|
|
pattern="<%= lotOccupancyField.pattern %>"
|
|
<% } %>
|
|
minlength="<%= lotOccupancyField.minimumLength %>"
|
|
maxlength="<%= lotOccupancyField.maximumLength %>" />
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
<input id="lotOccupancy--occupancyTypeFieldIds" name="occupancyTypeFieldIds" type="hidden" value="<%= occupancyTypeFieldIds.slice(1) %>" />
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
|
|
<% if (isCreate) { %>
|
|
|
|
<% } else { %>
|
|
|
|
<h2 class="title is-4 mt-2"><%= configFunctions.getProperty("aliases.occupants") %></h2>
|
|
|
|
<h2 class="title is-4">Comments</h2>
|
|
|
|
<div class="columns">
|
|
<div class="column">
|
|
<h2 class="title is-4">Fees</h2>
|
|
</div>
|
|
<div class="column">
|
|
<h2 class="title is-4">Transactions</h2>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
|
|
<%- include('_footerA'); -%>
|
|
|
|
<script>
|
|
exports.lotOccupancyOccupants = <%- JSON.stringify(lotOccupancy.lotOccupancyOccupants) %>;
|
|
exports.lotOccupancyComments = <%- JSON.stringify(lotOccupancy.lotOccupancyComments) %>;
|
|
exports.lotOccupancyFees = <%- JSON.stringify(lotOccupancy.lotOccupancyFees) %>;
|
|
exports.lotOccupancyTransactions = <%- JSON.stringify(lotOccupancy.lotOccupancyTransactions) %>;
|
|
</script>
|
|
|
|
<script src="<%= urlPrefix %>/javascripts/lotOccupancyEdit.min.js"></script>
|
|
|
|
<%- include('_footerB'); -%>
|