Menu stuff

This commit is contained in:
Elias Jansson
2025-04-29 21:20:06 +02:00
parent 4e1eb05141
commit 3cdf630af2
24 changed files with 880 additions and 230 deletions

View File

@@ -0,0 +1,15 @@
.menu-table {
width: 100%;
border-collapse: collapse;
margin-top: 1em;
}
.menu-table th, .menu-table td {
border: 1px solid #444;
padding: 0.5em;
}
.week-nav {
margin-bottom: 1em;
display: flex;
gap: 1em;
}

View File

@@ -224,3 +224,4 @@ body {
.date-picker-dropdown select:hover {
background-color: #555;
}

View File

@@ -0,0 +1,10 @@
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll(".meal-cell").forEach(cell => {
cell.addEventListener("click", function () {
const name = this.getAttribute("data-name");
const cook = this.getAttribute("data-cook");
alert(`Måltid: ${name}\nLagas av: ${cook}`);
});
});
});

View File

@@ -1,4 +1,4 @@
angular.module('mealMenuApp', [])
angular.module('mealMenuApp', [])
.controller('MealMenuController', function ($scope, $http) {
$scope.isEditing = false;
$scope.toggleEditMode = function () {
@@ -15,7 +15,7 @@ angular.module('mealMenuApp', [])
const today = new Date();
$scope.selectedWeek = getWeek(today);
$scope.selectedYear = today.getFullYear();
$scope.daysOfWeek = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
$scope.daysOfWeek = ["Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "rdag", "Söndag"];
$scope.loadMeals = function () {
$http.get('/api/mealMenuApi/getMeals')
@@ -29,6 +29,8 @@ angular.module('mealMenuApp', [])
$http.get('/api/mealMenuApi/menu', {
params: { weekNumber: $scope.selectedWeek, year: $scope.selectedYear }
}).then(response => {
console.log("Veckomenydata:", response.data); // ✅ logga ut
$scope.menu = {};
response.data.forEach(item => {
const dayOfWeek = $scope.daysOfWeek[item.dayOfWeek - 1];

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB