mvn projekt erstellt, backend ist projekt root

This commit is contained in:
Technoir committed 2026-10-02 15:02:34 +02:00
1 parent 5a56892f32
commit faf1933147
10 files changed
+210

No files matched your search

@@ -0,0 +1,13 @@
package de.timaldinger.einkaufsliste;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class EinkaufslisteApplication {
public static void main(String[] args) {
SpringApplication.run(EinkaufslisteApplication.class, args);
}
}
@@ -0,0 +1 @@
spring.application.name=einkaufsliste
@@ -0,0 +1 @@
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=class{constructor(e,t,n){this.itemName=e,this.itemAmount=t,this.isEditing=!1,this.isDone=!1,this.remove=!1,this.onChange=n}render(){let e;return e=this.isEditing?this.#e():this.#t(),e}#e(){let e=document.createElement(`li`),t=document.createElement(`form`),n=document.createElement(`input`),r=document.createElement(`input`),i=document.createElement(`button`),a=document.createElement(`button`);return n.setAttribute(`name`,`newItemName`),n.setAttribute(`value`,this.itemName),r.setAttribute(`itemName`,`newItemAmount`),r.setAttribute(`value`,this.itemAmount),a.textContent=`Abbrechen`,a.addEventListener(`click`,e=>{e.preventDefault(),this.isEditing=!1,this.onChange()}),i.textContent=`Speichern`,t.addEventListener(`submit`,e=>{e.preventDefault();let n=Object.fromEntries(new FormData(t));(n.newItemName||n.newItemAmount)&&(this.itemName=n.newItemName,this.itemAmount=n.newItemAmount,this.isEditing=!1,this.onChange())}),t.appendChild(n),t.appendChild(r),t.appendChild(i),t.appendChild(a),e.appendChild(t),e}#t(){let e=document.createElement(`li`),t=document.createElement(`span`),n=document.createElement(`button`),r=document.createElement(`input`);return r.setAttribute(`type`,`checkbox`),r.addEventListener(`change`,()=>{this.isDone=!0,e.classList.toggle(`displayedList__item--checked`)}),t.addEventListener(`click`,()=>{this.isEditing=!0,this.onChange()}),n.textContent=`Löschen`,n.addEventListener(`click`,()=>{this.remove=!0,this.onChange()}),t.textContent=this.itemName+` `+this.itemAmount,e.appendChild(r),e.appendChild(t),e.appendChild(n),e}},t=class{constructor(e,t,n){this.categoryName=e,this.itemsInCategory=[],this.remove=!1,this.isEditing=!1,this.onDelete=t,this.onUpdate=n}render(){let e,t=document.createElement(`li`);return e=this.isEditing?this.#e():this.#t(),t.append(e),t}#e(){let e=document.createElement(`form`),t=document.createElement(`input`),n=document.createElement(`button`),r=document.createElement(`button`);return t.setAttribute(`name`,`newCategoryName`),t.setAttribute(`value`,this.categoryName),r.textContent=`Abbrechen`,r.addEventListener(`click`,e=>{e.preventDefault(),this.isEditing=!1,this.onUpdate()}),n.textContent=`Speichern`,e.addEventListener(`submit`,t=>{t.preventDefault();let n=Object.fromEntries(new FormData(e));n.newCategoryName&&(this.categoryName=n.newCategoryName,this.isEditing=!1,this.onUpdate(),this.onDelete())}),e.appendChild(t),e.appendChild(n),e.appendChild(r),e}#t(){let e=document.createElement(`span`),t=document.createElement(`button`),n=document.createElement(`input`),r=document.createElement(`span`),i=document.createElement(`ul`),a=this.itemsInCategory.filter(e=>!e.remove);return e.textContent=this.categoryName,e.classList.add(`category__name--big`,`category__name--bold`),e.addEventListener(`click`,()=>{this.isEditing=!0,this.onUpdate()}),n.setAttribute(`type`,`checkbox`),r.textContent=`Alle Gegenstände in dieser Kategorie löschen? :`,t.textContent=`Löschen`,t.addEventListener(`click`,()=>{this.remove=!0,n.checked||this.itemsInCategory.forEach(e=>{c(e.itemName,e.itemAmount,``)}),this.onUpdate(),this.onDelete()}),i.appendChild(e),i.appendChild(t),i.appendChild(r),i.appendChild(n),a.forEach((e,t)=>{i.append(e.render())}),i}addItem(e){this.itemsInCategory.push(e)}},n=document.querySelector(`.addItemForm`),r=document.querySelector(`.addCategoryForm`),i=document.querySelector(`.displayedList`),a=document.querySelector(`.deleteAllDoneItemsButton`),o=[];function s(e){return o.push(new t(e,d,l)),l(),0}function c(n,r,i){return i?(i=o.find(e=>e instanceof t&&e.categoryName==i),i.addItem(new e(n,r,l))):o.push(new e(n,r,l)),l(),0}function l(){o=o.filter(e=>!e.remove),i.innerHTML=``,o.forEach((e,t)=>{i.appendChild(e.render(t))})}function u(){o.forEach((e,n)=>{e instanceof t&&(e.itemsInCategory=e.itemsInCategory.filter(e=>!e.isDone))}),o=o.filter(e=>!e.isDone),l()}function d(){let e=document.querySelector(`.addItemForm__categorySelect`),n=o.filter(e=>e instanceof t),r=document.createElement(`option`);r.setAttribute(`value`,``),r.selected=!0,r.textContent=`Keine`,e.innerHTML=``,e.appendChild(r),n.forEach(t=>{let n=document.createElement(`option`);n.setAttribute(`value`,t.categoryName),n.textContent=t.categoryName,e.appendChild(n)})}function f(){d(),n.addEventListener(`submit`,e=>{if(!n.checkValidity())return;e.preventDefault();let tLine truncated
@@ -0,0 +1 @@
li.displayedList__item--checked{text-decoration:line-through}.category__name--big{font-size:2rem;font-weight:700}
+12
View File
@@ -0,0 +1,12 @@
li.displayedList__item--checked{
text-decoration: line-through;
}
.category__name--big{
font-weight: bold;
}
.category__name--big{
font-size: 2rem;
}
+39
View File
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Einkaufsliste</title>
<script type="module" crossorigin src="/assets/index-DaqKi9ke.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Dk1Kzh8u.css">
</head>
<body>
<div class="title">
<h1>Einkaufsliste</h1>
</div>
<div class="list">
<form class="addCategoryForm">
<span>Neue Kategorie hinzufügen:</span>
<input type="text" class="addCategoryForm__nameInput" name="categoryName" placeholder="Neue Kategorie hinzufügen...">
<button class="addCategoryForm__submitButton" type="submit">Hinzufügen</button>
</form>
<br>
<form class="addItemForm">
<span>Neuen Gegenstand hinzufügen:</span>
<input type="text" class="addItemForm__nameInput" name="itemName" placeholder="Gegenstand eingeben...">
<input type="text" class="addItemForm__amountInput" name="itemAmount" placeholder="Menge eingeben...">
<select class="addItemForm__categorySelect" name="itemCategory">
</select>
<button class="addItemForm__submitButton" type="submit">Hinzufügen</button>
</form>
<button type="" class="deleteAllDoneItemsButton">Alle fertigen Items löschen</button>
<ul class="displayedList">
</ul>
</div>
</body>
</html>
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>niggas</title>
</head>
<body>
</body>
</html>
@@ -0,0 +1,13 @@
package de.timaldinger.einkaufsliste;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class EinkaufslisteApplicationTests {
@Test
void contextLoads() {
}
}