more initial setup

- compile scss in gulp script
- include login page images
- fix database init script
deepsource-autofix-76c6eb20
Dan Gowans 2022-07-13 16:30:16 -04:00
parent a5bc8e6ea6
commit 2ca6b9dfce
31 changed files with 498 additions and 137 deletions

15
.gitignore vendored
View File

@ -1,15 +1,14 @@
.nyc_output/
bin/daemon/
coverage/
data/sessions/
node_modules/
app.min.js
bin/daemon/
data/*.db
data/*.db-journal
data/*.min.js
data/config.*
helpers/*.min.js
public/images-custom/*
routes/*.min.js
*.pem
data/config.d.ts
data/config.js
data/config.ts
public/images-custom/*

2
app.js
View File

@ -19,7 +19,7 @@ import * as htmlFns from "@cityssm/expressjs-server-js/htmlFns.js";
import { version } from "./version.js";
import * as databaseInitializer from "./helpers/databaseInitializer.js";
import debug from "debug";
const debugApp = debug("general-licence-manager:app");
const debugApp = debug("lot-occupancy-system:app");
databaseInitializer.initLotOccupancyDB();
const __dirname = ".";
export const app = express();

2
app.ts
View File

@ -25,7 +25,7 @@ import { version } from "./version.js";
import * as databaseInitializer from "./helpers/databaseInitializer.js";
import debug from "debug";
const debugApp = debug("general-licence-manager:app");
const debugApp = debug("lot-occupancy-system:app");
/*

View File

@ -3,7 +3,7 @@ import http from "http";
import * as configFunctions from "../helpers/functions.config.js";
import exitHook from "exit-hook";
import debug from "debug";
const debugWWW = debug("general-licence-manager:www");
const debugWWW = debug("lot-occupancy-system:www");
let httpServer;
const onError = (error) => {
if (error.syscall !== "listen") {

View File

@ -9,7 +9,7 @@ import * as configFunctions from "../helpers/functions.config.js";
import exitHook from "exit-hook";
import debug from "debug";
const debugWWW = debug("general-licence-manager:www");
const debugWWW = debug("lot-occupancy-system:www");
let httpServer: http.Server;

3
data/config.cemetery.d.ts vendored 100644
View File

@ -0,0 +1,3 @@
import type { Config } from "../types/configTypes";
export declare const config: Config;
export default config;

View File

@ -0,0 +1,16 @@
export const config = {
application: {
applicationName: "Cemetery Management System",
backgroundURL: "/images/cemetery-background.jpg",
logoURL: "/images/cemetery-logo.svg"
},
aliases: {
lot: "Burial Site",
lots: "Burial Sites",
map: "Cemetery",
maps: "Cemeteries",
occupancy: "Order",
occupancies: "Orders"
}
};
export default config;

View File

@ -0,0 +1,19 @@
import type { Config } from "../types/configTypes";
export const config: Config = {
application: {
applicationName: "Cemetery Management System",
backgroundURL: "/images/cemetery-background.jpg",
logoURL: "/images/cemetery-logo.svg"
},
aliases: {
lot: "Burial Site",
lots: "Burial Sites",
map: "Cemetery",
maps: "Cemeteries",
occupancy: "Order",
occupancies: "Orders"
}
};
export default config;

View File

@ -1,6 +1,16 @@
import gulp from "gulp";
import changed from "gulp-changed";
import minify from "gulp-minify";
import dartSass from 'sass';
import gulpSass from 'gulp-sass';
const sass = gulpSass(dartSass);
const publicSCSSDestination = "public/stylesheets";
const publicSCSSFunction = () => {
return gulp.src("public-scss/*.scss")
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(gulp.dest(publicSCSSDestination));
};
gulp.task("public-scss", publicSCSSFunction);
const publicJavascriptsDestination = "public/javascripts";
const publicJavascriptsMinFunction = () => {
return gulp.src("public-typescript/*.js", { allowEmpty: true })
@ -12,10 +22,12 @@ const publicJavascriptsMinFunction = () => {
};
gulp.task("public-javascript-min", publicJavascriptsMinFunction);
const watchFunction = () => {
gulp.watch("public-scss/*.scss", publicSCSSFunction);
gulp.watch("public-typescript/*.js", publicJavascriptsMinFunction);
};
gulp.task("watch", watchFunction);
gulp.task("default", () => {
publicJavascriptsMinFunction();
publicSCSSFunction();
watchFunction();
});

View File

@ -4,6 +4,25 @@ import gulp from "gulp";
import changed from "gulp-changed";
import minify from "gulp-minify";
import dartSass from 'sass';
import gulpSass from 'gulp-sass';
const sass = gulpSass(dartSass);
/*
* Compile SASS
*/
const publicSCSSDestination = "public/stylesheets";
const publicSCSSFunction = () => {
return gulp.src("public-scss/*.scss")
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(gulp.dest(publicSCSSDestination));
};
gulp.task("public-scss", publicSCSSFunction);
/*
* Minify public/javascripts
*/
@ -27,6 +46,7 @@ gulp.task("public-javascript-min", publicJavascriptsMinFunction);
*/
const watchFunction = () => {
gulp.watch("public-scss/*.scss", publicSCSSFunction);
gulp.watch("public-typescript/*.js", publicJavascriptsMinFunction);
};
@ -38,5 +58,6 @@ gulp.task("watch", watchFunction);
gulp.task("default", () => {
publicJavascriptsMinFunction();
publicSCSSFunction();
watchFunction();
});

View File

@ -5,7 +5,7 @@ import * as ejs from "ejs";
import * as configFunctions from "../../helpers/functions.config.js";
import convertHTMLToPDF from "pdf-puppeteer";
// import convertHTMLToPDF from "pdf-puppeteer";
const urlPrefix = configFunctions.getProperty("reverseProxy.urlPrefix");

