update occupant comment title on create
parent
584f33fb98
commit
b2077f2f9a
|
|
@ -2,7 +2,7 @@
|
|||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b, _c;
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const los = exports.los;
|
||||
const lotOccupancyId = document.querySelector('#lotOccupancy--lotOccupancyId').value;
|
||||
const isCreate = lotOccupancyId === '';
|
||||
|
|
@ -182,8 +182,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
occupancyTypeIdElement.addEventListener('change', () => {
|
||||
if (occupancyTypeIdElement.value === '') {
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`;
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetOccupancyTypeFields', {
|
||||
|
|
@ -256,7 +256,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
bulmaJS.confirm({
|
||||
title: 'Confirm Change',
|
||||
message: `Are you sure you want to change the ${los.escapedAliases.occupancy} type?\n
|
||||
This change affects the additional fields associated with this record, and may also affect the available fees.`,
|
||||
This change affects the additional fields associated with this record, and may also affect the available fees.`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Keep the Change',
|
||||
|
|
@ -418,9 +418,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
});
|
||||
});
|
||||
document
|
||||
.querySelector('.is-lot-view-button')
|
||||
.addEventListener('click', () => {
|
||||
(_d = document
|
||||
.querySelector('.is-lot-view-button')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', () => {
|
||||
const lotId = document.querySelector('#lotOccupancy--lotId').value;
|
||||
if (lotId === '') {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -432,9 +431,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
window.open(los.urlPrefix + '/lots/' + lotId);
|
||||
}
|
||||
});
|
||||
document
|
||||
.querySelector('.is-clear-lot-button')
|
||||
.addEventListener('click', () => {
|
||||
(_e = document
|
||||
.querySelector('.is-clear-lot-button')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => {
|
||||
if (lotNameElement.disabled) {
|
||||
bulmaJS.alert({
|
||||
message: 'You need to unlock the field before clearing it.',
|
||||
|
|
@ -449,9 +447,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
// Start Date
|
||||
los.initializeDatePickers(formElement);
|
||||
document
|
||||
.querySelector('#lotOccupancy--occupancyStartDateString')
|
||||
.addEventListener('change', () => {
|
||||
(_f = document
|
||||
.querySelector('#lotOccupancy--occupancyStartDateString')) === null || _f === void 0 ? void 0 : _f.addEventListener('change', () => {
|
||||
const endDatePicker = document.querySelector('#lotOccupancy--occupancyEndDateString').bulmaCalendar.datePicker;
|
||||
endDatePicker.min = document.querySelector('#lotOccupancy--occupancyStartDateString').value;
|
||||
endDatePicker.refresh();
|
||||
|
|
@ -699,10 +696,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (isCreate) {
|
||||
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
||||
lotOccupantTypeIdElement.addEventListener('change', () => {
|
||||
var _a;
|
||||
const occupantFields = formElement.querySelectorAll("[data-table='LotOccupancyOccupant']");
|
||||
for (const occupantField of occupantFields) {
|
||||
occupantField.disabled = lotOccupantTypeIdElement.value === '';
|
||||
}
|
||||
let occupantCommentTitle = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
|
||||
.occupantCommentTitle) !== null && _a !== void 0 ? _a : '';
|
||||
if (occupantCommentTitle === '') {
|
||||
occupantCommentTitle = 'Comment';
|
||||
}
|
||||
formElement.querySelector('#lotOccupancy--occupantCommentTitle').textContent = occupantCommentTitle;
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b, _c;
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const los = exports.los;
|
||||
const lotOccupancyId = document.querySelector('#lotOccupancy--lotOccupancyId').value;
|
||||
const isCreate = lotOccupancyId === '';
|
||||
|
|
@ -182,8 +182,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
occupancyTypeIdElement.addEventListener('change', () => {
|
||||
if (occupancyTypeIdElement.value === '') {
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`;
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetOccupancyTypeFields', {
|
||||
|
|
@ -256,7 +256,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
bulmaJS.confirm({
|
||||
title: 'Confirm Change',
|
||||
message: `Are you sure you want to change the ${los.escapedAliases.occupancy} type?\n
|
||||
This change affects the additional fields associated with this record, and may also affect the available fees.`,
|
||||
This change affects the additional fields associated with this record, and may also affect the available fees.`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Keep the Change',
|
||||
|
|
@ -418,9 +418,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
});
|
||||
});
|
||||
document
|
||||
.querySelector('.is-lot-view-button')
|
||||
.addEventListener('click', () => {
|
||||
(_d = document
|
||||
.querySelector('.is-lot-view-button')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', () => {
|
||||
const lotId = document.querySelector('#lotOccupancy--lotId').value;
|
||||
if (lotId === '') {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -432,9 +431,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
window.open(los.urlPrefix + '/lots/' + lotId);
|
||||
}
|
||||
});
|
||||
document
|
||||
.querySelector('.is-clear-lot-button')
|
||||
.addEventListener('click', () => {
|
||||
(_e = document
|
||||
.querySelector('.is-clear-lot-button')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => {
|
||||
if (lotNameElement.disabled) {
|
||||
bulmaJS.alert({
|
||||
message: 'You need to unlock the field before clearing it.',
|
||||
|
|
@ -449,9 +447,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
// Start Date
|
||||
los.initializeDatePickers(formElement);
|
||||
document
|
||||
.querySelector('#lotOccupancy--occupancyStartDateString')
|
||||
.addEventListener('change', () => {
|
||||
(_f = document
|
||||
.querySelector('#lotOccupancy--occupancyStartDateString')) === null || _f === void 0 ? void 0 : _f.addEventListener('change', () => {
|
||||
const endDatePicker = document.querySelector('#lotOccupancy--occupancyEndDateString').bulmaCalendar.datePicker;
|
||||
endDatePicker.min = document.querySelector('#lotOccupancy--occupancyStartDateString').value;
|
||||
endDatePicker.refresh();
|
||||
|
|
|
|||
|
|
@ -276,8 +276,8 @@ declare const bulmaJS: BulmaJS
|
|||
occupancyTypeIdElement.addEventListener('change', () => {
|
||||
if (occupancyTypeIdElement.value === '') {
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -392,7 +392,7 @@ declare const bulmaJS: BulmaJS
|
|||
bulmaJS.confirm({
|
||||
title: 'Confirm Change',
|
||||
message: `Are you sure you want to change the ${los.escapedAliases.occupancy} type?\n
|
||||
This change affects the additional fields associated with this record, and may also affect the available fees.`,
|
||||
This change affects the additional fields associated with this record, and may also affect the available fees.`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Keep the Change',
|
||||
|
|
@ -645,8 +645,8 @@ declare const bulmaJS: BulmaJS
|
|||
})
|
||||
|
||||
document
|
||||
.querySelector('.is-lot-view-button')!
|
||||
.addEventListener('click', () => {
|
||||
.querySelector('.is-lot-view-button')
|
||||
?.addEventListener('click', () => {
|
||||
const lotId = (
|
||||
document.querySelector('#lotOccupancy--lotId') as HTMLInputElement
|
||||
).value
|
||||
|
|
@ -662,8 +662,8 @@ declare const bulmaJS: BulmaJS
|
|||
})
|
||||
|
||||
document
|
||||
.querySelector('.is-clear-lot-button')!
|
||||
.addEventListener('click', () => {
|
||||
.querySelector('.is-clear-lot-button')
|
||||
?.addEventListener('click', () => {
|
||||
if (lotNameElement.disabled) {
|
||||
bulmaJS.alert({
|
||||
message: 'You need to unlock the field before clearing it.',
|
||||
|
|
@ -683,8 +683,8 @@ declare const bulmaJS: BulmaJS
|
|||
los.initializeDatePickers(formElement)
|
||||
|
||||
document
|
||||
.querySelector('#lotOccupancy--occupancyStartDateString')!
|
||||
.addEventListener('change', () => {
|
||||
.querySelector('#lotOccupancy--occupancyStartDateString')
|
||||
?.addEventListener('change', () => {
|
||||
const endDatePicker = (
|
||||
document.querySelector(
|
||||
'#lotOccupancy--occupancyEndDateString'
|
||||
|
|
|
|||
|
|
@ -237,10 +237,17 @@ function renderLotOccupancyOccupants() {
|
|||
if (isCreate) {
|
||||
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
||||
lotOccupantTypeIdElement.addEventListener('change', () => {
|
||||
var _a;
|
||||
const occupantFields = formElement.querySelectorAll("[data-table='LotOccupancyOccupant']");
|
||||
for (const occupantField of occupantFields) {
|
||||
occupantField.disabled = lotOccupantTypeIdElement.value === '';
|
||||
}
|
||||
let occupantCommentTitle = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
|
||||
.occupantCommentTitle) !== null && _a !== void 0 ? _a : '';
|
||||
if (occupantCommentTitle === '') {
|
||||
occupantCommentTitle = 'Comment';
|
||||
}
|
||||
formElement.querySelector('#lotOccupancy--occupantCommentTitle').textContent = occupantCommentTitle;
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -392,6 +392,17 @@ if (isCreate) {
|
|||
for (const occupantField of occupantFields) {
|
||||
occupantField.disabled = lotOccupantTypeIdElement.value === ''
|
||||
}
|
||||
|
||||
let occupantCommentTitle =
|
||||
lotOccupantTypeIdElement.selectedOptions[0].dataset
|
||||
.occupantCommentTitle ?? ''
|
||||
if (occupantCommentTitle === '') {
|
||||
occupantCommentTitle = 'Comment'
|
||||
}
|
||||
|
||||
formElement.querySelector(
|
||||
'#lotOccupancy--occupantCommentTitle'
|
||||
)!.textContent = occupantCommentTitle
|
||||
})
|
||||
} else {
|
||||
renderLotOccupancyOccupants()
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -23,11 +23,11 @@
|
|||
<% } %>
|
||||
<li class="is-active">
|
||||
<a href="#" aria-current="page">
|
||||
<% if (isCreate) { %>
|
||||
Create a New <%= configFunctions.getProperty("aliases.occupancy") %> Record
|
||||
<% } else { %>
|
||||
Update <%= configFunctions.getProperty("aliases.occupancy") %>
|
||||
<% } %>
|
||||
<% if (isCreate) { %>
|
||||
Create a New <%= configFunctions.getProperty("aliases.occupancy") %> Record
|
||||
<% } else { %>
|
||||
Update <%= configFunctions.getProperty("aliases.occupancy") %>
|
||||
<% } %>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -136,176 +136,176 @@
|
|||
|
||||
<div class="panel">
|
||||
<div class="panel-block is-block">
|
||||
<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
|
||||
<% if (!isCreate) { %>
|
||||
class="is-readonly"
|
||||
<% } %>
|
||||
id="lotOccupancy--occupancyTypeId" name="occupancyTypeId"
|
||||
required accesskey="f"
|
||||
<%= (isCreate ? " autofocus" : "") %>>
|
||||
<% 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 is-hidden-print">
|
||||
<button class="button is-unlock-field-button" data-tooltip="Unlock Field" type="button" aria-label="Unlock <%= configFunctions.getProperty("aliases.occupancy") %> Type Field">
|
||||
<i class="fas fa-unlock" aria-hidden="true"></i>
|
||||
</button>
|
||||
<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
|
||||
<% if (!isCreate) { %>
|
||||
class="is-readonly"
|
||||
<% } %>
|
||||
id="lotOccupancy--occupancyTypeId" name="occupancyTypeId"
|
||||
required accesskey="f"
|
||||
<%= (isCreate ? " autofocus" : "") %>>
|
||||
<% 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 is-hidden-print">
|
||||
<button class="button is-unlock-field-button" data-tooltip="Unlock Field" type="button" aria-label="Unlock <%= configFunctions.getProperty("aliases.occupancy") %> Type Field">
|
||||
<i class="fas fa-unlock" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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 is-clickable has-text-left <%= (isCreate ? "" : " is-readonly") %>" id="lotOccupancy--lotName" type="button" value="<%= lotOccupancy.lotName || "(No " + configFunctions.getProperty("aliases.lot") + ")" %>"
|
||||
<%= (configFunctions.getProperty("settings.lotOccupancy.lotIdIsRequired") ? " required" : "") %>
|
||||
<%= (isCreate ? "" : " disabled readonly") %> />
|
||||
</div>
|
||||
<div class="control is-hidden-print">
|
||||
<button class="button is-clear-lot-button" data-tooltip="Clear" type="button" aria-label="Clear <%= configFunctions.getProperty("aliases.lot") %></button> Field">
|
||||
<i class="fas fa-eraser" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="control is-hidden-print">
|
||||
<button class="button is-unlock-field-button" data-tooltip="Unlock Field" type="button" aria-label="Unlock <%= configFunctions.getProperty("aliases.lot") %></button> Field">
|
||||
<i class="fas fa-unlock" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="control is-hidden-print">
|
||||
<button class="button is-lot-view-button" data-tooltip="Open <%= configFunctions.getProperty("aliases.lot") %>" type="button" aria-label="Open <%= configFunctions.getProperty("aliases.lot") %>">
|
||||
<i class="fas fa-external-link-alt" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
<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 is-clickable has-text-left <%= (isCreate ? "" : " is-readonly") %>" id="lotOccupancy--lotName" type="button" value="<%= lotOccupancy.lotName || "(No " + configFunctions.getProperty("aliases.lot") + ")" %>"
|
||||
<%= (configFunctions.getProperty("settings.lotOccupancy.lotIdIsRequired") ? " required" : "") %>
|
||||
<%= (isCreate ? "" : " disabled readonly") %> />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-3">
|
||||
<div class="field">
|
||||
<label class="label" for="lotOccupancy--occupancyStartDateString"><%= configFunctions.getProperty("aliases.occupancyStartDate") %></label>
|
||||
<div class="control has-icons-left">
|
||||
<input class="input" id="lotOccupancy--occupancyStartDateString" name="occupancyStartDateString" type="date"
|
||||
value="<%= lotOccupancy.occupancyStartDateString %>" required />
|
||||
<span class="icon is-left">
|
||||
<i class="fas fa-calendar" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="control is-hidden-print">
|
||||
<button class="button is-clear-lot-button" data-tooltip="Clear" type="button" aria-label="Clear <%= configFunctions.getProperty("aliases.lot") %></button> Field">
|
||||
<i class="fas fa-eraser" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="lotOccupancy--occupancyEndDateString">End Date</label>
|
||||
<div class="control has-icons-left">
|
||||
<input class="input" id="lotOccupancy--occupancyEndDateString" name="occupancyEndDateString" type="date"
|
||||
value="<%= lotOccupancy.occupancyEndDateString %>"
|
||||
min="<%= lotOccupancy.occupancyStartDateString %>"
|
||||
<%= (configFunctions.getProperty("settings.lotOccupancy.occupancyEndDateIsRequired") ? " required" : "") %> />
|
||||
<span class="icon is-left">
|
||||
<i class="fas fa-calendar" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="control is-hidden-print">
|
||||
<button class="button is-unlock-field-button" data-tooltip="Unlock Field" type="button" aria-label="Unlock <%= configFunctions.getProperty("aliases.lot") %></button> Field">
|
||||
<i class="fas fa-unlock" aria-hidden="true"></i>
|
||||
</button>
|
||||
</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 load 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">
|
||||
<% if (!lotOccupancyField.occupancyTypeFieldValues || lotOccupancyField.occupancyTypeFieldValues === "") { %>
|
||||
<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 %>"
|
||||
<%= lotOccupancyField.isRequired ? " required" : "" %> />
|
||||
<% } else { %>
|
||||
<%
|
||||
const fieldValues = lotOccupancyField.occupancyTypeFieldValues.split("\n");
|
||||
let valueFound = false;
|
||||
%>
|
||||
<div class="select is-fullwidth">
|
||||
<select id="lotOccupancy--lotOccupancyFieldValue_<%= lotOccupancyField.occupancyTypeFieldId %>"
|
||||
name="lotOccupancyFieldValue_<%= lotOccupancyField.occupancyTypeFieldId %>">
|
||||
<% if (!lotOccupancyField.isRequired || lotOccupancyField.lotOccupancyFieldValue === "") { %>
|
||||
<option value="">(Not Set)</option>
|
||||
<% } %>
|
||||
<% for (const fieldValue of fieldValues) { %>
|
||||
<%
|
||||
if (fieldValue === lotOccupancyField.lotOccupancyFieldValue) {
|
||||
valueFound = true;
|
||||
}
|
||||
%>
|
||||
<option value="<%= fieldValue %>"
|
||||
<%= (fieldValue === lotOccupancyField.lotOccupancyFieldValue ? " selected" : "") %>>
|
||||
<%= fieldValue %>
|
||||
</option>
|
||||
<% } %>
|
||||
<% if (!valueFound && lotOccupancyField.lotOccupancyFieldValue !== "") { %>
|
||||
<option value="<%= lotOccupancyField.lotOccupancyFieldValue %>" selected>
|
||||
<%= lotOccupancyField.lotOccupancyFieldValue %>
|
||||
</option>
|
||||
<% } %>
|
||||
</select>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<input id="lotOccupancy--occupancyTypeFieldIds" name="occupancyTypeFieldIds" type="hidden" value="<%= occupancyTypeFieldIds.slice(1) %>" />
|
||||
<% } %>
|
||||
<div class="control is-hidden-print">
|
||||
<button class="button is-lot-view-button" data-tooltip="Open <%= configFunctions.getProperty("aliases.lot") %>" type="button" aria-label="Open <%= configFunctions.getProperty("aliases.lot") %>">
|
||||
<i class="fas fa-external-link-alt" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-3">
|
||||
<div class="field">
|
||||
<label class="label" for="lotOccupancy--occupancyStartDateString"><%= configFunctions.getProperty("aliases.occupancyStartDate") %></label>
|
||||
<div class="control has-icons-left">
|
||||
<input class="input" id="lotOccupancy--occupancyStartDateString" name="occupancyStartDateString" type="date"
|
||||
value="<%= lotOccupancy.occupancyStartDateString %>" required />
|
||||
<span class="icon is-left">
|
||||
<i class="fas fa-calendar" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="lotOccupancy--occupancyEndDateString">End Date</label>
|
||||
<div class="control has-icons-left">
|
||||
<input class="input" id="lotOccupancy--occupancyEndDateString" name="occupancyEndDateString" type="date"
|
||||
value="<%= lotOccupancy.occupancyEndDateString %>"
|
||||
min="<%= lotOccupancy.occupancyStartDateString %>"
|
||||
<%= (configFunctions.getProperty("settings.lotOccupancy.occupancyEndDateIsRequired") ? " required" : "") %> />
|
||||
<span class="icon is-left">
|
||||
<i class="fas fa-calendar" aria-hidden="true"></i>
|
||||
</span>
|
||||
</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 load 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">
|
||||
<% if (!lotOccupancyField.occupancyTypeFieldValues || lotOccupancyField.occupancyTypeFieldValues === "") { %>
|
||||
<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 %>"
|
||||
<%= lotOccupancyField.isRequired ? " required" : "" %> />
|
||||
<% } else { %>
|
||||
<%
|
||||
const fieldValues = lotOccupancyField.occupancyTypeFieldValues.split("\n");
|
||||
let valueFound = false;
|
||||
%>
|
||||
<div class="select is-fullwidth">
|
||||
<select id="lotOccupancy--lotOccupancyFieldValue_<%= lotOccupancyField.occupancyTypeFieldId %>"
|
||||
name="lotOccupancyFieldValue_<%= lotOccupancyField.occupancyTypeFieldId %>">
|
||||
<% if (!lotOccupancyField.isRequired || lotOccupancyField.lotOccupancyFieldValue === "") { %>
|
||||
<option value="">(Not Set)</option>
|
||||
<% } %>
|
||||
<% for (const fieldValue of fieldValues) { %>
|
||||
<%
|
||||
if (fieldValue === lotOccupancyField.lotOccupancyFieldValue) {
|
||||
valueFound = true;
|
||||
}
|
||||
%>
|
||||
<option value="<%= fieldValue %>"
|
||||
<%= (fieldValue === lotOccupancyField.lotOccupancyFieldValue ? " selected" : "") %>>
|
||||
<%= fieldValue %>
|
||||
</option>
|
||||
<% } %>
|
||||
<% if (!valueFound && lotOccupancyField.lotOccupancyFieldValue !== "") { %>
|
||||
<option value="<%= lotOccupancyField.lotOccupancyFieldValue %>" selected>
|
||||
<%= lotOccupancyField.lotOccupancyFieldValue %>
|
||||
</option>
|
||||
<% } %>
|
||||
</select>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<input id="lotOccupancy--occupancyTypeFieldIds" name="occupancyTypeFieldIds" type="hidden" value="<%= occupancyTypeFieldIds.slice(1) %>" />
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if (isCreate) { %>
|
||||
<div class="panel-block is-block">
|
||||
|
|
@ -317,14 +317,19 @@
|
|||
<%= configFunctions.getProperty("aliases.occupant") %> Type
|
||||
</label>
|
||||
<div class="control">
|
||||
<div class="select is-fullwidth">
|
||||
<select id="lotOccupancy--lotOccupantTypeId" name="lotOccupantTypeId">
|
||||
<option value="">(Select a Type to Create a <%= configFunctions.getProperty("aliases.occupant") %>)</option>
|
||||
<% for (const lotOccupantType of lotOccupantTypes) { %>
|
||||
<option value="<%= lotOccupantType.lotOccupantTypeId %>"><%= lotOccupantType.lotOccupantType %></option>
|
||||
<% } %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="select is-fullwidth">
|
||||
<select id="lotOccupancy--lotOccupantTypeId" name="lotOccupantTypeId">
|
||||
<option value="" data-occupant-comment-title="Comment">
|
||||
(Select a Type to Create a <%= configFunctions.getProperty("aliases.occupant") %>)
|
||||
</option>
|
||||
<% for (const lotOccupantType of lotOccupantTypes) { %>
|
||||
<option value="<%= lotOccupantType.lotOccupantTypeId %>"
|
||||
data-occupant-comment-title="<%= lotOccupantType.occupantCommentTitle %>">
|
||||
<%= lotOccupantType.lotOccupantType %>
|
||||
</option>
|
||||
<% } %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
|
|
@ -391,7 +396,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="lotOccupancy--occupantComment">Comment</label>
|
||||
<label class="label" id="lotOccupancy--occupantCommentTitle" for="lotOccupancy--occupantComment">Comment</label>
|
||||
<div class="control">
|
||||
<textarea class="textarea" id="lotOccupancy--occupantComment" data-table="LotOccupancyOccupant" name="occupantComment" disabled></textarea>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue