Adding more methods and views, updated dashboards a bit. Still not ready

This commit is contained in:
Brian McGonagill 2022-08-16 16:46:14 -05:00
parent 266dbd0856
commit 42643a37f5
23 changed files with 374 additions and 32 deletions

View file

@ -23,7 +23,7 @@
{{#each stores}}
<option value="{{storeName}}">{{storeName}}</option>
{{/each}}
<option id="addNewStore" class="modal-trigger" href="modalStore" value="addNewStore">Add New Store</option>
<option id="addNewStore" value="addNewStore">Add New Store</option>
</select>
<label for="prodStore">Store</label>
</div>
@ -46,7 +46,8 @@
<a class="waves-effect waves-light btn saveProdMgmt green right">Add</a>
</div>
</div>
<!-- Modal Structure -->
<!-- Store Modal Structure -->
<div id="modalStore" class="modal">
<div class="modal-content">
<h4>Add New Store</h4>
@ -56,4 +57,26 @@
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Done</a>
</div>
</div>
<!-- Location Modal Structure -->
<div id="modalLocation" class="modal">
<div class="modal-content">
<h4>Add New Location</h4>
{{> locMgmtForm}}
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Done</a>
</div>
</div>
<!-- Category Modal Structure -->
<div id="modalCategory" class="modal">
<div class="modal-content">
<h4>Add New Category</h4>
{{> catMgmtForm}}
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Done</a>
</div>
</div>
</template>

View file

@ -62,6 +62,10 @@ Template.prodMgmtForm.events({
// console.log(" ERROR: can't add product: " + err);
} else {
// console.log(" SUCCESS adding product.");
$("#prodName").val("");
$("#prodCategory").val("");
$("#prodStore").val("");
$("#prodLocation").val("");
}
});
}
@ -71,7 +75,7 @@ Template.prodMgmtForm.events({
$("#prodName").val("");
$("#prodCategory").val("");
$("#prodStore").val("");
$("#prodLocation").val("")
$("#prodLocation").val("");
},
'change #prodStore' (event) {
event.preventDefault();
@ -81,7 +85,6 @@ Template.prodMgmtForm.events({
$("#prodStore").val("");
// open a modal to enter store information.
$('#modalStore').modal('open');
}
},
'change #prodLocation' (event) {
@ -98,10 +101,13 @@ Template.prodMgmtForm.events({
event.preventDefault();
let val = $("#prodCategory").val();
if (val == "addNewCategory") {
if (val == "addNewCat") {
$("#prodCategory").val("");
// open a modal to enter store information.
$('#modalCategory').modal('open');
}
},
'click .modal-close' (event) {
$('select').formSelect();
}
});