View File

@ -15,38 +15,14 @@ export const initLotOccupancyDB = () => {
.get();
if (!row) {
debugSQL("Creating " + databasePath);
lotOccupancyDB.prepare("create table if not exists ContactTypes (" +
"contactTypeId integer not null primary key autoincrement," +
" contactType varchar(100) not null," +
" isLotContactType bit not null default 0," +
" isOccupantContactType bit not null default 0," +
" orderNumber smallint not null default 0," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_contacttypes_ordernumber (orderNumber, contactType)").run();
lotOccupancyDB.prepare("create table if not exists Contacts (" +
"contactId integer not null primary key autoincrement," +
" contactTypeId integer not null," +
" contactName varchar(200) not null," +
" contactDescription text," +
" contactLatitude decimal(10, 8) check (contactLatitude between -90 and 90)," +
" contactLongitude decimal(11, 8) check (contactLongitude between -180 and 180)," +
" contactAddress1 varchar(50)," +
" contactAddress2 varchar(50)," +
" contactCity varchar(20)," +
" contactProvince varchar(2)," +
" contactPostalCode varchar(7)," +
" contactPhoneNumber varchar(30)," +
recordColumns + "," +
" foreign key (contactTypeId) references ContactTypes (contactTypeId)" +
")").run();
lotOccupancyDB.prepare("create table if not exists LotTypes (" +
"lotTypeId integer not null primary key autoincrement," +
" lotType varchar(100) not null," +
" orderNumber smallint not null default 0," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypes_ordernumber (orderNumber, lotType)").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypes_ordernumber" +
" on LotTypes (orderNumber, lotType)").run();
lotOccupancyDB.prepare("create table if not exists LotTypeFields (" +
"lotTypeFieldId integer not null primary key autoincrement," +
" lotTypeId integer not null," +
@ -60,7 +36,8 @@ export const initLotOccupancyDB = () => {
recordColumns + "," +
" foreign key (lotTypeId) references LotTypes (lotTypeId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypefields_ordernumber (lotTypeId, orderNumber, lotTypeField)").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypefields_ordernumber" +
" on LotTypeFields (lotTypeId, orderNumber, lotTypeField)").run();
lotOccupancyDB.prepare("create table if not exists LotTypeStatuses (" +
"lotTypeStatusId integer not null primary key autoincrement," +
" lotTypeId integer not null," +
@ -69,18 +46,34 @@ export const initLotOccupancyDB = () => {
recordColumns + "," +
" foreign key (lotTypeId) references LotTypes (lotTypeId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypestatuses_ordernumber (lotTypeId, orderNumber, lotTypeStatus)").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypestatuses_ordernumber" +
" on LotTypeStatuses (lotTypeId, orderNumber, lotTypeStatus)").run();
lotOccupancyDB.prepare("create table if not exists Maps (" +
"mapId integer not null primary key autoincrement," +
" mapName varchar(200) not null," +
" mapDescription text," +
" mapLatitude decimal(10, 8) check (mapLatitude between -90 and 90)," +
" mapLongitude decimal(11, 8) check (mapLongitude between -180 and 180)," +
" mapSVG varchar(50)," +
" mapAddress1 varchar(50)," +
" mapAddress2 varchar(50)," +
" mapCity varchar(20)," +
" mapProvince varchar(2)," +
" mapPostalCode varchar(7)," +
" mapPhoneNumber varchar(30)," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create table if not exists Lots (" +
"lotId integer not null primary key autoincrement," +
" lotTypeId integer not null," +
" lotName varchar(100)," +
" lotContactId integer," +
" mapId integer," +
" lotLatitude decimal(10, 8) check (lotLatitude between -90 and 90)," +
" lotLongitude decimal(11, 8) check (lotLongitude between -180 and 180)," +
" lotTypeStatusId integer," +
recordColumns + "," +
" foreign key (lotTypeId) references LotTypes (lotTypeId)," +
" foreign key (lotContactId) references Contacts (contactId)," +
" foreign key (mapId) references Maps (mapId)," +
" foreign key (lotTypeStatusId) references LotTypeStatuses (lotTypeStatusId)" +
")").run();
lotOccupancyDB.prepare("create table if not exists LotFields (" +
@ -101,14 +94,27 @@ export const initLotOccupancyDB = () => {
recordColumns + "," +
" foreign key (lotId) references Lots (lotId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_lotcomments_datetime (lotId, lotCommentDate, lotCommentTime)").run();
lotOccupancyDB.prepare("create index if not exists idx_lotcomments_datetime" +
" on LotComments (lotId, lotCommentDate, lotCommentTime)").run();
lotOccupancyDB.prepare("create table if not exists Occupants (" +
"occupantId integer not null primary key autoincrement," +
" occupantName varchar(200) not null," +
" occupantAddress1 varchar(50)," +
" occupantAddress2 varchar(50)," +
" occupantCity varchar(20)," +
" occupantProvince varchar(2)," +
" occupantPostalCode varchar(7)," +
" occupantPhoneNumber varchar(30)," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create table if not exists OccupancyTypes (" +
"occupancyTypeId integer not null primary key autoincrement," +
" occupancyType varchar(100) not null," +
" orderNumber smallint not null default 0," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_occupancytypes_ordernumber (orderNumber, occupancyType)").run();
lotOccupancyDB.prepare("create index if not exists idx_occupancytypes_ordernumber" +
" on OccupancyTypes (orderNumber, occupancyType)").run();
lotOccupancyDB.prepare("create table if not exists OccupancyTypeFields (" +
"occupancyTypeFieldId integer not null primary key autoincrement," +
" occupancyTypeId integer not null," +
@ -122,17 +128,18 @@ export const initLotOccupancyDB = () => {
recordColumns + "," +
" foreign key (occupancyTypeId) references OccupancyTypes (occupancyTypeId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_occupancytypefields_ordernumber (occupancyTypeId, orderNumber, occupancyTypeField)").run();
lotOccupancyDB.prepare("create index if not exists idx_occupancytypefields_ordernumber" +
" on OccupancyTypeFields (occupancyTypeId, orderNumber, occupancyTypeField)").run();
lotOccupancyDB.prepare("create table if not exists LotOccupancies (" +
"lotOccupancyId integer not null primary key autoincrement," +
" occupancyTypeId integer not null," +
" lotId integer not null," +
" occupantContactId integer," +
" occupantId integer," +
" occupancyStartDate integer not null check (occupancyStartDate > 0)," +
" occupancyEndDate integer check (occupancyEndDate > 0)," +
recordColumns + "," +
" foreign key (lotId) references Lots (lotId)," +
" foreign key (occupantContactId) references Contacts (contactId)" +
" foreign key (occupantId) references Occupants (occupantId)" +
")").run();
lotOccupancyDB.prepare("create table if not exists LotOccupancyFields (" +
"lotOccupancyId integer not null," +
@ -153,12 +160,13 @@ export const initLotOccupancyDB = () => {
" feeFunction varchar(100)," +
" isRequired bit not null default 0," +
" orderNumber smallint not null default 0," +
recordColumns +
recordColumns + "," +
" foreign key (contactTypeId) references ContactTypes (contactTypeId)," +
" foreign key (contactId) references Contacts (contactId)," +
" foreign key (lotTypeId) references LotTypes (lotTypeId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_fees_ordernumber (orderNumber, feeName)").run();
lotOccupancyDB.prepare("create index if not exists idx_fees_ordernumber" +
" on Fees (orderNumber, feeName)").run();
lotOccupancyDB.prepare("create table if not exists LotOccupancyFees (" +
"lotOccupancyId integer not null," +
" feeId integer not null," +
@ -180,14 +188,16 @@ export const initLotOccupancyDB = () => {
" primary key (lotOccupancyId, transactionIndex)," +
" foreign key (lotOccupancyId) references LotOccupancies (lotOccupancyId)" +
") without rowid").run();
lotOccupancyDB.prepare("create index if not exists idx_lotoccupancytransactions_ordernumber (lotOccupancyId, transactionDate, transactionTime)").run();
lotOccupancyDB.prepare("create index if not exists idx_lotoccupancytransactions_ordernumber" +
" on LotOccupancyTransactions (lotOccupancyId, transactionDate, transactionTime)").run();
lotOccupancyDB.prepare("create table if not exists WorkOrderTypes (" +
"workOrderTypeId integer not null primary key autoincrement," +
" workOrderType varchar(100) not null," +
" orderNumber smallint not null default 0," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_workordertypes_ordernumber (orderNumber, workOrderType)").run();
lotOccupancyDB.prepare("create index if not exists idx_workordertypes_ordernumber" +
" on WorkOrderTypes (orderNumber, workOrderType)").run();
lotOccupancyDB.prepare("create table if not exists WorkOrders (" +
"workOrderId integer not null primary key autoincrement," +
" workOrderTypeId integer not null," +
@ -215,7 +225,8 @@ export const initLotOccupancyDB = () => {
recordColumns + "," +
" foreign key (workOrderId) references WorkOrders (workOrderId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_workordercomments_datetime (workOrderId, workOrderCommentDate, workOrderCommentTime)").run();
lotOccupancyDB.prepare("create index if not exists idx_workordercomments_datetime" +
" on WorkOrderComments (workOrderId, workOrderCommentDate, workOrderCommentTime)").run();
lotOccupancyDB.close();
return true;
}

View File

@ -25,39 +25,6 @@ export const initLotOccupancyDB = (): boolean => {
debugSQL("Creating " + databasePath);
// Contacts
lotOccupancyDB.prepare("create table if not exists ContactTypes (" +
"contactTypeId integer not null primary key autoincrement," +
" contactType varchar(100) not null," +
" isLotContactType bit not null default 0," +
" isOccupantContactType bit not null default 0," +
" orderNumber smallint not null default 0," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_contacttypes_ordernumber (orderNumber, contactType)").run();
lotOccupancyDB.prepare("create table if not exists Contacts (" +
"contactId integer not null primary key autoincrement," +
" contactTypeId integer not null," +
" contactName varchar(200) not null," +
" contactDescription text," +
" contactLatitude decimal(10, 8) check (contactLatitude between -90 and 90)," +
" contactLongitude decimal(11, 8) check (contactLongitude between -180 and 180)," +
" contactAddress1 varchar(50)," +
" contactAddress2 varchar(50)," +
" contactCity varchar(20)," +
" contactProvince varchar(2)," +
" contactPostalCode varchar(7)," +
" contactPhoneNumber varchar(30)," +
recordColumns + "," +
" foreign key (contactTypeId) references ContactTypes (contactTypeId)" +
")").run();
// Lot Types
lotOccupancyDB.prepare("create table if not exists LotTypes (" +
@ -67,7 +34,8 @@ export const initLotOccupancyDB = (): boolean => {
recordColumns +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypes_ordernumber (orderNumber, lotType)").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypes_ordernumber" +
" on LotTypes (orderNumber, lotType)").run();
lotOccupancyDB.prepare("create table if not exists LotTypeFields (" +
"lotTypeFieldId integer not null primary key autoincrement," +
@ -83,7 +51,8 @@ export const initLotOccupancyDB = (): boolean => {
" foreign key (lotTypeId) references LotTypes (lotTypeId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypefields_ordernumber (lotTypeId, orderNumber, lotTypeField)").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypefields_ordernumber" +
" on LotTypeFields (lotTypeId, orderNumber, lotTypeField)").run();
lotOccupancyDB.prepare("create table if not exists LotTypeStatuses (" +
"lotTypeStatusId integer not null primary key autoincrement," +
@ -94,15 +63,36 @@ export const initLotOccupancyDB = (): boolean => {
" foreign key (lotTypeId) references LotTypes (lotTypeId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypestatuses_ordernumber (lotTypeId, orderNumber, lotTypeStatus)").run();
lotOccupancyDB.prepare("create index if not exists idx_lottypestatuses_ordernumber" +
" on LotTypeStatuses (lotTypeId, orderNumber, lotTypeStatus)").run();
// Lots
// Maps and Lots
lotOccupancyDB.prepare("create table if not exists Maps (" +
"mapId integer not null primary key autoincrement," +
" mapName varchar(200) not null," +
" mapDescription text," +
" mapLatitude decimal(10, 8) check (mapLatitude between -90 and 90)," +
" mapLongitude decimal(11, 8) check (mapLongitude between -180 and 180)," +
" mapSVG varchar(50)," +
" mapAddress1 varchar(50)," +
" mapAddress2 varchar(50)," +
" mapCity varchar(20)," +
" mapProvince varchar(2)," +
" mapPostalCode varchar(7)," +
" mapPhoneNumber varchar(30)," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create table if not exists Lots (" +
"lotId integer not null primary key autoincrement," +
" lotTypeId integer not null," +
" lotName varchar(100)," +
" lotContactId integer," +
" mapId integer," +
" lotLatitude decimal(10, 8) check (lotLatitude between -90 and 90)," +
" lotLongitude decimal(11, 8) check (lotLongitude between -180 and 180)," +
@ -111,7 +101,7 @@ export const initLotOccupancyDB = (): boolean => {
recordColumns + "," +
" foreign key (lotTypeId) references LotTypes (lotTypeId)," +
" foreign key (lotContactId) references Contacts (contactId)," +
" foreign key (mapId) references Maps (mapId)," +
" foreign key (lotTypeStatusId) references LotTypeStatuses (lotTypeStatusId)" +
")").run();
@ -135,9 +125,22 @@ export const initLotOccupancyDB = (): boolean => {
" foreign key (lotId) references Lots (lotId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_lotcomments_datetime (lotId, lotCommentDate, lotCommentTime)").run();
lotOccupancyDB.prepare("create index if not exists idx_lotcomments_datetime" +
" on LotComments (lotId, lotCommentDate, lotCommentTime)").run();
// Occupancies
lotOccupancyDB.prepare("create table if not exists Occupants (" +
"occupantId integer not null primary key autoincrement," +
" occupantName varchar(200) not null," +
" occupantAddress1 varchar(50)," +
" occupantAddress2 varchar(50)," +
" occupantCity varchar(20)," +
" occupantProvince varchar(2)," +
" occupantPostalCode varchar(7)," +
" occupantPhoneNumber varchar(30)," +
recordColumns +
")").run();
lotOccupancyDB.prepare("create table if not exists OccupancyTypes (" +
"occupancyTypeId integer not null primary key autoincrement," +
@ -146,7 +149,8 @@ export const initLotOccupancyDB = (): boolean => {
recordColumns +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_occupancytypes_ordernumber (orderNumber, occupancyType)").run();
lotOccupancyDB.prepare("create index if not exists idx_occupancytypes_ordernumber" +
" on OccupancyTypes (orderNumber, occupancyType)").run();
lotOccupancyDB.prepare("create table if not exists OccupancyTypeFields (" +
"occupancyTypeFieldId integer not null primary key autoincrement," +
@ -162,18 +166,19 @@ export const initLotOccupancyDB = (): boolean => {
" foreign key (occupancyTypeId) references OccupancyTypes (occupancyTypeId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_occupancytypefields_ordernumber (occupancyTypeId, orderNumber, occupancyTypeField)").run();
lotOccupancyDB.prepare("create index if not exists idx_occupancytypefields_ordernumber" +
" on OccupancyTypeFields (occupancyTypeId, orderNumber, occupancyTypeField)").run();
lotOccupancyDB.prepare("create table if not exists LotOccupancies (" +
"lotOccupancyId integer not null primary key autoincrement," +
" occupancyTypeId integer not null," +
" lotId integer not null," +
" occupantContactId integer," +
" occupantId integer," +
" occupancyStartDate integer not null check (occupancyStartDate > 0)," +
" occupancyEndDate integer check (occupancyEndDate > 0)," +
recordColumns + "," +
" foreign key (lotId) references Lots (lotId)," +
" foreign key (occupantContactId) references Contacts (contactId)" +
" foreign key (occupantId) references Occupants (occupantId)" +
")").run();
lotOccupancyDB.prepare("create table if not exists LotOccupancyFields (" +
@ -198,13 +203,14 @@ export const initLotOccupancyDB = (): boolean => {
" feeFunction varchar(100)," +
" isRequired bit not null default 0," +
" orderNumber smallint not null default 0," +
recordColumns +
recordColumns + "," +
" foreign key (contactTypeId) references ContactTypes (contactTypeId)," +
" foreign key (contactId) references Contacts (contactId)," +
" foreign key (lotTypeId) references LotTypes (lotTypeId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_fees_ordernumber (orderNumber, feeName)").run();
lotOccupancyDB.prepare("create index if not exists idx_fees_ordernumber" +
" on Fees (orderNumber, feeName)").run();
lotOccupancyDB.prepare("create table if not exists LotOccupancyFees (" +
"lotOccupancyId integer not null," +
@ -229,7 +235,8 @@ export const initLotOccupancyDB = (): boolean => {
" foreign key (lotOccupancyId) references LotOccupancies (lotOccupancyId)" +
") without rowid").run();
lotOccupancyDB.prepare("create index if not exists idx_lotoccupancytransactions_ordernumber (lotOccupancyId, transactionDate, transactionTime)").run();
lotOccupancyDB.prepare("create index if not exists idx_lotoccupancytransactions_ordernumber" +
" on LotOccupancyTransactions (lotOccupancyId, transactionDate, transactionTime)").run();
// Work Orders
@ -240,7 +247,8 @@ export const initLotOccupancyDB = (): boolean => {
recordColumns +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_workordertypes_ordernumber (orderNumber, workOrderType)").run();
lotOccupancyDB.prepare("create index if not exists idx_workordertypes_ordernumber" +
" on WorkOrderTypes (orderNumber, workOrderType)").run();
lotOccupancyDB.prepare("create table if not exists WorkOrders (" +
"workOrderId integer not null primary key autoincrement," +
@ -272,7 +280,8 @@ export const initLotOccupancyDB = (): boolean => {
" foreign key (workOrderId) references WorkOrders (workOrderId)" +
")").run();
lotOccupancyDB.prepare("create index if not exists idx_workordercomments_datetime (workOrderId, workOrderCommentDate, workOrderCommentTime)").run();
lotOccupancyDB.prepare("create index if not exists idx_workordercomments_datetime" +
" on WorkOrderComments (workOrderId, workOrderCommentDate, workOrderCommentTime)").run();
lotOccupancyDB.close();

View File

@ -1,7 +1,8 @@
import { config } from "../data/config.js";
const configFallbackValues = new Map();
configFallbackValues.set("application.applicationName", "Lot Occupancy System");
configFallbackValues.set("application.logoURL", "/images/stamp.png");
configFallbackValues.set("application.backgroundURL", "/images/cemetery-background.jpg");
configFallbackValues.set("application.logoURL", "/images/cemetery-logo.png");
configFallbackValues.set("application.httpPort", 7000);
configFallbackValues.set("application.useTestDatabases", false);
configFallbackValues.set("reverseProxy.disableCompression", false);

View File

@ -11,7 +11,8 @@ import type * as configTypes from "../types/configTypes";
const configFallbackValues = new Map<string, unknown>();
configFallbackValues.set("application.applicationName", "Lot Occupancy System");
configFallbackValues.set("application.logoURL", "/images/stamp.png");
configFallbackValues.set("application.backgroundURL", "/images/cemetery-background.jpg");
configFallbackValues.set("application.logoURL", "/images/cemetery-logo.png");
configFallbackValues.set("application.httpPort", 7000);
configFallbackValues.set("application.useTestDatabases", false);

205
package-lock.json generated
View File

@ -43,6 +43,7 @@
"@types/gulp": "^4.0.9",
"@types/gulp-changed": "^0.0.35",
"@types/gulp-minify": "^3.1.1",
"@types/gulp-sass": "^5.0.0",
"@types/http-errors": "^1.8.2",
"@types/mocha": "^9.1.1",
"@types/node-windows": "^0.1.2",
@ -57,7 +58,9 @@
"gulp": "^4.0.2",
"gulp-changed": "^4.0.3",
"gulp-minify": "^3.1.0",
"nodemon": "^2.0.19"
"gulp-sass": "^5.1.0",
"nodemon": "^2.0.19",
"sass": "^1.53.0"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
@ -492,6 +495,16 @@
"@types/node": "*"
}
},
"node_modules/@types/gulp-sass": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@types/gulp-sass/-/gulp-sass-5.0.0.tgz",
"integrity": "sha512-7p7nT+IKDREyJzTH13/FC/j3fobDBZTclSJFrgAJA+qzNZgzCENAx3HeiO4N7QlraLRqx44u3OR0Aq0Jw4wz8Q==",
"dev": true,
"dependencies": {
"@types/node": "*",
"@types/node-sass": "*"
}
},
"node_modules/@types/http-errors": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.2.tgz",
@ -549,6 +562,15 @@
"integrity": "sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ==",
"dev": true
},
"node_modules/@types/node-sass": {
"version": "4.11.3",
"resolved": "https://registry.npmjs.org/@types/node-sass/-/node-sass-4.11.3.tgz",
"integrity": "sha512-wXPCn3t9uu5rR4zXNSLasZHQMuRzUKBsdi4MsgT8uq4Lp1gQQo+T2G23tGj4SSgDHeNBle6vGseZtM2XV/X9bw==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/node-windows": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@types/node-windows/-/node-windows-0.1.2.tgz",
@ -4643,6 +4665,32 @@
"xtend": "~4.0.1"
}
},
"node_modules/gulp-sass": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/gulp-sass/-/gulp-sass-5.1.0.tgz",
"integrity": "sha512-7VT0uaF+VZCmkNBglfe1b34bxn/AfcssquLKVDYnCDJ3xNBaW7cUuI3p3BQmoKcoKFrs9jdzUxyb+u+NGfL4OQ==",
"dev": true,
"dependencies": {
"lodash.clonedeep": "^4.5.0",
"picocolors": "^1.0.0",
"plugin-error": "^1.0.1",
"replace-ext": "^2.0.0",
"strip-ansi": "^6.0.1",
"vinyl-sourcemaps-apply": "^0.2.1"
},
"engines": {
"node": ">=12"
}
},
"node_modules/gulp-sass/node_modules/replace-ext": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-2.0.0.tgz",
"integrity": "sha512-UszKE5KVK6JvyD92nzMn9cDapSk6w/CaFZ96CnmDMUqH9oowfxF/ZjRITD25H4DnOQClLA4/j7jLGXXLVKxAug==",
"dev": true,
"engines": {
"node": ">= 10"
}
},
"node_modules/gulplog": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz",
@ -4862,6 +4910,12 @@
"integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==",
"dev": true
},
"node_modules/immutable": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz",
"integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==",
"dev": true
},
"node_modules/import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@ -5677,6 +5731,12 @@
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"node_modules/lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==",
"dev": true
},
"node_modules/lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
@ -6766,6 +6826,12 @@
"node": ">=8"
}
},
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
@ -7542,6 +7608,23 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"node_modules/sass": {
"version": "1.53.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.53.0.tgz",
"integrity": "sha512-zb/oMirbKhUgRQ0/GFz8TSAwRq2IlR29vOUJZOx0l8sV+CkHUfHa4u5nqrG+1VceZp7Jfj59SVW9ogdhTvJDcQ==",
"dev": true,
"dependencies": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
"source-map-js": ">=0.6.2 <2.0.0"
},
"bin": {
"sass": "sass.js"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
@ -8005,6 +8088,15 @@
"node": ">=0.10.0"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/source-map-resolve": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
@ -9057,6 +9149,24 @@
"node": ">=0.10.0"
}
},
"node_modules/vinyl-sourcemaps-apply": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz",
"integrity": "sha512-+oDh3KYZBoZC8hfocrbrxbLUeaYtQK7J5WU5Br9VqWqmCll3tFJqKp97GC9GmMsVIL0qnx2DgEDVxdo5EZ5sSw==",
"dev": true,
"dependencies": {
"source-map": "^0.5.1"
}
},
"node_modules/vinyl-sourcemaps-apply/node_modules/source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@ -9725,6 +9835,16 @@
"@types/node": "*"
}
},
"@types/gulp-sass": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@types/gulp-sass/-/gulp-sass-5.0.0.tgz",
"integrity": "sha512-7p7nT+IKDREyJzTH13/FC/j3fobDBZTclSJFrgAJA+qzNZgzCENAx3HeiO4N7QlraLRqx44u3OR0Aq0Jw4wz8Q==",
"dev": true,
"requires": {
"@types/node": "*",
"@types/node-sass": "*"
}
},
"@types/http-errors": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.2.tgz",
@ -9782,6 +9902,15 @@
"integrity": "sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ==",
"dev": true
},
"@types/node-sass": {
"version": "4.11.3",
"resolved": "https://registry.npmjs.org/@types/node-sass/-/node-sass-4.11.3.tgz",
"integrity": "sha512-wXPCn3t9uu5rR4zXNSLasZHQMuRzUKBsdi4MsgT8uq4Lp1gQQo+T2G23tGj4SSgDHeNBle6vGseZtM2XV/X9bw==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/node-windows": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@types/node-windows/-/node-windows-0.1.2.tgz",
@ -12962,6 +13091,28 @@
}
}
},
"gulp-sass": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/gulp-sass/-/gulp-sass-5.1.0.tgz",
"integrity": "sha512-7VT0uaF+VZCmkNBglfe1b34bxn/AfcssquLKVDYnCDJ3xNBaW7cUuI3p3BQmoKcoKFrs9jdzUxyb+u+NGfL4OQ==",
"dev": true,
"requires": {
"lodash.clonedeep": "^4.5.0",
"picocolors": "^1.0.0",
"plugin-error": "^1.0.1",
"replace-ext": "^2.0.0",
"strip-ansi": "^6.0.1",
"vinyl-sourcemaps-apply": "^0.2.1"
},
"dependencies": {
"replace-ext": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-2.0.0.tgz",
"integrity": "sha512-UszKE5KVK6JvyD92nzMn9cDapSk6w/CaFZ96CnmDMUqH9oowfxF/ZjRITD25H4DnOQClLA4/j7jLGXXLVKxAug==",
"dev": true
}
}
},
"gulplog": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz",
@ -13117,6 +13268,12 @@
"integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==",
"dev": true
},
"immutable": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz",
"integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==",
"dev": true
},
"import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@ -13737,6 +13894,12 @@
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==",
"dev": true
},
"lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
@ -14570,6 +14733,12 @@
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true
},
"picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
@ -15143,6 +15312,17 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sass": {
"version": "1.53.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.53.0.tgz",
"integrity": "sha512-zb/oMirbKhUgRQ0/GFz8TSAwRq2IlR29vOUJZOx0l8sV+CkHUfHa4u5nqrG+1VceZp7Jfj59SVW9ogdhTvJDcQ==",
"dev": true,
"requires": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
"source-map-js": ">=0.6.2 <2.0.0"
}
},
"semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
@ -15503,6 +15683,12 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"dev": true
},
"source-map-resolve": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
@ -16372,6 +16558,23 @@
}
}
},
"vinyl-sourcemaps-apply": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz",
"integrity": "sha512-+oDh3KYZBoZC8hfocrbrxbLUeaYtQK7J5WU5Br9VqWqmCll3tFJqKp97GC9GmMsVIL0qnx2DgEDVxdo5EZ5sSw==",
"dev": true,
"requires": {
"source-map": "^0.5.1"
},
"dependencies": {
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
"dev": true
}
}
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

