Menu stuff
This commit is contained in:
15
Aberwyn/wwwroot/css/menu-style.css
Normal file
15
Aberwyn/wwwroot/css/menu-style.css
Normal 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;
|
||||
}
|
||||
@@ -224,3 +224,4 @@ body {
|
||||
.date-picker-dropdown select:hover {
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
|
||||
10
Aberwyn/wwwroot/js/meal-menu.js
Normal file
10
Aberwyn/wwwroot/js/meal-menu.js
Normal 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}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -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", "Lö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];
|
||||
|
||||
BIN
Aberwyn/wwwroot/uploads/fc8aff8c-4bef-45a8-9e40-7b78f76f04e8.png
Normal file
BIN
Aberwyn/wwwroot/uploads/fc8aff8c-4bef-45a8-9e40-7b78f76f04e8.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user