mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 08:18:50 +00:00
Lots of changes and additions to the project. Still early, and not usable.
This commit is contained in:
parent
8636f8cf9b
commit
266dbd0856
41 changed files with 836 additions and 67 deletions
5
client/AdminMgmt/LocationMgmt/locMgmt.html
Normal file
5
client/AdminMgmt/LocationMgmt/locMgmt.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<template name="locMgmt">
|
||||
{{> locMgmtForm}}
|
||||
<hr>
|
||||
{{> locMgmtTbl}}
|
||||
</template>
|
||||
15
client/AdminMgmt/LocationMgmt/locMgmt.js
Normal file
15
client/AdminMgmt/LocationMgmt/locMgmt.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Template.locMgmt.onCreated(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.locMgmt.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.locMgmt.helpers({
|
||||
|
||||
});
|
||||
|
||||
Template.locMgmt.events({
|
||||
|
||||
});
|
||||
16
client/AdminMgmt/LocationMgmt/locMgmtForm.html
Normal file
16
client/AdminMgmt/LocationMgmt/locMgmtForm.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<template name="locMgmtForm">
|
||||
<div class="row">
|
||||
<div class="col s12 m6 l6 input-field">
|
||||
<input type="text" class="locNameInp" id="locNameInp" style="{{#if $eq locNameErr true}}border: 2px solid red;{{/if}}" />
|
||||
<label for="locNameInp">Name*</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col s6 m6 l6">
|
||||
<a class="waves-effect waves-light btn cancelLocMgmt orange">Cancel</a>
|
||||
</div>
|
||||
<div class="col s6 m6 l6">
|
||||
<a class="waves-effect waves-light btn saveLocMgmt green right">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
39
client/AdminMgmt/LocationMgmt/locMgmtForm.js
Normal file
39
client/AdminMgmt/LocationMgmt/locMgmtForm.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { Locations } from '../../../imports/api/location.js';
|
||||
|
||||
Template.locMgmtForm.onCreated(function() {
|
||||
this.subscribe("myLocations");
|
||||
});
|
||||
|
||||
Template.locMgmtForm.onRendered(function() {
|
||||
Session.set("locNameMiss", false);
|
||||
});
|
||||
|
||||
Template.locMgmtForm.helpers({
|
||||
locNameErr: function() {
|
||||
return Session.get("locNameMiss");
|
||||
},
|
||||
});
|
||||
|
||||
Template.locMgmtForm.events({
|
||||
'click .saveLocMgmt' (event) {
|
||||
event.preventDefault();
|
||||
let locName = $("#locNameInp").val();
|
||||
if (locName == null || locName == "") {
|
||||
Session.set("locNameMiss", true);
|
||||
return;
|
||||
} else {
|
||||
Meteor.call('add.location', locName, function(err, result) {
|
||||
if (err) {
|
||||
// console.log(" ERROR: Can't add category: " + err);
|
||||
} else {
|
||||
// console.log(" SUCCESS adding category.");
|
||||
$("#locNameInp").val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .cancelLocMgmt' (event) {
|
||||
event.preventDefault();
|
||||
$("#locNameInp").val("");
|
||||
}
|
||||
});
|
||||
21
client/AdminMgmt/LocationMgmt/locMgmtTbl.html
Normal file
21
client/AdminMgmt/LocationMgmt/locMgmtTbl.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<template name="locMgmtTbl">
|
||||
<table class="highlight striped responsive-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each locs}}
|
||||
<tr>
|
||||
<td>{{locationName}}</td>
|
||||
<td>
|
||||
<i class="material-icons clickable deleteCategory">delete</i>
|
||||
<i class="material-icons clickable editCategory">edit</i>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
19
client/AdminMgmt/LocationMgmt/locMgmtTbl.js
Normal file
19
client/AdminMgmt/LocationMgmt/locMgmtTbl.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { Locations } from '../../../imports/api/location.js';
|
||||
|
||||
Template.locMgmtTbl.onCreated(function() {
|
||||
this.subscribe("myLocations");
|
||||
});
|
||||
|
||||
Template.locMgmtTbl.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.locMgmtTbl.helpers({
|
||||
locs: function() {
|
||||
return Locations.find({});
|
||||
}
|
||||
});
|
||||
|
||||
Template.locMgmtTbl.events([
|
||||
|
||||
]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue