diff --git a/README.md b/README.md index 8559d8f..0c72ebf 100644 --- a/README.md +++ b/README.md @@ -233,4 +233,4 @@ Das Projekt basiert auf bewährten Web-Standards: * **Features:** * **Notizen:** Neue Funktion "Notizen" hinzugefügt inkl. Rich-Text-Editor. * **Haushaltsfreigabe:** Notizen können mit dem Haushalt geteilt werden. - * **Design-Update:** Die Notizen-Übersichtsseite nutzt nun eine Split-View (Liste links, Inhalt rechts). + * **Design-Update:** Die Notizen-Übersichtsseite wurde an das Design der ToDo-Listen angepasst (Split-View, List-Groups, weiße Notizhintergründe). Der Texteditor bietet nun deutsche Tooltips. Beim Speichern einer Notiz wird nun besser zurück in die Übersicht navigiert. diff --git a/src/add_note.php b/src/add_note.php index 0ccfa2b..c09db95 100644 --- a/src/add_note.php +++ b/src/add_note.php @@ -27,7 +27,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $stmt->bind_param("iissi", $current_user_id, $current_user_household_id, $title, $content, $is_shared); if ($stmt->execute()) { $new_id = $stmt->insert_id; - header("Location: edit_note.php?id=$new_id&success=1"); + header("Location: notes.php?id=$new_id"); exit; } else { $error = "Fehler beim Speichern der Notiz."; @@ -113,6 +113,19 @@ require_once 'header.php'; } }); + // Tooltips hinzufügen + const tooltips = { + 'bold': 'Fett', 'italic': 'Kursiv', 'underline': 'Unterstrichen', 'strike': 'Durchgestrichen', + 'header': 'Überschrift', 'size': 'Schriftgröße', 'color': 'Textfarbe', 'background': 'Hintergrundfarbe', + 'list': 'Liste', 'align': 'Ausrichtung', 'link': 'Link einfügen', 'clean': 'Formatierung entfernen' + }; + for (let key in tooltips) { + document.querySelectorAll('.ql-' + key).forEach(el => el.setAttribute('title', tooltips[key])); + } + // Spezielle Listen (ordered/bullet) + document.querySelectorAll('.ql-list[value="ordered"]').forEach(el => el.setAttribute('title', 'Nummerierte Liste')); + document.querySelectorAll('.ql-list[value="bullet"]').forEach(el => el.setAttribute('title', 'Aufzählungsliste')); + var form = document.getElementById('noteForm'); form.onsubmit = function() { var content = document.getElementById('hiddenContent'); diff --git a/src/edit_note.php b/src/edit_note.php index 7fa098a..84999a1 100644 --- a/src/edit_note.php +++ b/src/edit_note.php @@ -108,9 +108,11 @@ require_once 'header.php'; -
- - +
+
+ +
+ Zurück zur Übersicht
@@ -200,6 +202,19 @@ require_once 'header.php'; } }); + // Tooltips hinzufügen + const tooltips = { + 'bold': 'Fett', 'italic': 'Kursiv', 'underline': 'Unterstrichen', 'strike': 'Durchgestrichen', + 'header': 'Überschrift', 'size': 'Schriftgröße', 'color': 'Textfarbe', 'background': 'Hintergrundfarbe', + 'list': 'Liste', 'align': 'Ausrichtung', 'link': 'Link einfügen', 'clean': 'Formatierung entfernen' + }; + for (let key in tooltips) { + document.querySelectorAll('.ql-' + key).forEach(el => el.setAttribute('title', tooltips[key])); + } + // Spezielle Listen (ordered/bullet) + document.querySelectorAll('.ql-list[value="ordered"]').forEach(el => el.setAttribute('title', 'Nummerierte Liste')); + document.querySelectorAll('.ql-list[value="bullet"]').forEach(el => el.setAttribute('title', 'Aufzählungsliste')); + var form = document.getElementById('noteForm'); form.onsubmit = function() { var content = document.getElementById('hiddenContent'); diff --git a/src/notes.php b/src/notes.php index 217ea7b..80585f5 100644 --- a/src/notes.php +++ b/src/notes.php @@ -34,7 +34,7 @@ $stmt->close(); // Check if a specific note is selected $active_note = null; -$active_note_id = isset($_GET['id']) ? intval($_GET['id']) : null; +$active_note_id = isset($_GET['id']) ? intval($_GET['id']) : (!empty($notes) ? $notes[0]['id'] : 0); if ($active_note_id) { foreach ($notes as $note) { @@ -46,7 +46,6 @@ if ($active_note_id) { } ?> - -
-
-

Notizen

- Neue Notiz +
+
+

Notizen

+ Neue Notiz
- -
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - -
Titel & StatusAktionen
Keine Notizen vorhanden.
-
- -
-
- - Ich - - - - - - - -
-
- - - - - - -
+
+ +
+ +
+
+
+
Meine Notizen
+
+ + + +
+ +
+ + + + + + +
+
+
+ + + +
+
+ + +
Keine Notizen vorhanden.
+ +
-
- -
- -
-
-
-

-
+ +
+ +
+
+
+ +
+
+ + + +
+
+
+
Zuletzt geändert:
Mit Haushalt geteilt
-
-
-
- +
+
+ +
- + +
+
+
Keine Notiz ausgewählt
+

Wähle links eine Notiz aus oder erstelle eine neue, um sie hier zu lesen.

-
- -
-
- -

Keine Notiz ausgewählt

-

Wähle links eine Notiz aus der Liste, um ihren Inhalt hier zu lesen.

- - Jetzt eine Notiz erstellen - -
-
- + +
@@ -199,7 +167,11 @@ if ($active_note_id) {