View File

@ -10,7 +10,8 @@
"scripts": {
"build": "npx genversion --es6 --semi version.js",
"start": "cross-env NODE_ENV=production node ./bin/www",
"dev": "cross-env NODE_ENV=dev DEBUG=lot-occupancy-manager:* nodemon ./bin/www",
"dev:test": "cross-env NODE_ENV=dev DEBUG=lot-occupancy-system:* TEST_DATABASES=true nodemon ./bin/www",
"dev:live": "cross-env NODE_ENV=dev DEBUG=lot-occupancy-system:* nodemon ./bin/www",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
@ -59,6 +60,7 @@
"@types/gulp": "^4.0.9",
"@types/gulp-changed": "^0.0.35",
"@types/gulp-minify": "^3.1.1",
"@types/gulp-sass": "^5.0.0",
"@types/http-errors": "^1.8.2",
"@types/mocha": "^9.1.1",
"@types/node-windows": "^0.1.2",
@ -73,6 +75,8 @@
"gulp": "^4.0.2",
"gulp-changed": "^4.0.3",
"gulp-minify": "^3.1.0",
"nodemon": "^2.0.19"
"gulp-sass": "^5.1.0",
"nodemon": "^2.0.19",
"sass": "^1.53.0"
}
}

View File

@ -1,4 +1,4 @@
@import '@cityssm/bulma-webapp-css/cityssm.min';
@use '../node_modules/@cityssm/bulma-webapp-css/cityssm.min.css';
$white: #fff;
$black: #000;
@ -51,7 +51,6 @@ fieldset:enabled .is-hidden-enabled {
#is-login-page {
overflow: auto;
background-image: url('../images/login.jpg');
background-position: top center;
background-size: cover;

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=document.querySelector("main").dataset.urlPrefix,t=document.querySelector("#form--filters"),n=document.querySelector("#filter--limit"),r=document.querySelector("#filter--offset"),s=document.querySelector("#container--searchResults"),a=()=>{const i=Number.parseInt(n.value,10),c=Number.parseInt(r.value,10);s.innerHTML='<p class="has-text-centered has-text-grey-lighter"><i class="fas fa-3x fa-circle-notch fa-spin" aria-hidden="true"></i><br /><em>Loading licences...</em></p>',cityssm.postJSON(e+"/licences/doSearch",t,e=>{const t=e.licences;if(0===t.length)return void(s.innerHTML='<div class="message is-info"><div class="message-body"><strong>Your search returned no results.</strong><br />Please try expanding your search criteria.</div></div>');s.innerHTML='<table class="table is-fullwidth is-striped is-hoverable has-sticky-header"><thead><tr></tr></thead><tbody></tbody></table>';const n=s.querySelector("tbody");for(const e of t){const e=document.createElement("tr");e.innerHTML="",n.append(e)}if(s.insertAdjacentHTML("beforeend",'<div class="level is-block-print"><div class="level-left has-text-weight-bold">Displaying licences '+(c+1).toString()+" to "+Math.min(i+c,e.count).toString()+" of "+e.count.toString()+"</div></div>"),i<e.count){const t=document.createElement("nav");if(t.className="level-right is-hidden-print",t.setAttribute("role","pagination"),t.setAttribute("aria-label","pagination"),c>0){const e=document.createElement("a");e.className="button",e.textContent="Previous",e.addEventListener("click",e=>{e.preventDefault(),r.value=Math.max(0,c-i).toString(),a()}),t.append(e)}if(i+c<e.count){const e=document.createElement("a");e.className="button ml-3",e.innerHTML='<span>Next Licences</span><span class="icon"><i class="fas fa-chevron-right" aria-hidden="true"></i></span>',e.addEventListener("click",e=>{e.preventDefault(),r.value=(c+i).toString(),a()}),t.append(e)}s.querySelector(".level").append(t)}})},i=()=>{r.value="0",a()};t.addEventListener("submit",e=>{e.preventDefault()});const c=t.querySelectorAll(".input, .select select");for(const e of c)e.addEventListener("change",i);i()})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,13 +8,23 @@ export interface Config {
};
activeDirectory?: ConfigActiveDirectory;
users?: {
testing?: string[];
canLogin?: string[];
canUpdate?: string[];
isAdmin?: string[];
};
aliases?: {
lot: string;
lots: string;
map: string;
maps: string;
occupancy: string;
occupancies: string;
};
}
interface ConfigApplication {
applicationName?: string;
backgroundURL?: string;
logoURL?: string;
httpPort?: number;
userDomain?: string;

View File

@ -8,14 +8,24 @@ export interface Config {
};
activeDirectory?: ConfigActiveDirectory;
users?: {
testing?: string[];
canLogin?: string[];
canUpdate?: string[];
isAdmin?: string[];
},
aliases?: {
lot: string;
lots: string;
map: string;
maps: string;
occupancy: string;
occupancies: string;
}
}
interface ConfigApplication {
applicationName?: string;
backgroundURL?: string;
logoURL?: string;
httpPort?: number;
userDomain?: string;

View File

@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -21,3 +21,4 @@
bulmaJS.init();
</script>
<script src="<%= urlPrefix %>/lib/cityssm-bulma-webapp-js/dist/cityssm-theme.min.js" defer></script>
<script src="<%= urlPrefix %>/lib/fa/js/all.min.js" defer></script>

View File

@ -11,7 +11,7 @@
<link rel="icon" href="<%= urlPrefix %>/images/favicon.png" />
<link rel="stylesheet" href="<%= urlPrefix %>/stylesheets/style.min.css" />
<link rel="stylesheet" href="<%= urlPrefix %>/stylesheets/style.css" />
<link rel="stylesheet" href="<%= urlPrefix %>/lib/fa/css/all.min.css" />
</head>

View File

@ -12,8 +12,7 @@
<link rel="icon" href="<%= urlPrefix %>/images/favicon.png" />
<link rel="stylesheet" href="<%= urlPrefix %>/stylesheets/style.min.css" />
<link rel="stylesheet" href="<%= urlPrefix %>/lib/fa/css/all.min.css" />
<link rel="stylesheet" href="<%= urlPrefix %>/stylesheets/style.css" />
</head>
<body>
@ -37,9 +36,9 @@
<a class="navbar-item" href="<%= urlPrefix %>/licences">
<span class="icon mr-1">
<i class="fas fa-fw fa-certificate" aria-hidden="true"></i>
<i class="fas fa-fw fa-vector-square" aria-hidden="true"></i>
</span>
<span>Licences</span>
<span><%= configFunctions.getProperty("aliases.lots") %></span>
</a>
<div class="navbar-item has-dropdown">
@ -58,7 +57,7 @@
<span>Reports</span>
</a>
<hr class="navbar-divider" />
<a class="navbar-item" href="https://cityssm.github.io/general-licence-manager/" target="_blank" rel="noopener noreferrer">
<a class="navbar-item" href="https://cityssm.github.io/lot-occupancy-system/" target="_blank" rel="noopener noreferrer">
<span class="icon mr-1">
<i class="fas fa-fw fa-question-circle" aria-hidden="true"></i>
</span>

View File

@ -14,28 +14,70 @@
<div class="card-content">
<div class="media">
<div class="media-left">
<i class="fas fa-3x fa-fw fa-certificate" aria-hidden="true"></i>
<i class="fas fa-3x fa-fw fa-vector-square" aria-hidden="true"></i>
</div>
<div class="media-content has-text-black">
<h2 class="title is-4 is-marginless">
<a href="<%= urlPrefix %>/licences">Licences</a>
<a href="<%= urlPrefix %>/lots"><%= configFunctions.getProperty("aliases.lots") %></a>
</h2>
<p>View and maintain licences.</p>
<p>View and maintain <%= configFunctions.getProperty("aliases.lots").toLowerCase() %>.</p>
</div>
</div>
</div>
<% if (user.userProperties.canUpdate) { %>
<div class="card-footer">
<a class="card-footer-item" href="<%= urlPrefix %>/licences/new">
<span class="icon">
<i class="fas fa-plus" aria-hidden="true"></i>
</span>
<span>Create a New Licence</span>
</a>
</div>
<div class="card">
<div class="card-content">
<div class="media">
<div class="media-left">
<i class="far fa-3x fa-fw fa-map" aria-hidden="true"></i>
</div>
<div class="media-content has-text-black">
<h2 class="title is-4 is-marginless">
<a href="<%= urlPrefix %>/maps"><%= configFunctions.getProperty("aliases.maps") %></a>
</h2>
<p>View and maintain <%= configFunctions.getProperty("aliases.maps").toLowerCase() %>.</p>
</div>
</div>
<% } %>
</div>
</div>
</div>
<div class="column">
<div class="card">
<div class="card-content">
<div class="media">
<div class="media-left">
<span class="fa-layers fa-3x fa-fw" aria-hidden="true">
<i class="fas fa-vector-square"></i>
<i class="fas fa-user" data-fa-transform="shrink-10"></i>
</span>
</div>
<div class="media-content has-text-black">
<h2 class="title is-4 is-marginless">
<a href="<%= urlPrefix %>/lotOccupancies"><%= configFunctions.getProperty("aliases.lot") + " " + configFunctions.getProperty("aliases.occupancies") %></a>
</h2>
<p>View and maintain <%= configFunctions.getProperty("aliases.lot").toLowerCase() + " " + configFunctions.getProperty("aliases.occupancies").toLowerCase() %>.</p>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-content">
<div class="media">
<div class="media-left">
<i class="fas fa-3x fa-fw fa-hard-hat" aria-hidden="true"></i>
</div>
<div class="media-content has-text-black">
<h2 class="title is-4 is-marginless">
<a href="<%= urlPrefix %>/workOrders">Work Orders</a>
</h2>
<p>View and maintain work orders.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="columns">
<div class="column">
<div class="card">
<div class="card-content">
@ -53,9 +95,6 @@
</div>
</div>
</div>
</div>
<div class="columns">
<div class="column">
<div class="card">
<div class="card-content">
@ -65,14 +104,14 @@
</div>
<div class="media-content has-text-black">
<h2 class="title is-4 is-marginless">
<a href="https://cityssm.github.io/general-licence-manager/" target="_blank" rel="noopener noreferrer">Help Documentation</a>
<a href="https://cityssm.github.io/lot-occupancy-system/" target="_blank" rel="noopener noreferrer">Help Documentation</a>
</h2>
<p>Instructions on how to use this application.</p>
</div>
</div>
</div>
<div class="card-footer">
<a class="card-footer-item has-tooltip-bottom" data-tooltip="Latest Updates, Issue Tracker, Say Hello" href="https://github.com/cityssm/general-licence-manager" target="_blank" rel="noreferrer">
<a class="card-footer-item has-tooltip-bottom" data-tooltip="Latest Updates, Issue Tracker, Say Hello" href="https://github.com/cityssm/lot-occupancy-system" target="_blank" rel="noreferrer">
<span class="icon">
<i class="fab fa-github" aria-hidden="true"></i>
</span>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="has-background-grey" id="is-login-page" lang="en">
<html class="has-background-grey" id="is-login-page" lang="en" style="background-image:url('<%= urlPrefix + configFunctions.getProperty("application.backgroundURL") %>')">
<head>
<title>
@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="<%= urlPrefix %>/images/favicon.png" />
<link rel="stylesheet" href="<%= urlPrefix %>/stylesheets/style.min.css" />
<link rel="stylesheet" href="<%= urlPrefix %>/stylesheets/style.css" />
<link rel="stylesheet" href="<%= urlPrefix %>/lib/fa/css/all.min.css" />
</head>
@ -20,7 +20,7 @@
<div class="box mx-3 my-3">
<div class="columns is-vcentered">
<div class="column has-text-centered">
<img src="<%= urlPrefix + configFunctions.getProperty("application.logoURL") %>" alt="" />
<img src="<%= urlPrefix + configFunctions.getProperty("application.logoURL") %>" alt="" style="max-height:400px" />
</div>
<div class="column">
<h1 class="title is-3 has-text-centered">