From 6e37ae8c748b6bfff001ca0ec6024d3809e84134 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Tue, 23 Aug 2022 13:41:21 -0500 Subject: [PATCH] Many chcanges, but version 0.1.0 is ready to be cut. --- .meteor/packages | 1 - client/AdminMgmt/CategoryMgMt/catMgmt.html | 10 +- .../AdminMgmt/CategoryMgMt/catMgmtForm.html | 30 +++--- client/AdminMgmt/CategoryMgMt/catMgmtForm.js | 56 ++++++++++ client/AdminMgmt/CategoryMgMt/catMgmtTbl.html | 4 +- client/AdminMgmt/CategoryMgMt/catMgmtTbl.js | 22 +++- client/AdminMgmt/ListMgmt/listMgmtForm.html | 12 ++- client/AdminMgmt/ListMgmt/listMgmtForm.js | 15 ++- client/AdminMgmt/ListMgmt/listMgmtTbl.html | 2 +- client/AdminMgmt/ListMgmt/listMgmtTbl.js | 13 ++- client/AdminMgmt/LocationMgmt/locMgmt.html | 9 +- .../AdminMgmt/LocationMgmt/locMgmtForm.html | 30 +++--- client/AdminMgmt/LocationMgmt/locMgmtForm.js | 56 ++++++++++ client/AdminMgmt/LocationMgmt/locMgmtTbl.html | 32 +++--- client/AdminMgmt/LocationMgmt/locMgmtTbl.js | 26 ++++- client/AdminMgmt/MgmtPage/mgmtPage.html | 15 ++- .../AdminMgmt/ProductMgmt/prodMgmtForm.html | 92 ++++++++-------- client/AdminMgmt/ProductMgmt/prodMgmtForm.js | 102 +++++++++++++++++- client/AdminMgmt/ProductMgmt/prodMgmtTbl.html | 4 +- client/AdminMgmt/ProductMgmt/prodMgmtTbl.js | 26 ++++- client/AdminMgmt/StoreMgmt/storeMgmt.html | 15 ++- client/AdminMgmt/StoreMgmt/storeMgmtForm.html | 34 +++--- client/AdminMgmt/StoreMgmt/storeMgmtForm.js | 63 ++++++++++- client/AdminMgmt/StoreMgmt/storeMgmtTbl.html | 36 +++---- client/AdminMgmt/StoreMgmt/storeMgmtTbl.js | 17 ++- client/Dashboard/dashboard.html | 42 ++++---- client/Dashboard/dashboard.js | 58 +++++++++- client/ListItems/listItemsForm.html | 34 ++++++ client/ListItems/listItemsForm.js | 68 ++++++++++++ client/ListItems/listItemsMain.html | 5 + client/ListItems/listItemsMain.js | 15 +++ client/ListItems/listItemsTbl.html | 21 ++++ client/ListItems/listItemsTbl.js | 67 ++++++++++++ client/Lists/listsMain.html | 4 + client/Lists/listsMain.js | 16 +++ client/Lists/listsTbl.html | 26 +++++ client/Lists/listsTbl.js | 57 ++++++++++ client/main.css | 17 ++- client/main.html | 3 + imports/api/listItems.js | 85 +++++++-------- imports/api/lists.js | 27 +++-- imports/api/products.js | 4 +- imports/api/stores.js | 12 +-- lib/routes.js | 14 +++ server/main.js | 2 + server/publish.js | 12 ++- 46 files changed, 1038 insertions(+), 273 deletions(-) create mode 100644 client/ListItems/listItemsForm.html create mode 100644 client/ListItems/listItemsForm.js create mode 100644 client/ListItems/listItemsMain.html create mode 100644 client/ListItems/listItemsMain.js create mode 100644 client/ListItems/listItemsTbl.html create mode 100644 client/ListItems/listItemsTbl.js create mode 100644 client/Lists/listsMain.html create mode 100644 client/Lists/listsMain.js create mode 100644 client/Lists/listsTbl.html create mode 100644 client/Lists/listsTbl.js diff --git a/.meteor/packages b/.meteor/packages index 8ca9ca0..52b9cee 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -30,4 +30,3 @@ raix:handlebar-helpers kadira:flow-router kadira:blaze-layout accounts-password@2.3.1 -# mizzao:autocomplete # for the @mentions functionality \ No newline at end of file diff --git a/client/AdminMgmt/CategoryMgMt/catMgmt.html b/client/AdminMgmt/CategoryMgMt/catMgmt.html index dd86347..bbfa5e5 100644 --- a/client/AdminMgmt/CategoryMgMt/catMgmt.html +++ b/client/AdminMgmt/CategoryMgMt/catMgmt.html @@ -1,6 +1,8 @@ \ No newline at end of file diff --git a/client/AdminMgmt/CategoryMgMt/catMgmtForm.html b/client/AdminMgmt/CategoryMgMt/catMgmtForm.html index df5eb53..9eb21ec 100644 --- a/client/AdminMgmt/CategoryMgMt/catMgmtForm.html +++ b/client/AdminMgmt/CategoryMgMt/catMgmtForm.html @@ -1,16 +1,22 @@ \ No newline at end of file diff --git a/client/AdminMgmt/CategoryMgMt/catMgmtForm.js b/client/AdminMgmt/CategoryMgMt/catMgmtForm.js index 17a31de..ca5d55e 100644 --- a/client/AdminMgmt/CategoryMgMt/catMgmtForm.js +++ b/client/AdminMgmt/CategoryMgMt/catMgmtForm.js @@ -6,12 +6,16 @@ Template.catMgmtForm.onCreated(function() { Template.catMgmtForm.onRendered(function() { Session.set("catNameMiss", false); + Session.set("catEditMode", false); }); Template.catMgmtForm.helpers({ catNameErr: function() { return Session.get("catNameMiss"); }, + catEditMode: function() { + return Session.get("catEditMode"); + } }); Template.catMgmtForm.events({ @@ -32,8 +36,60 @@ Template.catMgmtForm.events({ }); } }, + 'click .editCatMgmt' (event) { + event.preventDefault(); + let catName = $("#catNameInp").val(); + let catId = this._id; + if (catName == null || catName == "") { + Session.set("catNameMiss", true); + return; + } else { + let catId = Session.get("categoryEditId"); + Meteor.call('edit.category', catId, catName, function(err, result) { + if (err) { + // console.log(" ERROR: Can't edit category: " + err); + } else { + // console.log(" SUCCESS editing category."); + $("#catNameInp").val(""); + Session.set("catEditMode", false); + } + }); + } + }, + 'submit #catInputForm' (event) { + event.preventDefault(); + let catName = $("#catNameInp").val(); + let editMode = Session.get("catEditMode"); + if (catName == null || catName == "") { + Session.set("catNameMiss", true); + return; + } else { + if (editMode == false) { + Meteor.call('add.category', catName, function(err, result) { + if (err) { + // console.log(" ERROR: Can't add category: " + err); + } else { + // console.log(" SUCCESS adding category."); + $("#catNameInp").val(""); + } + }); + } else { + let catId = Session.get("categoryEditId"); + Meteor.call('edit.category', catId, catName, function(err, result) { + if (err) { + // console.log(" ERROR: Can't edit category: " + err); + } else { + // console.log(" SUCCESS editing category."); + $("#catNameInp").val(""); + Session.set("catEditMode", false); + } + }); + } + } + }, 'click .cancelCatMgmt' (event) { event.preventDefault(); $("#catNameInp").val(""); + Session.set("catEditMode", false); } }); \ No newline at end of file diff --git a/client/AdminMgmt/CategoryMgMt/catMgmtTbl.html b/client/AdminMgmt/CategoryMgMt/catMgmtTbl.html index 1531675..dcc1b33 100644 --- a/client/AdminMgmt/CategoryMgMt/catMgmtTbl.html +++ b/client/AdminMgmt/CategoryMgMt/catMgmtTbl.html @@ -5,8 +5,8 @@ {{#each cats}}
  • {{categoryName}} - delete - edit + delete + edit
  • {{/each}} diff --git a/client/AdminMgmt/CategoryMgMt/catMgmtTbl.js b/client/AdminMgmt/CategoryMgMt/catMgmtTbl.js index 57982ed..352c92e 100644 --- a/client/AdminMgmt/CategoryMgMt/catMgmtTbl.js +++ b/client/AdminMgmt/CategoryMgMt/catMgmtTbl.js @@ -5,7 +5,9 @@ Template.catMgmtTbl.onCreated(function() { }); Template.catMgmtTbl.onRendered(function() { - + Meteor.setTimeout(function() { + $('.tooltipped').tooltip(); + }, 150); }); Template.catMgmtTbl.helpers({ @@ -15,5 +17,21 @@ Template.catMgmtTbl.helpers({ }); Template.catMgmtTbl.events({ - + 'click .deleteCategory' (event) { + event.preventDefault(); + Meteor.call('delete.category', this._id, function(err, result) { + if (err) { + console.log(" ERROR deleting category: " + err); + } else { + console.log(" SUCCESS deleting the category."); + } + }); + }, + 'click .editCategory' (event) { + event.preventDefault(); + Session.set("categoryEditId", this._id); + Session.set("catEditMode", true); + let catInfo = Categories.findOne({ _id: this._id }); + $("#catNameInp").val(catInfo.categoryName); + } }); \ No newline at end of file diff --git a/client/AdminMgmt/ListMgmt/listMgmtForm.html b/client/AdminMgmt/ListMgmt/listMgmtForm.html index d2b2fac..5299d72 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtForm.html +++ b/client/AdminMgmt/ListMgmt/listMgmtForm.html @@ -6,7 +6,17 @@ -
    +
    +

    + +

    +
    +
    +
    +
    {{#if $eq editMode false}} Add {{else}} diff --git a/client/AdminMgmt/ListMgmt/listMgmtForm.js b/client/AdminMgmt/ListMgmt/listMgmtForm.js index 43c26cf..d15c1a2 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtForm.js +++ b/client/AdminMgmt/ListMgmt/listMgmtForm.js @@ -22,17 +22,19 @@ Template.listMgmtForm.events({ 'click .saveListMgmt' (event) { event.preventDefault(); let listName = $("#listNameInp").val(); + let shared = $("#isShared").prop('checked'); if (listName == null || listName == "") { Session.set("listNameMiss", true); return; } else { - Meteor.call('add.list', listName, function(err, result) { + Meteor.call('add.list', listName, shared, function(err, result) { if (err) { console.log(" ERROR adding list name: " + err); } else { console.log(" SUCCESS adding list name."); $("#listNameInp").val(""); + $("#isShared").prop("checked", false); } }); } @@ -40,18 +42,20 @@ Template.listMgmtForm.events({ 'click .renameListMgmt' (event) { event.preventDefault(); let listName = $("#listNameInp").val(); + let shared = $("#isShared").prop('checked'); let listId = Session.get("listItemId"); if (listName == null || listName == "") { Session.set("listNameMiss", true); return; } else { - Meteor.call('edit.list', listId, listName, function(err, result) { + Meteor.call('edit.list', listId, listName, shared, function(err, result) { if (err) { console.log(" ERROR editing list name: " + err); } else { console.log(" SUCCESS editing list name."); $("#listNameInp").val(""); + $("#isShared").prop("checked", false); Session.set("listNameEditMode", false); } }); @@ -60,6 +64,7 @@ Template.listMgmtForm.events({ 'submit .listAdd' (event) { event.preventDefault(); let editMode = Session.get("listNameEditMode"); + let shared = $("#isShared").prop("checked"); let listName = $("#listNameInp").val(); let listId = Session.get("listItemId"); @@ -68,21 +73,23 @@ Template.listMgmtForm.events({ return; } else { if (editMode == false) { - Meteor.call('add.list', listName, function(err, result) { + Meteor.call('add.list', listName, shared, function(err, result) { if (err) { console.log(" ERROR adding list name: " + err); } else { console.log(" SUCCESS adding list name."); $("#listNameInp").val(""); + $("#isShared").prop("checked", false); } }); } else { - Meteor.call('edit.list', listId, listName, function(err, result) { + Meteor.call('edit.list', listId, listName, shared, function(err, result) { if (err) { console.log(" ERROR editing list name: " + err); } else { console.log(" SUCCESS editing list name."); $("#listNameInp").val(""); + $("#isShared").prop("checked", false); Session.set("listNameEditMode", false); } }); diff --git a/client/AdminMgmt/ListMgmt/listMgmtTbl.html b/client/AdminMgmt/ListMgmt/listMgmtTbl.html index fde6b45..7724192 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtTbl.html +++ b/client/AdminMgmt/ListMgmt/listMgmtTbl.html @@ -4,7 +4,7 @@
      {{#each lists}}
    • - {{listName}} + {{listName}} delete edit check diff --git a/client/AdminMgmt/ListMgmt/listMgmtTbl.js b/client/AdminMgmt/ListMgmt/listMgmtTbl.js index e3a837c..c469f4d 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtTbl.js +++ b/client/AdminMgmt/ListMgmt/listMgmtTbl.js @@ -5,7 +5,9 @@ Template.listMgmtTbl.onCreated(function() { }); Template.listMgmtTbl.onRendered(function() { - $('.tooltipped').tooltip(); + Meteor.setTimeout(function() { + $('.tooltipped').tooltip(); + }, 150); }); Template.listMgmtTbl.helpers({ @@ -28,8 +30,15 @@ Template.listMgmtTbl.events({ }, 'click .editListName' (event) { event.preventDefault(); - let listName = Lists.findOne({ _id: this._id }).listName; + let listInfo = Lists.findOne({ _id: this._id }); + let listName = listInfo.listName; + let listShared = listInfo.listShared; $("#listNameInp").val(listName); + if (listShared == true) { + $("#isShared").prop("checked", true); + } else { + $("#isShared").prop("checked", false); + } Session.set("listNameEditMode", true); Session.set("listItemId", this._id); }, diff --git a/client/AdminMgmt/LocationMgmt/locMgmt.html b/client/AdminMgmt/LocationMgmt/locMgmt.html index 8194b3c..54fd5de 100644 --- a/client/AdminMgmt/LocationMgmt/locMgmt.html +++ b/client/AdminMgmt/LocationMgmt/locMgmt.html @@ -1,5 +1,8 @@ \ No newline at end of file diff --git a/client/AdminMgmt/LocationMgmt/locMgmtForm.html b/client/AdminMgmt/LocationMgmt/locMgmtForm.html index 9febef8..fe725b7 100644 --- a/client/AdminMgmt/LocationMgmt/locMgmtForm.html +++ b/client/AdminMgmt/LocationMgmt/locMgmtForm.html @@ -1,16 +1,22 @@ \ No newline at end of file diff --git a/client/AdminMgmt/LocationMgmt/locMgmtForm.js b/client/AdminMgmt/LocationMgmt/locMgmtForm.js index f6aff83..a484598 100644 --- a/client/AdminMgmt/LocationMgmt/locMgmtForm.js +++ b/client/AdminMgmt/LocationMgmt/locMgmtForm.js @@ -6,12 +6,16 @@ Template.locMgmtForm.onCreated(function() { Template.locMgmtForm.onRendered(function() { Session.set("locNameMiss", false); + Session.set("locEditMode", false); }); Template.locMgmtForm.helpers({ locNameErr: function() { return Session.get("locNameMiss"); }, + locEditMode: function() { + return Session.get("locEditMode"); + } }); Template.locMgmtForm.events({ @@ -32,8 +36,60 @@ Template.locMgmtForm.events({ }); } }, + 'click .editLocMgmt' (event) { + event.preventDefault(); + let locName = $("#locNameInp").val(); + let locEditMode = Session.get("locEditMode"); + let locId = Session.get("locEditId"); + if (locName == null || locName == "") { + Session.set("locNameMiss", true); + return; + } else { + Meteor.call('edit.location', locId, locName, function(err, result) { + if (err) { + // console.log(" ERROR: Can't edit category: " + err); + } else { + // console.log(" SUCCESS editing category."); + $("#locNameInp").val(""); + Session.set("locEditMode", false); + } + }); + } + }, + 'submit #locInputForm' (event) { + event.preventDefault(); + let locName = $("#locNameInp").val(); + let locEditMode = Session.get("locEditMode"); + let locId = Session.get("locEditId"); + if (locName == null || locName == "") { + Session.set("locNameMiss", true); + return; + } else { + if (locEditMode == false) { + 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(""); + } + }); + } else { + Meteor.call('edit.location', locId, locName, function(err, result) { + if (err) { + // console.log(" ERROR: Can't edit category: " + err); + } else { + // console.log(" SUCCESS editing category."); + $("#locNameInp").val(""); + Session.set("locEditMode", false); + } + }); + } + } + }, 'click .cancelLocMgmt' (event) { event.preventDefault(); $("#locNameInp").val(""); + Session.set("locEditMode", false); } }); \ No newline at end of file diff --git a/client/AdminMgmt/LocationMgmt/locMgmtTbl.html b/client/AdminMgmt/LocationMgmt/locMgmtTbl.html index 6f3924c..bcdf329 100644 --- a/client/AdminMgmt/LocationMgmt/locMgmtTbl.html +++ b/client/AdminMgmt/LocationMgmt/locMgmtTbl.html @@ -1,21 +1,15 @@ \ No newline at end of file diff --git a/client/AdminMgmt/LocationMgmt/locMgmtTbl.js b/client/AdminMgmt/LocationMgmt/locMgmtTbl.js index e7328a1..fcae297 100644 --- a/client/AdminMgmt/LocationMgmt/locMgmtTbl.js +++ b/client/AdminMgmt/LocationMgmt/locMgmtTbl.js @@ -5,7 +5,9 @@ Template.locMgmtTbl.onCreated(function() { }); Template.locMgmtTbl.onRendered(function() { - + Meteor.setTimeout(function() { + $('.tooltipped').tooltip(); + }, 150); }); Template.locMgmtTbl.helpers({ @@ -14,6 +16,22 @@ Template.locMgmtTbl.helpers({ } }); -Template.locMgmtTbl.events([ - -]); \ No newline at end of file +Template.locMgmtTbl.events({ + 'click .deleteLocation' (event) { + event.preventDefault(); + Meteor.call('delete.location', this._id, function(err, result) { + if (err) { + console.log(" ERROR deleting location: " + err); + } else { + console.log(" SUCCESS deleting the location."); + } + }); + }, + 'click .editLocation' (event) { + event.preventDefault(); + Session.set("locEditMode", true); + Session.set("locEditId", this._id); + let locInfo = Locations.findOne({ _id: this._id }); + $("#locNameInp").val(locInfo.locationName); + }, +}); \ No newline at end of file diff --git a/client/AdminMgmt/MgmtPage/mgmtPage.html b/client/AdminMgmt/MgmtPage/mgmtPage.html index 21a1460..df2ad22 100644 --- a/client/AdminMgmt/MgmtPage/mgmtPage.html +++ b/client/AdminMgmt/MgmtPage/mgmtPage.html @@ -4,16 +4,13 @@
    diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtForm.html b/client/AdminMgmt/ProductMgmt/prodMgmtForm.html index 38bce81..355f23a 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtForm.html +++ b/client/AdminMgmt/ProductMgmt/prodMgmtForm.html @@ -1,51 +1,57 @@