mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Adding more methods and views, updated dashboards a bit. Still not ready
This commit is contained in:
parent
266dbd0856
commit
42643a37f5
23 changed files with 374 additions and 32 deletions
11
client/AdminMgmt/StoreMgmt/storeMgmt.html
Normal file
11
client/AdminMgmt/StoreMgmt/storeMgmt.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<template name="storeMgmt">
|
||||
<!-- Store Management Entry / Edit -->
|
||||
<h4>Store Management</h4>
|
||||
<p>Add Stores you commonly make lists for here.</p>
|
||||
|
||||
{{> storeMgmtForm}}
|
||||
<!-- Store Management Table List -->
|
||||
<hr>
|
||||
{{> storeMgmtTbl}}
|
||||
|
||||
</template>
|
||||
17
client/AdminMgmt/StoreMgmt/storeMgmt.js
Normal file
17
client/AdminMgmt/StoreMgmt/storeMgmt.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { Stores } from '../../../imports/api/stores';
|
||||
|
||||
Template.storeMgmt.onCreated(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.storeMgmt.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.storeMgmt.helpers({
|
||||
|
||||
});
|
||||
|
||||
Template.storeMgmt.events({
|
||||
|
||||
});
|
||||
20
client/AdminMgmt/StoreMgmt/storeMgmtForm.html
Normal file
20
client/AdminMgmt/StoreMgmt/storeMgmtForm.html
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<template name="storeMgmtForm">
|
||||
<div class="row">
|
||||
<div class="col s12 m6 l6 input-field">
|
||||
<input type="text" class="storeName" id="storeName" />
|
||||
<label for="storeName">Name</label>
|
||||
</div>
|
||||
<div class="col s12 m6 l6 input-field">
|
||||
<input type="text" class="storeType" id="storeType" />
|
||||
<label for="storeType">Type</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col s6 m6 l6">
|
||||
<a class="waves-effect waves-light btn cancelStoreMgmt orange">Cancel</a>
|
||||
</div>
|
||||
<div class="col s6 m6 l6">
|
||||
<a class="waves-effect waves-light btn saveStoreMgmt green right">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
35
client/AdminMgmt/StoreMgmt/storeMgmtForm.js
Normal file
35
client/AdminMgmt/StoreMgmt/storeMgmtForm.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { Stores } from '../../../imports/api/stores';
|
||||
|
||||
Template.storeMgmtForm.onCreated(function() {
|
||||
this.subscribe("storeInfo");
|
||||
});
|
||||
|
||||
Template.storeMgmtForm.onRendered(function() {
|
||||
Session.set("borderRed", false);
|
||||
});
|
||||
|
||||
Template.storeMgmtForm.helpers({
|
||||
|
||||
});
|
||||
|
||||
Template.storeMgmtForm.events({
|
||||
'click .saveStoreMgmt' (event) {
|
||||
event.preventDefault();
|
||||
let storeName = $("#storeName").val();
|
||||
let storeType = $("#storeType").val();
|
||||
if (storeName == "" || storeName == null) {
|
||||
Session.set("borderRed", true);
|
||||
return;
|
||||
} else {
|
||||
Meteor.call("add.store", storeName, storeType, function(err, result) {
|
||||
if (err) {
|
||||
// console.log("ERROR: Store add failed: " + err);
|
||||
} else {
|
||||
// console.log("Success adding store!");
|
||||
$("#storeName").val("");
|
||||
$("#storeType").val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
27
client/AdminMgmt/StoreMgmt/storeMgmtTbl.html
Normal file
27
client/AdminMgmt/StoreMgmt/storeMgmtTbl.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<template name="storeMgmtTbl">
|
||||
<table class="highlight striped responsive-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Store Name</th>
|
||||
<th>Type</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each mgmtStoreInfo}}
|
||||
<tr>
|
||||
<td>
|
||||
{{storeName}}
|
||||
</td>
|
||||
<td>
|
||||
{{storeType}}
|
||||
</td>
|
||||
<td>
|
||||
<i class="material-icons clickable deleteStore">delete</i>
|
||||
<i class="material-icons clickable editStore">edit</i>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
26
client/AdminMgmt/StoreMgmt/storeMgmtTbl.js
Normal file
26
client/AdminMgmt/StoreMgmt/storeMgmtTbl.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { Stores } from '../../../imports/api/stores';
|
||||
|
||||
Template.storeMgmtTbl.onCreated(function() {
|
||||
this.subscribe("storeInfo");
|
||||
});
|
||||
|
||||
Template.storeMgmtTbl.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.storeMgmtTbl.helpers({
|
||||
mgmtStoreInfo: function() {
|
||||
return Stores.find({});
|
||||
},
|
||||
});
|
||||
|
||||
Template.storeMgmtTbl.events({
|
||||
'click .deleteStore' (event) {
|
||||
event.preventDefault();
|
||||
// console.log("Delete Store Clicked");
|
||||
},
|
||||
'click .editStore' (event) {
|
||||
event.preventDefault();
|
||||
// console.log("Edit Store Clicked");
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue