Many changes aded to system.

This commit is contained in:
Brian McGonagill 2026-01-24 13:49:38 -06:00
parent e0571d14b7
commit 5ba618f471
22 changed files with 640 additions and 57 deletions

View file

@ -0,0 +1,23 @@
<template name="locationTypeTbl">
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{{#each types}}
<tr>
<td>{{locationTypeName}}</td>
<td>{{locationTypeDesc}}</td>
<td>
<i class="material-icons">edit</i>
<i class="material-icons">delete</i>
</td>
</tr>
{{/each}}
</tbody>
</table>
</template>

View file

@ -0,0 +1,21 @@
import { Roles } from 'meteor/roles';
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
import { LocationTypes } from '../../imports/api/locationTypes.js';
Template.locationTypeTbl.onCreated(function() {
this.subscribe("LocationTypes");
});
Template.locationTypeTbl.onRendered(function() {
});
Template.locationTypeTbl.helpers({
types: function() {
return LocationTypes.find({});
},
});
Template.locationTypeTbl.events({
});

View file

@ -0,0 +1,21 @@
<template name="locationTypes">
<h1>Location Type Setup</h1>
<div class="grid">
<div>
<label for="typeName">Location Type Name *</label>
<input type="text" class="typeName" id="typeName" required />
</div>
<div>
<label for="typeDesc">Location Type Description</label>
<input type="text" class="typeDesc" id="typeDesc" />
</div>
</div>
<div class="grid">
<div>
<button class="primary right" id="saveLocationType">Save</button>
</div>
</div>
<hr>
{{> locationTypeTbl}}
{{> snackbar}}
</template>

View file

@ -0,0 +1,38 @@
import { Roles } from 'meteor/roles';
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
import { LocationTypes } from '../../imports/api/locationTypes.js';
Template.locationTypes.onCreated(function() {
this.subscribe("LocationTypes");
});
Template.locationTypes.onRendered(function() {
});
Template.locationTypes.helpers({
});
Template.locationTypes.events({
'click #saveLocationType' (event) {
event.preventDefault();
let typeName = $("#typeName").val();
let typeDesc = $("#typeDesc").val();
if (typeName == null || typeName == "") {
return;
} else {
const addLocation = async() => {
const result = await Meteor.callAsync("add.locationType", typeName, typeDesc);
if (!result) {
showSnackbar("Location Type Failed!", "red");
} else {
showSnackbar("Location Type Added!", "green");
}
}
addLocation();
}
}
});