Updated menus to work better with list item linking

Lots of changes made (almost a refactor <--- four letter word to me...
- Menu Items collection is now the "permanent" storage location for menu item for any day.  So, if i set Green Chile Chicken Enchiladas, Beans, and Rice as an item for a day, it will be stored as a Menu Item for later use.
- Linking menu items to items that can be added to a shopping list - This has been updated to be more reusable. So as you re-choose a menu item that's already got list items linked, it just shows up for you to use to build a shopping list as needed.
- Deleting menu items from a menu - changed to delete them only from the menu, and not from the database.
- Dashboard updated to pull today's menu item from the menu, and not the menu item list.
This commit is contained in:
Brian McGonagill 2024-08-14 11:38:13 -05:00
parent 3f6618d906
commit 88fa7c1d22
13 changed files with 216 additions and 149 deletions

View file

@ -41,9 +41,13 @@
<div class="card-content white-text">
<span class="card-title"><h4>{{todayDate}}</h4></span>
{{#each todayMenuItem}}
<div class="row">
<div class="col s12"><h4><i class="medium material-icons">local_dining</i> <span class="right">{{itemName}}</span></h4></div>
</div>
{{#each menuItems}}
{{#if $eq todayDate serveDate}}
<div class="row">
<div class="col s12"><h4><i class="medium material-icons">local_dining</i> <span class="right">{{menuItemName}}</span></h4></div>
</div>
{{/if}}
{{/each}}
{{else}}
<div class="row">
<div class="col s12"><h4><i class="medium material-icons">local_dining</i><span clas="right">No Menu Today</span></h4></div>
@ -71,4 +75,4 @@
</div>
{{/if}}
</div>
</template>
</template>

View file

@ -14,7 +14,7 @@ Template.dashboard.onCreated(function() {
this.subscribe("storeInfo");
this.subscribe("myProducts");
this.subscribe("myLocations");
this.subscribe("myMenus");
// this.subscribe("myMenus");
this.subscribe("todayMenuItems");
this.subscribe("myTasks");
});
@ -47,7 +47,9 @@ Template.dashboard.helpers({
return TaskItems.find({ isComplete: false, taskDate: today });
},
todayMenuItem: function() {
return MenuItems.find({});
let myMenus = Menus.find({}).fetch();
console.dir(myMenus);
return myMenus;
},
todayDate: function() {
let now = new Date();
@ -110,4 +112,4 @@ Template.dashboard.events({
break;
}
}
});
});