diff --git a/public/javascripts/burialSite.edit.js b/public/javascripts/burialSite.edit.js
index 68c300da..107639ec 100644
--- a/public/javascripts/burialSite.edit.js
+++ b/public/javascripts/burialSite.edit.js
@@ -367,4 +367,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
?.addEventListener('click', openAddCommentModal);
renderBurialSiteComments();
}
+ /*
+ * Contracts
+ */
+ document
+ .querySelector('#burialSite--contractsToggle')
+ ?.addEventListener('click', () => {
+ const tableRowElements = document.querySelectorAll('#burialSite--contractsTbody tr[data-is-active="false"]');
+ for (const tableRowElement of tableRowElements) {
+ tableRowElement.classList.toggle('is-hidden');
+ }
+ });
})();
diff --git a/public/javascripts/burialSite.edit.ts b/public/javascripts/burialSite.edit.ts
index be1855bf..2c551f41 100644
--- a/public/javascripts/burialSite.edit.ts
+++ b/public/javascripts/burialSite.edit.ts
@@ -8,7 +8,6 @@ import type {
BurialSiteComment,
BurialSiteTypeField
} from '../../types/recordTypes.js'
-
import type { Sunrise } from './types.js'
declare const cityssm: cityssmGlobal
@@ -401,9 +400,9 @@ declare const exports: Record
},
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
- success: boolean
- errorMessage?: string
burialSiteComments: BurialSiteComment[]
+ errorMessage?: string
+ success: boolean
}
if (responseJSON.success) {
@@ -508,8 +507,8 @@ declare const exports: Record
formEvent.currentTarget,
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
- success: boolean
burialSiteComments: BurialSiteComment[]
+ success: boolean
}
if (responseJSON.success) {
@@ -559,4 +558,20 @@ declare const exports: Record
?.addEventListener('click', openAddCommentModal)
renderBurialSiteComments()
}
+
+ /*
+ * Contracts
+ */
+
+ document
+ .querySelector('#burialSite--contractsToggle')
+ ?.addEventListener('click', () => {
+ const tableRowElements = document.querySelectorAll(
+ '#burialSite--contractsTbody tr[data-is-active="false"]'
+ )
+
+ for (const tableRowElement of tableRowElements) {
+ tableRowElement.classList.toggle('is-hidden')
+ }
+ })
})()
diff --git a/public/javascripts/burialSite.view.js b/public/javascripts/burialSite.view.js
index 01e40749..e4ae39b7 100644
--- a/public/javascripts/burialSite.view.js
+++ b/public/javascripts/burialSite.view.js
@@ -3,7 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
(() => {
const mapContainerElement = document.querySelector('#burialSite--cemeterySvg');
if (mapContainerElement !== null) {
- ;
exports.sunrise.highlightMap(mapContainerElement, mapContainerElement.dataset.cemeterySvgId ?? '', 'success');
}
+ document
+ .querySelector('#burialSite--contractsToggle')
+ ?.addEventListener('click', () => {
+ const tableRowElements = document.querySelectorAll('#burialSite--contractsTbody tr[data-is-active="false"]');
+ for (const tableRowElement of tableRowElements) {
+ tableRowElement.classList.toggle('is-hidden');
+ }
+ });
})();
diff --git a/public/javascripts/burialSite.view.ts b/public/javascripts/burialSite.view.ts
index 48f9b94f..8f703df3 100644
--- a/public/javascripts/burialSite.view.ts
+++ b/public/javascripts/burialSite.view.ts
@@ -1,15 +1,30 @@
import type { Sunrise } from './types.js'
-declare const exports: Record
+declare const exports: {
+ sunrise: Sunrise
+}
;(() => {
- const mapContainerElement: HTMLElement | null =
- document.querySelector('#burialSite--cemeterySvg')
+ const mapContainerElement: HTMLElement | null = document.querySelector(
+ '#burialSite--cemeterySvg'
+ )
if (mapContainerElement !== null) {
- ;(exports.sunrise as Sunrise).highlightMap(
+ exports.sunrise.highlightMap(
mapContainerElement,
mapContainerElement.dataset.cemeterySvgId ?? '',
'success'
)
}
+
+ document
+ .querySelector('#burialSite--contractsToggle')
+ ?.addEventListener('click', () => {
+ const tableRowElements = document.querySelectorAll(
+ '#burialSite--contractsTbody tr[data-is-active="false"]'
+ )
+
+ for (const tableRowElement of tableRowElements) {
+ tableRowElement.classList.toggle('is-hidden')
+ }
+ })
})()
diff --git a/views/burialSite-edit.ejs b/views/burialSite-edit.ejs
index 6cd4bb50..85268b70 100644
--- a/views/burialSite-edit.ejs
+++ b/views/burialSite-edit.ejs
@@ -416,8 +416,10 @@
Contracts
- <%= burialSite.contracts.length %>
-
+
+
+
+ <%= burialSite.contracts.length %>
@@ -427,6 +429,15 @@
Create New Contract
+ <% if (burialSite.contracts.length > 0) { %>
+
+
+
+ <% } %>
@@ -438,7 +449,7 @@
<% } else { %>
-