first commit

main
Samuel Zielke 7 months ago
commit c673e45097

23
.gitignore vendored

@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
*/node_modules/
*/.pnp
*.pnp.js
# testing
*/coverage
# production
*/build
# misc
*/.DS_Store
*/.env.local
*/.env.development.local
*/.env.test.local
*/.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

Binary file not shown.

@ -0,0 +1,34 @@
const Database = require('better-sqlite3');
const db = new Database('db.sqlite3');
// Tabellen erstellen
db.exec(`
CREATE TABLE IF NOT EXISTS abwesenheiten (
id INTEGER PRIMARY KEY AUTOINCREMENT,
datum TEXT NOT NULL,
start TEXT NOT NULL,
ende TEXT NOT NULL,
titel TEXT
);
CREATE TABLE IF NOT EXISTS zeitslots (
id INTEGER PRIMARY KEY AUTOINCREMENT,
datum TEXT NOT NULL,
start TEXT NOT NULL,
ende TEXT NOT NULL,
titel TEXT,
farbe TEXT
);
CREATE TABLE IF NOT EXISTS startzeiten (
datum TEXT PRIMARY KEY,
zeit TEXT
);
CREATE TABLE IF NOT EXISTS endzeiten (
datum TEXT PRIMARY KEY,
zeit TEXT
);
`);
console.log("Datenbank initialisiert.");

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -0,0 +1,17 @@
{
"name": "backend",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"better-sqlite3": "^11.10.0",
"cors": "^2.8.5",
"express": "^5.1.0"
}
}

