Many chcanges, but version 0.1.0 is ready to be cut.

This commit is contained in:
Brian McGonagill 2022-08-23 13:41:21 -05:00
parent 42643a37f5
commit 6e37ae8c74
46 changed files with 1038 additions and 273 deletions

View file

@ -3,7 +3,7 @@
<div class="row">
{{#if isInRole 'systemadmin'}}
<div class="col s12 m6 l4">
<div class="card blue-grey darken-1">
<div class="card blue-grey darken-1" id="userInfoCard">
<div class="card-content white-text">
<span class="card-title"><h4>Users</h4></span>
<div class="row">
@ -12,13 +12,13 @@
</div>
</div>
<div class="card-action">
<a href="#" id="usermgmtlink">User Management</a>
<a href="#" class="cardLink" id="userMgmtLink">User Management</a>
</div>
</div>
</div>
{{/if}}
<div class="col s12 m6 l4">
<div class="card blue-grey darken-1">
<div class="card blue-grey darken-1" id="listInfoCard">
<div class="card-content white-text">
<span class="card-title"><h4>My Lists</h4></span>
<div class="row">
@ -26,15 +26,13 @@
<div class="col s4"><h2>{{listCount}}</h2></div>
</div>
</div>
{{#if isInRole 'systemadmin'}}
<div class="card-action">
<a href="#" id="usermgmtlink">List Management</a>
<a href="#" class="cardLink" id="listMgmtLink">List Management</a>
</div>
{{/if}}
</div>
</div>
<div class="col s12 m6 l4">
<div class="card blue-grey darken-1">
<div class="card blue-grey darken-1" id="prodInfoCard">
<div class="card-content white-text">
<span class="card-title"><h4>My Products</h4></span>
<div class="row">
@ -42,15 +40,13 @@
<div class="col s4"><h2>{{productCount}}</h2></div>
</div>
</div>
{{#if isInRole 'systemadmin'}}
<div class="card-action">
<a href="#" id="usermgmtlink">Product Management</a>
<a href="#" class="cardLink" id="prodMgmtLink">Product Management</a>
</div>
{{/if}}
</div>
</div>
<div class="col s12 m6 l4">
<div class="card blue-grey darken-1">
<div class="card blue-grey darken-1" id="storeInfoCard">
<div class="card-content white-text">
<span class="card-title"><h4>My Stores</h4></span>
<div class="row">
@ -58,15 +54,13 @@
<div class="col s4"><h2>{{storeCount}}</h2></div>
</div>
</div>
{{#if isInRole 'systemadmin'}}
<div class="card-action">
<a href="#" id="usermgmtlink">Store Management</a>
<a href="#" class="cardLink" id="storeMgmtLink">Store Management</a>
</div>
{{/if}}
</div>
</div>
<div class="col s12 m6 l4">
<div class="card blue-grey darken-1">
<div class="card blue-grey darken-1" id="catInfoCard">
<div class="card-content white-text">
<span class="card-title"><h4>My Categories</h4></span>
<div class="row">
@ -74,11 +68,23 @@
<div class="col s4"><h2>{{catCount}}</h2></div>
</div>
</div>
{{#if isInRole 'systemadmin'}}
<div class="card-action">
<a href="#" id="usermgmtlink">Category Management</a>
<a href="#" class="cardLink" id="catMgmtLink">Category Management</a>
</div>
</div>
</div>
<div class="col s12 m6 l4">
<div class="card blue-grey darken-1" id="locInfoCard">
<div class="card-content white-text">
<span class="card-title"><h4>My Locations</h4></span>
<div class="row">
<div class="col s8"><i class="medium material-icons">map</i></div>
<div class="col s4"><h2>{{locCount}}</h2></div>
</div>
</div>
<div class="card-action">
<a href="#" class="cardLink" id="locationMgmtLink">Location Management</a>
</div>
{{/if}}
</div>
</div>
</div>

View file

@ -1,5 +1,6 @@
import { Categories } from "../../imports/api/category";
import { Lists } from "../../imports/api/lists";
import { Locations } from "../../imports/api/location";
import { Products } from "../../imports/api/products";
import { Stores } from "../../imports/api/stores";
@ -10,6 +11,7 @@ Template.dashboard.onCreated(function() {
this.subscribe("myCategories");
this.subscribe("storeInfo");
this.subscribe("myProducts");
this.subscribe("myLocations");
});
Template.dashboard.onRendered(function() {
@ -31,12 +33,64 @@ Template.dashboard.helpers({
},
catCount: function() {
return Categories.find().count();
},
locCount: function() {
return Locations.find().count();
}
});
Template.dashboard.events({
"click #usermgmtlink" (event) {
"click .cardLink" (event) {
event.preventDefault();
FlowRouter.go('/userMgmt');
let link = event.currentTarget.id;
switch(link) {
case "userMgmtLink":
FlowRouter.go('/userMgmt');
break;
case "listMgmtLink":
FlowRouter.go('/manageLists');
break;
case "storeMgmtLink":
FlowRouter.go('/manageStore');
break;
case "prodMgmtLink":
FlowRouter.go('/manageProduct');
break;
case "catMgmtLink":
FlowRouter.go('/manageCategory');
break;
case "locationMgmtLink":
FlowRouter.go('/manageLocation');
break;
default:
break;
}
},
'click .card' (event) {
event.preventDefault();
let cardId = event.currentTarget.id;
switch(cardId) {
case "userInfoCard":
FlowRouter.go('/userMgmt');
break;
case "listInfoCard":
FlowRouter.go("/mylists");
break;
case "storeInfoCard":
FlowRouter.go('/manageStore');
break;
case "catInfoCard":
FlowRouter.go('/manageCategory');
break;
case "locInfoCard":
FlowRouter.go('/manageLocation');
break;
case "prodInfoCard":
FlowRouter.go("/manageProduct");
break;
default:
break;
}
}
});