@ -0,0 +1,144 @@
const express = require("express");
const cors = require("cors");
const Database = require("better-sqlite3");
const db = new Database("db.sqlite3");
db.exec(`
CREATE TABLE IF NOT EXISTS startzeiten (
datum TEXT PRIMARY KEY,
zeit TEXT
);
CREATE TABLE IF NOT EXISTS endzeiten (
datum TEXT PRIMARY KEY,
zeit TEXT
);
`);
const app = express();
app.use(cors());
app.use(express.json());
app.get("/api/data/:datum", (req, res) => {
const datum = req.params.datum;
const startzeitRow = db.prepare("SELECT zeit FROM startzeiten WHERE datum = ?").get(datum);
const startzeit = startzeitRow ? startzeitRow.zeit : "05:00";
const endzeitRow = db.prepare("SELECT zeit FROM endzeiten WHERE datum = ?").get(datum);
const endzeit = endzeitRow ? endzeitRow.zeit : "21:00";
const abwesenheiten = db.prepare("SELECT * FROM abwesenheiten WHERE datum = ?").all(datum);
const zeitslots = db.prepare("SELECT * FROM zeitslots WHERE datum = ?").all(datum);
const startTotalMin = parseInt(startzeit.split(":")[0]) * 60 + parseInt(startzeit.split(":")[1]);
const endTotalMin = parseInt(endzeit.split(":")[0]) * 60 + parseInt(endzeit.split(":")[1]);
const gefilterteSlots = zeitslots.filter(z => {
const startMin = parseInt(z.start.split(":")[0]) * 60 + parseInt(z.start.split(":")[1]);
const endMin = parseInt(z.ende.split(":")[0]) * 60 + parseInt(z.ende.split(":")[1]);
return startMin >= startTotalMin && endMin <= endTotalMin;
});
res.json({ abwesenheiten, zeitslots: gefilterteSlots, startzeit, endzeit });
});
app.post("/api/abwesenheit", (req, res) => {
const { datum, titel, start, ende } = req.body;
if (!datum || !titel || !start || !ende) {
return res.status(400).json({ error: "Fehlende Angaben" });
}
const id = Date.now().toString();
const stmt = db.prepare("INSERT INTO abwesenheiten (id, datum, titel, start, ende) VALUES (?, ?, ?, ?, ?)");
stmt.run(id, datum, titel, start, ende);
const abwesenheit = { id, datum, titel, start, ende };
res.status(201).json(abwesenheit);
});
app.put("/api/abwesenheit/:id", (req, res) => {
const id = req.params.id;
const existing = db.prepare("SELECT * FROM abwesenheiten WHERE id = ?").get(id);
if (!existing) {
return res.status(404).json({ error: "Abwesenheit nicht gefunden" });
}
const { datum = existing.datum, grund = existing.grund, von = existing.von, bis = existing.bis } = req.body;
const stmt = db.prepare("UPDATE abwesenheiten SET datum = ?, grund = ?, von = ?, bis = ? WHERE id = ?");
stmt.run(datum, grund, von, bis, id);
const updated = db.prepare("SELECT * FROM abwesenheiten WHERE id = ?").get(id);
res.json(updated);
});
app.delete("/api/abwesenheit/:id", (req, res) => {
const id = req.params.id;
const stmt = db.prepare("DELETE FROM abwesenheiten WHERE id = ?");
const info = stmt.run(id);
if (info.changes === 0) {
res.status(404).json({ error: "Abwesenheit nicht gefunden" });
} else {
res.status(204).end();
}
});
app.post("/api/zeitslot", (req, res) => {
const { datum, start, ende, titel, farbe } = req.body;
if (!datum || !start || !ende || !titel) {
return res.status(400).json({ error: "Fehlende Angaben" });
}
const id = Date.now().toString();
const stmt = db.prepare("INSERT INTO zeitslots (id, datum, start, ende, titel, farbe) VALUES (?, ?, ?, ?, ?, ?)");
stmt.run(id, datum, start, ende, titel, farbe);
const zeitslot = { id, datum, start, ende, titel, farbe };
res.status(201).json(zeitslot);
});
app.put("/api/zeitslot/:id", (req, res) => {
const id = req.params.id;
const existing = db.prepare("SELECT * FROM zeitslots WHERE id = ?").get(id);
if (!existing) {
return res.status(404).json({ error: "Zeitslot nicht gefunden" });
}
const { datum = existing.datum, start = existing.start, ende = existing.ende, titel = existing.titel, farbe = existing.farbe } = req.body;
const stmt = db.prepare("UPDATE zeitslots SET datum = ?, start = ?, ende = ?, titel = ?, farbe = ? WHERE id = ?");
stmt.run(datum, start, ende, titel, farbe, id);
const updated = db.prepare("SELECT * FROM zeitslots WHERE id = ?").get(id);
res.json(updated);
});
app.delete("/api/zeitslot/:id", (req, res) => {
const id = req.params.id;
const stmt = db.prepare("DELETE FROM zeitslots WHERE id = ?");
const info = stmt.run(id);
if (info.changes === 0) {
res.status(404).json({ error: "Zeitslot nicht gefunden" });
} else {
res.status(204).end();
}
});
app.post("/api/startzeit", (req, res) => {
const { datum, zeit } = req.body;
if (datum && zeit) {
const stmt = db.prepare("INSERT INTO startzeiten (datum, zeit) VALUES (?, ?) ON CONFLICT(datum) DO UPDATE SET zeit=excluded.zeit");
stmt.run(datum, zeit);
res.json({ datum, zeit });
} else {
res.status(400).json({ error: "Fehlende Angaben" });
}
});
app.post("/api/endzeit", (req, res) => {
const { datum, zeit } = req.body;
if (datum && zeit) {
const stmt = db.prepare("INSERT INTO endzeiten (datum, zeit) VALUES (?, ?) ON CONFLICT(datum) DO UPDATE SET zeit=excluded.zeit");
stmt.run(datum, zeit);
res.json({ datum, zeit });
} else {
res.status(400).json({ error: "Fehlende Angaben" });
}
});
const PORT = process.env.PORT || 3001;
app.listen(PORT, () => {
console.log(`Server läuft auf Port ${PORT}`);
});

@ -0,0 +1,70 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
The page will reload when you make changes.\
You may also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

File diff suppressed because it is too large Load Diff

@ -0,0 +1,39 @@
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^13.5.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

@ -0,0 +1,38 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@ -0,0 +1,902 @@
import React, { useEffect, useState, useRef } from "react";
function App() {
const [datum, setDatum] = useState("2025-05-14");
const [data, setData] = useState({ abwesenheiten: [], zeitslots: [] });
const [startzeit, setStartzeit] = useState(null);
const [endzeit, setEndzeit] = useState(null);
const [manualEndzeit, setManualEndzeit] = useState("");
const [showEndzeitInput, setShowEndzeitInput] = useState(false);
// Gemeinsames Formular für neue Einträge
const [showForm, setShowForm] = useState(false);
const [isAbwesenheit, setIsAbwesenheit] = useState(true);
const [newEntry, setNewEntry] = useState({ titel: "", start: "", ende: "", farbe: "#ccffcc" });
// Ref für das neue Eintragsformular (Hülle)
const newEntryRef = useRef(null);
// Ref für das Texteingabefeld im neuen Eintrag
const newEntryInputRef = useRef(null);
// Fokussieren des neuen Eintragsformulars und Scrollen bei Anzeige
useEffect(() => {
if (showForm && newEntryInputRef.current) {
newEntryInputRef.current.focus();
newEntryInputRef.current.scrollIntoView({ behavior: "smooth", block: "center" });
}
}, [showForm]);
const [editAbwesenheitId, setEditAbwesenheitId] = useState(null);
const [editZeitslotId, setEditZeitslotId] = useState(null);
const [editForm, setEditForm] = useState({ titel: "", start: "", ende: "" });
const zeitachseRef = useRef(null);
const [pixelsPerMinute, setPixelsPerMinute] = useState(1);
const [manualStartzeit, setManualStartzeit] = useState("");
const [showStartzeitInput, setShowStartzeitInput] = useState(false);
useEffect(() => {
setPixelsPerMinute(1);
}, []);
const startEdit = (eintrag, typ) => {
setEditForm({ titel: eintrag.titel, start: eintrag.start, ende: eintrag.ende });
if (typ === "abwesenheit") setEditAbwesenheitId(eintrag.id);
if (typ === "zeitslot") setEditZeitslotId(eintrag.id);
};
// Speichern-Funktionen für Edit und Neu
const handleSaveEdit = async (typ) => {
const url =
typ === "abwesenheit"
? `http://localhost:3001/api/abwesenheit/${editAbwesenheitId}`
: `http://localhost:3001/api/zeitslot/${editZeitslotId}`;
await fetch(url, {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(editForm),
});
setEditAbwesenheitId(null);
setEditZeitslotId(null);
setEditForm({ titel: "", start: "", ende: "" });
reloadData();
};
const handleSaveNew = async () => {
const endpoint = isAbwesenheit ? "abwesenheit" : "zeitslot";
await fetch(`http://localhost:3001/api/${endpoint}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ datum, ...newEntry }),
});
setNewEntry({ titel: "", start: "", ende: "", farbe: "#ccffcc" });
setShowForm(false);
reloadData();
};
const deleteEntry = async (id, typ) => {
const url = `http://localhost:3001/api/${typ}/${id}`;
await fetch(url, { method: "DELETE" });
reloadData();
if (typ === "abwesenheit") setEditAbwesenheitId(null);
else setEditZeitslotId(null);
};
// Daten laden
useEffect(() => {
fetch(`http://localhost:3001/api/data/${datum}`)
.then((res) => res.json())
.then((data) => {
setData(data);
setStartzeit(data.startzeit);
setEndzeit(data.endzeit);
});
}, [datum]);
const reloadData = () => {
fetch(`http://localhost:3001/api/data/${datum}`)
.then((res) => res.json())
.then((data) => {
setData(data);
setStartzeit(data.startzeit);
setEndzeit(data.endzeit);
});
};
const beginSetEndzeit = () => {
const now = new Date();
const h = String(now.getHours()).padStart(2, "0");
const m = String(Math.floor(now.getMinutes() / 15) * 15).padStart(2, "0");
setManualEndzeit(`${h}:${m}`);
setShowEndzeitInput(true);
};
const saveManualEndzeit = async () => {
await fetch("http://localhost:3001/api/endzeit", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ datum, zeit: manualEndzeit }),
});
setShowEndzeitInput(false);
reloadData();
};
const beginSetStartzeit = () => {
const now = new Date();
const h = String(now.getHours()).padStart(2, "0");
const m = String(Math.floor(now.getMinutes() / 15) * 15).padStart(2, "0");
setManualStartzeit(`${h}:${m}`);
setShowStartzeitInput(true);
};
const saveManualStartzeit = async () => {
await fetch("http://localhost:3001/api/startzeit", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ datum, zeit: manualStartzeit }),
});
setShowStartzeitInput(false);
reloadData();
};
return (
<div style={{ padding: "2rem", fontFamily: "sans-serif" }}>
<div style={{ marginBottom: "1rem" }}>
<h1 style={{ fontSize: "2.5rem", fontWeight: "lighter", margin: 0 }}>
<span style={{ color: "#333" }}>My</span>
<span style={{ color: "#007acc" }}>Day</span>
</h1>
<div style={{ fontSize: "1.3rem", color: "#666" }}>
{new Date(datum).toLocaleDateString("de-DE", {
day: "2-digit",
month: "long",
year: "2-digit",
})}
</div>
</div>
<button onClick={() => {
const d = new Date(datum);
d.setDate(d.getDate() - 1);
setDatum(d.toISOString().split("T")[0]);
}} style={{ marginRight: "0.5rem" }}></button>
<input type="date" value={datum} onChange={(e) => setDatum(e.target.value)} />
<button onClick={() => {
const d = new Date(datum);
d.setDate(d.getDate() + 1);
setDatum(d.toISOString().split("T")[0]);
}} style={{ marginLeft: "0.5rem" }}></button>
{!showStartzeitInput ? (
<button onClick={beginSetStartzeit} style={{ marginLeft: "1rem" }}>
Startzeit setzen
</button>
) : (
<span style={{ marginLeft: "1rem" }}>
<input
type="time"
value={manualStartzeit}
onChange={(e) => setManualStartzeit(e.target.value)}
/>
<button onClick={saveManualStartzeit}>Speichern</button>
</span>
)}
{/* Endzeit Button und Eingabefeld */}
{!showEndzeitInput ? (
<button onClick={beginSetEndzeit} style={{ marginLeft: "1rem" }}>
Endzeit setzen
</button>
) : (
<span style={{ marginLeft: "1rem" }}>
<input
type="time"
value={manualEndzeit}
onChange={(e) => setManualEndzeit(e.target.value)}
/>
<button onClick={saveManualEndzeit}>Speichern</button>
</span>
)}
<button
onClick={() => {
const now = new Date();
now.setMinutes(Math.ceil(now.getMinutes() / 15) * 15);
const h = String(now.getHours()).padStart(2, "0");
const m = String(now.getMinutes()).padStart(2, "0");
const start = `${h}:${m}`;
const endDate = new Date(now.getTime() + 30 * 60000);
const eh = String(endDate.getHours()).padStart(2, "0");
const em = String(endDate.getMinutes()).padStart(2, "0");
const ende = `${eh}:${em}`;
setIsAbwesenheit(false);
setNewEntry({ titel: "", start, ende });
setShowForm(true);
}}
style={{ marginLeft: "1rem" }}
>
Eintrag hinzufügen
</button>
<div style={{ display: "grid", gridTemplateColumns: "1fr 60px 1fr", marginTop: "2rem" }}>
{/* Abwesenheiten */}
<div
style={{ padding: "1rem", borderRight: "1px solid #ccc", position: "relative" }}
onClick={(e) => {
if (e.target.closest('[data-entry]') || e.target.closest('[data-form]')) return;
const containerTop = e.currentTarget.getBoundingClientRect().top;
const clickY = e.clientY - containerTop;
const rawMin = Math.floor(clickY / pixelsPerMinute + 300 - 24);
const clickedMin = Math.round(rawMin / 15) * 15;
const startH = String(Math.floor(clickedMin / 60)).padStart(2, "0");
const startM = String(clickedMin % 60).padStart(2, "0");
const endMin = clickedMin + 30;
const endH = String(Math.floor(endMin / 60)).padStart(2, "0");
const endM = String(endMin % 60).padStart(2, "0");
setIsAbwesenheit(true);
setNewEntry({ titel: "", start: `${startH}:${startM}`, ende: `${endH}:${endM}` });
setShowForm(true);
}}
>
{data.abwesenheiten.map((a) => {
const startParts = a.start.split(":");
const startMin = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
if (editAbwesenheitId === a.id) {
return (
<div
key={a.id}
data-entry
style={{ background: "#ffe5e5", padding: "0.5rem", margin: "0.5rem 0" }}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === "Enter") handleSaveEdit("abwesenheit");
if (e.key === "Escape") {
setEditAbwesenheitId(null);
setEditForm({ titel: "", start: "", ende: "" });
}
}}
>
<input
type="text"
value={editForm.titel}
onChange={(e) => setEditForm({ ...editForm, titel: e.target.value })}
/>
<br />
<input
type="time"
value={editForm.start}
onChange={(e) => setEditForm({ ...editForm, start: e.target.value })}
/>
<input
type="time"
value={editForm.ende}
onChange={(e) => setEditForm({ ...editForm, ende: e.target.value })}
/>
<br />
<button onClick={() => handleSaveEdit("abwesenheit")}>Speichern</button>
<button onClick={() => deleteEntry(a.id, "abwesenheit")}>Löschen</button>
</div>
);
}
const endParts = a.ende.split(":");
const endMin = parseInt(endParts[0]) * 60 + parseInt(endParts[1]);
const top = (startMin - 300 + 24) * pixelsPerMinute; // 5:00 = 300 min, +24 min Offset
const height = (endMin - startMin) * pixelsPerMinute;
return (
<div
key={a.id}
data-entry
title={`${a.titel} (${a.start}${a.ende})`}
style={{
position: "absolute",
top: `${top}px`,
height: `${height}px`,
left: 0,
right: 0,
background: "#ffcccc",
boxShadow: "inset 0 0 0 2px #999",
boxSizing: "border-box",
padding: "0.25rem",
margin: "0.1rem",
cursor: "pointer",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
fontSize: height < 20 ? "0.6rem" : "0.8rem",
lineHeight: "1.2"
}}
onClick={() => startEdit(a, "abwesenheit")}
>
<strong>{a.titel}</strong> {a.start}{a.ende} ({height / pixelsPerMinute > 120
? `${(height / pixelsPerMinute / 60).toFixed(1)} Std`
: `${height / pixelsPerMinute} Min`})
</div>
);
})}
{/* Formular für neuen Eintrag in Abwesenheiten-Spalte anzeigen, nur wenn isAbwesenheit === true */}
{showForm && isAbwesenheit && newEntry.start && (() => {
const startParts = newEntry.start.split(":");
const startMin = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
const top = (startMin - 300 + 24) * pixelsPerMinute;
return (
<div
ref={newEntryRef}
data-form
tabIndex={0}
onKeyDown={(e) => {
if (e.key === "Enter") {
handleSaveNew();
}
if (e.key === "Escape") {
setShowForm(false);
setNewEntry({ titel: "", start: "", ende: "" });
}
}}
style={{
position: "absolute",
top: `${top}px`,
height: "60px",
minHeight: "60px",
left: 0,
right: 0,
background: "#ffe5e5",
boxShadow: "inset 0 0 0 2px #999",
boxSizing: "border-box",
padding: "0.25rem",
zIndex: 5
}}
>
<input
ref={newEntryInputRef}
autoFocus
type="text"
placeholder="Titel"
value={newEntry.titel}
onChange={(e) => setNewEntry({ ...newEntry, titel: e.target.value })}
/>
<br />
<input
type="time"
value={newEntry.start}
onChange={(e) => setNewEntry({ ...newEntry, start: e.target.value })}
/>
<input
type="time"
value={newEntry.ende}
onChange={(e) => setNewEntry({ ...newEntry, ende: e.target.value })}
/>
<br />
<button onClick={handleSaveNew}>Speichern</button>
</div>
);
})()}
</div>
{/* Zeitachse */}
<div
ref={zeitachseRef}
style={{
height: "1020px",
padding: "1rem",
borderLeft: "1px solid #aaa",
borderRight: "1px solid #aaa",
textAlign: "right",
position: "relative"
}}
>
{Array.from({ length: 17 }, (_, i) => {
const hour = i + 5;
return (
<div key={hour} style={{ height: "60px", fontSize: "12px", color: "#666" }}>
{hour}:00
</div>
);
})}
</div>
{/* Zeitslots */}
<div ref={zeitachseRef} style={{ padding: "1rem", position: "relative", height: "100%" }}>
{/* Abwesenheiten als Sperrflächen */}
{data.abwesenheiten.map((a) => {
const startParts = a.start.split(":");
const endParts = a.ende.split(":");
const startMin = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
const endMin = parseInt(endParts[0]) * 60 + parseInt(endParts[1]);
const top = (startMin - 300 + 24) * pixelsPerMinute;
const height = (endMin - startMin) * pixelsPerMinute;
return (
<div
key={`sperre-${a.id}`}
style={{
position: "absolute",
top: `${top}px`,
height: `${height}px`,
left: 0,
right: 0,
background: "rgba(255, 200, 200, 0.4)",
pointerEvents: "none",
zIndex: 1,
}}
/>
);
})}
{(() => {
const today = new Date().toISOString().split("T")[0];
if (datum !== today) return null;
const now = new Date();
const nowMin = now.getHours() * 60 + now.getMinutes();
if (nowMin < 300 || nowMin > 1260) return null; // außerhalb des sichtbaren Zeitbereichs
const top = (nowMin - 300 + 24) * pixelsPerMinute;
return (
<div
style={{
position: "absolute",
top: `${top}px`,
left: 0,
right: 0,
height: "2px",
backgroundColor: "lightblue",
zIndex: 10
}}
/>
);
})()}
{startzeit && (() => {
const startzeitMin = parseInt(startzeit.split(":")[0]) * 60 + parseInt(startzeit.split(":")[1]);
const startzeitTop = (startzeitMin - 300 + 24) * pixelsPerMinute;
const top = 0;
const height = startzeitTop;
return (
<div
style={{
position: "absolute",
top: `${top}px`,
height: `${height}px`,
left: 0,
right: 0,
background: "#eee",
borderBottom: "2px solid red",
boxSizing: "border-box",
}}
/>
);
})()}
{endzeit && (() => {
const endzeitMin = parseInt(endzeit.split(":")[0]) * 60 + parseInt(endzeit.split(":")[1]);
const endzeitTop = (endzeitMin - 300 + 24) * pixelsPerMinute;
const bottomMin = 1260; // 21:00 Uhr
const height = (bottomMin - endzeitMin) * pixelsPerMinute;
return (
<div
style={{
position: "absolute",
top: `${endzeitTop}px`,
height: `${height}px`,
left: 0,
right: 0,
background: "#eee",
borderTop: "2px solid red",
boxSizing: "border-box",
}}
/>
);
})()}
{data.zeitslots
.sort((a, b) => {
const aStart = parseInt(a.start.split(":")[0]) * 60 + parseInt(a.start.split(":")[1]);
const bStart = parseInt(b.start.split(":")[0]) * 60 + parseInt(b.start.split(":")[1]);
return aStart - bStart;
})
.flatMap((z, index, arr) => {
const startParts = z.start.split(":");
const endParts = z.ende.split(":");
const startMin = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
const endMin = parseInt(endParts[0]) * 60 + parseInt(endParts[1]);
const startTotalMin = parseInt(startzeit?.split(":")[0]) * 60 + parseInt(startzeit?.split(":")[1]);
const endTotalMin = parseInt(endzeit?.split(":")[0]) * 60 + parseInt(endzeit?.split(":")[1]);
if (startMin < startTotalMin || endMin > endTotalMin) return [];
const top = (startMin - 300 + 24) * pixelsPerMinute;
const height = (endMin - startMin) * pixelsPerMinute;
if (editZeitslotId === z.id) {
// Edit-Modus: Formular an exakter Slot-Position anzeigen
return [
<div
key={z.id}
style={{
position: "absolute",
top: `${top}px`,
height: `${height}px`,
minHeight: "60px",
left: 0,
right: 0,
background: editForm.farbe || "#e5ffe5",
boxShadow: "inset 0 0 0 2px #999",
boxSizing: "border-box",
padding: "0.25rem",
margin: "0.1rem",
fontSize: height < 20 ? "0.6rem" : "0.8rem",
lineHeight: "1.2",
overflow: "auto",
zIndex: 5
}}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === "Enter") handleSaveEdit("zeitslot");
if (e.key === "Escape") {
setEditZeitslotId(null);
setEditForm({ titel: "", start: "", ende: "" });
}
}}
>
<input
type="text"
value={editForm.titel}
onChange={(e) => setEditForm({ ...editForm, titel: e.target.value })}
/>
<br />
<input
type="time"
value={editForm.start}
onChange={(e) => setEditForm({ ...editForm, start: e.target.value })}
/>
<input
type="time"
value={editForm.ende}
onChange={(e) => setEditForm({ ...editForm, ende: e.target.value })}
/>
<div style={{ marginTop: "0.5rem" }}>
<button
onClick={() => setEditForm({ ...editForm, farbe: "#ccffcc" })}
style={{
background: z.farbe || "#ccffcc",
border: "1px solid #999",
marginRight: "0.5rem",
width: "20px",
height: "20px",
cursor: "pointer"
}}
/>
<button
onClick={() => setEditForm({ ...editForm, farbe: "#ccccff" })}
style={{
background: "#ccccff",
border: "1px solid #999",
width: "20px",
height: "20px",
cursor: "pointer"
}}
/>
</div>
<br />
<button onClick={() => handleSaveEdit("zeitslot")}>Speichern</button>
<button onClick={() => deleteEntry(z.id, "zeitslot")}>Löschen</button>
</div>
];
}
const entry = (
<div
key={z.id}
title={`${z.titel} (${z.start}${z.ende})`}
style={{
position: "absolute",
top: `${top}px`,
height: `${height}px`,
left: 0,
right: 0,
background: z.farbe || "#ccffcc",
boxShadow: "inset 0 0 0 2px #999",
boxSizing: "border-box",
padding: "0.25rem",
margin: "0.1rem",
cursor: "pointer",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
fontSize: height < 20 ? "0.6rem" : "0.8rem",
lineHeight: "1.2"
}}
onClick={() => startEdit(z, "zeitslot")}
>
<strong>{z.titel}</strong> {z.start}{z.ende} ({height / pixelsPerMinute > 120
? `${(height / pixelsPerMinute / 60).toFixed(1)} Std`
: `${height / pixelsPerMinute} Min`})
</div>
);
// Block für freie Zeit zwischen Startzeit und erstem Zeitslot
if (index === 0 && startzeit) {
const startzeitMin = parseInt(startzeit.split(":")[0]) * 60 + parseInt(startzeit.split(":")[1]);
const gapStart = startMin - startzeitMin;
if (gapStart > 0) {
const gapTop = (startzeitMin - 300 + 24) * pixelsPerMinute;
const gapHeight = gapStart * pixelsPerMinute;
return [
<div
key={`gap-start-${z.id}`}
style={{
position: "absolute",
top: `${gapTop}px`,
height: `${gapHeight}px`,
left: 0,
right: 0,
textAlign: "center",
fontSize: "0.6rem",
color: "#999",
pointerEvents: "none"
}}
>
{gapStart} Min frei
</div>,
entry
];
}
}
if (index === 0) return [entry];
return [entry];
})}
{/* Freie Zeitblöcke zwischen Sperrbereichen und Zeitslots */}
{(() => {
const combined = [
...data.abwesenheiten.map((a) => ({
id: a.id,
start: a.start,
ende: a.ende,
typ: "sperre"
})),
...data.zeitslots.map((z) => ({
id: z.id,
start: z.start,
ende: z.ende,
typ: "zeitslot"
}))
];
const startzeitMin = parseInt(startzeit?.split(":")[0]) * 60 + parseInt(startzeit?.split(":")[1]);
const endzeitMin = parseInt(endzeit?.split(":")[0]) * 60 + parseInt(endzeit?.split(":")[1]);
const sorted = combined
.map((e) => ({
...e,
startMin: parseInt(e.start.split(":")[0]) * 60 + parseInt(e.start.split(":")[1]),
endMin: parseInt(e.ende.split(":")[0]) * 60 + parseInt(e.ende.split(":")[1])
}))
.filter((e) => e.startMin >= startzeitMin && e.endMin <= endzeitMin)
.sort((a, b) => a.startMin - b.startMin);
const gaps = [];
// Lücke zwischen Startzeit und erstem Eintrag anzeigen
if (sorted.length > 0 && startzeitMin < sorted[0].startMin) {
const first = sorted[0];
const gap = first.startMin - startzeitMin;
if (gap > 0) {
const gapTop = (startzeitMin - 300 + 24) * pixelsPerMinute;
const gapHeight = gap * pixelsPerMinute;
gaps.push(
<div
key={`gap-before-first-${first.id}`}
onClick={() => {
setIsAbwesenheit(false);
setShowForm(true);
const startStunde = String(Math.floor(startzeitMin / 60)).padStart(2, "0");
const startMinute = String(startzeitMin % 60).padStart(2, "0");
const endStunde = String(Math.floor(first.startMin / 60)).padStart(2, "0");
const endMinute = String(first.startMin % 60).padStart(2, "0");
setNewEntry({
titel: "",
start: `${startStunde}:${startMinute}`,
ende: `${endStunde}:${endMinute}`
});
}}
style={{
position: "absolute",
top: `${gapTop}px`,
height: `${gapHeight}px`,
left: 0,
right: 0,
textAlign: "center",
fontSize: "0.6rem",
color: "#999",
pointerEvents: "auto",
zIndex: 2,
cursor: "pointer",
background: "rgba(200, 255, 200, 0.05)"
}}
>
{gap} Min frei
</div>
);
}
}
for (let i = 0; i < sorted.length - 1; i++) {
const curr = sorted[i];
const next = sorted[i + 1];
const gap = next.startMin - curr.endMin;
if (gap > 0) {
const gapTop = (curr.endMin - 300 + 24) * pixelsPerMinute;
const gapHeight = gap * pixelsPerMinute;
gaps.push(
<div
key={`gap-combined-${curr.id}-${next.id}`}
onClick={() => {
setIsAbwesenheit(false);
setShowForm(true);
const startStunde = Math.floor(curr.endMin / 60).toString().padStart(2, "0");
const startMinute = (curr.endMin % 60).toString().padStart(2, "0");
const endStunde = Math.floor(next.startMin / 60).toString().padStart(2, "0");
const endMinute = (next.startMin % 60).toString().padStart(2, "0");
setNewEntry({
titel: "",
start: `${startStunde}:${startMinute}`,
ende: `${endStunde}:${endMinute}`
});
}}
style={{
position: "absolute",
top: `${gapTop}px`,
height: `${gapHeight}px`,
left: 0,
right: 0,
textAlign: "center",
fontSize: "0.6rem",
color: "#999",
pointerEvents: "auto",
zIndex: 2,
cursor: "pointer",
background: "rgba(200, 255, 200, 0.05)"
}}
>
{gap} Min frei
</div>
);
}
}
// Lücke nach dem letzten Eintrag bis zur Endzeit anzeigen
if (sorted.length > 0 && endzeitMin) {
const last = sorted[sorted.length - 1];
const gap = endzeitMin - last.endMin;
if (gap > 0) {
const gapTop = (last.endMin - 300 + 24) * pixelsPerMinute;
const gapHeight = gap * pixelsPerMinute;
gaps.push(
<div
key={`gap-after-last-${last.id}`}
onClick={() => {
setIsAbwesenheit(false);
setShowForm(true);
const startStunde = Math.floor(last.endMin / 60).toString().padStart(2, "0");
const startMinute = (last.endMin % 60).toString().padStart(2, "0");
const endStunde = Math.floor(endzeitMin / 60).toString().padStart(2, "0");
const endMinute = (endzeitMin % 60).toString().padStart(2, "0");
setNewEntry({
titel: "",
start: `${startStunde}:${startMinute}`,
ende: `${endStunde}:${endMinute}`
});
}}
style={{
position: "absolute",
top: `${gapTop}px`,
height: `${gapHeight}px`,
left: 0,
right: 0,
textAlign: "center",
fontSize: "0.6rem",
color: "#999",
pointerEvents: "auto",
zIndex: 2,
cursor: "pointer",
background: "rgba(200, 255, 200, 0.05)"
}}
>
{gap} Min frei
</div>
);
}
}
return gaps;
})()}
{/* Formular für neuen Eintrag an passender Stelle anzeigen (nur wenn isAbwesenheit === false) */}
{showForm && !isAbwesenheit && newEntry.start && (() => {
const startParts = newEntry.start.split(":");
const startMin = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
const top = (startMin - 300 + 24) * pixelsPerMinute;
return (
<div
ref={newEntryRef}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === "Enter") {
handleSaveNew();
}
if (e.key === "Escape") {
setShowForm(false);
setNewEntry({ titel: "", start: "", ende: "", farbe: "#ccffcc" });
}
}}
style={{
position: "absolute",
top: `${top}px`,
height: "60px",
minHeight: "60px",
left: 0,
right: 0,
// background: "#e0f7ff",
background: newEntry.farbe || "#e0f7ff",
boxShadow: "inset 0 0 0 2px #999",
boxSizing: "border-box",
padding: "0.25rem",
zIndex: 5
}}
>
<input
ref={newEntryInputRef}
autoFocus
type="text"
placeholder="Titel"
value={newEntry.titel}
onChange={(e) => setNewEntry({ ...newEntry, titel: e.target.value })}
/>
<br />
<input
type="time"
value={newEntry.start}
onChange={(e) => setNewEntry({ ...newEntry, start: e.target.value })}
/>
<input
type="time"
value={newEntry.ende}
onChange={(e) => setNewEntry({ ...newEntry, ende: e.target.value })}
/>
<div style={{ marginTop: "0.5rem" }}>
<button
onClick={() => setNewEntry({ ...newEntry, farbe: "#ccffcc" })}
style={{
background: "#ccffcc",
border: "1px solid #999",
marginRight: "0.5rem",
width: "20px",
height: "20px",
cursor: "pointer"
}}
/>
<button
onClick={() => setNewEntry({ ...newEntry, farbe: "#ccccff" })}
style={{
background: "#ccccff",
border: "1px solid #999",
width: "20px",
height: "20px",
cursor: "pointer"
}}
/>
</div>
<br />
<button
onClick={handleSaveNew}
>
Speichern
</button>
</div>
);
})()}
</div>
</div>
</div>
);
}
export default App;

@ -0,0 +1,8 @@
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

@ -0,0 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -0,0 +1,13 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;

@ -0,0 +1,5 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
Loading…
Cancel
Save

Powered by TurnKey Linux.