Publish, edit, renew and delete listings from the web UI

- Form at #/mine/new and #/mine/<id>/edit: coordinates pasted and encoded
  to a precision-6 geohash in the browser (about 1 km, OSM link to check, no
  map tiles), euro price parsing, optional exact address saved on the node only
- Region guard: refuses places the node does not follow; region fixed on edit
- Owner view: days left with a warning under 5 days, manual Renew (30 days),
  Edit, Delete with confirmation
- Tests (jsdom and pure logic), docs, rebuilt web/dist

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 20:18:08 +01:00
co-authored by Claude Sonnet 5.5
parent 7348067350
commit d021989f09
16 changed files with 1846 additions and 87 deletions
+94
View File
@@ -181,6 +181,53 @@ const de = {
"own.needAddress": "Bitte gib eine Adresse ein.",
"own.loadError": "Konnte nicht geladen werden.",
"own.err": "Fehlgeschlagen: {detail}",
"own.new": "Neue Anzeige",
"own.edit": "Bearbeiten",
"own.renew": "Verlängern",
"own.renewing": "Wird verlängert …",
"own.deleteListing": "Anzeige löschen",
"own.deleteListingSure":
"Wirklich löschen? Die Anzeige verschwindet aus dem Netz, und Interessenten können dich darüber nicht mehr erreichen.",
"own.daysLeft": "Noch {n} Tage",
"own.dayLeft": "Noch 1 Tag",
"own.expired": "Abgelaufen",
"own.soon": "Läuft bald ab. „Verlängern“ stellt sie für 30 Tage neu ein.",
"pub.createTitle": "Anzeige veröffentlichen",
"pub.editTitle": "Anzeige bearbeiten",
"pub.intro":
"Deine Anzeige wird signiert und an die Knoten deiner Region verteilt. Name, genaue Adresse und Kontaktdaten stehen nie darin.",
"pub.back": "← Zurück",
"pub.title": "Titel",
"pub.description": "Beschreibung",
"pub.priceRent": "Miete pro Monat (€)",
"pub.priceSale": "Kaufpreis (€)",
"pub.area": "Fläche in m² (optional)",
"pub.rooms": "Zimmer (optional, halbe Zimmer möglich)",
"pub.features": "Ausstattung (optional, mit Komma getrennt)",
"pub.location": "Lage",
"pub.locationHelp":
"Füge Koordinaten ein, zum Beispiel 53.5511, 9.9937 (in OpenStreetMap oder deiner Karten-App den Ort anklicken und kopieren; ein Link geht auch). Veröffentlicht wird nur ein Gebiet von etwa einem Kilometer, nie die genaue Adresse.",
"pub.useLocation": "Meinen Standort verwenden",
"pub.locationShown": "Veröffentlicht wird ein Gebiet von etwa {w} × {h} m um {lat}, {lon} (Code {hash}).",
"pub.duration": "Sichtbar für",
"pub.addrTitle": "Genaue Adresse (optional)",
"pub.addrHelp":
"Bleibt auf deinem Knoten und wird nie veröffentlicht. Du gibst sie später einzelnen Interessenten frei.",
"pub.publish": "Veröffentlichen",
"pub.save": "Änderungen speichern",
"pub.working": "Wird veröffentlicht … (eine kleine Rechenaufgabe, ein paar Sekunden)",
"pub.notFound": "Diese Anzeige gibt es nicht (mehr).",
"pub.eTitle": "Bitte gib einen Titel an (höchstens 120 Zeichen, eine Zeile).",
"pub.eDescription": "Die Beschreibung ist zu lang (höchstens 4000 Zeichen) oder enthält unerlaubte Zeichen.",
"pub.ePrice": "Bitte gib einen Betrag größer als 0 an, zum Beispiel 1150 oder 1.150,50.",
"pub.eArea": "Die Fläche muss eine ganze Zahl sein (höchstens 100000).",
"pub.eRooms": "Zimmer: eine Zahl in halben Schritten, zum Beispiel 2,5.",
"pub.eFeatures": "Höchstens 20 Merkmale mit je höchstens 40 Zeichen.",
"pub.eLocation": "Die Koordinaten konnten nicht gelesen werden. Beispiel: 53.5511, 9.9937",
"pub.eRegion":
"Dein Knoten folgt der Region {region} nicht, du würdest also keine Nachrichten zu dieser Anzeige erhalten. Starte den Knoten mit --region {region} oder wähle einen Ort in {regions}.",
"pub.eRegionEdit": "Die Region einer Anzeige lässt sich nicht ändern. Lösche sie und lege eine neue an.",
"pub.eAddress": "Die Adresse ist zu lang (höchstens 300 Bytes).",
"verify.title": "Prüfung in deinem Browser",
"verify.intro":
"Diese Prüfung läuft lokal, nicht auf dem Server. Ein Knoten kann Anzeigen also nicht unbemerkt fälschen.",
@@ -380,6 +427,53 @@ const en: Record<keyof typeof de, string> = {
"own.needAddress": "Please enter an address.",
"own.loadError": "Could not be loaded.",
"own.err": "Failed: {detail}",
"own.new": "New listing",
"own.edit": "Edit",
"own.renew": "Renew",
"own.renewing": "Renewing …",
"own.deleteListing": "Delete listing",
"own.deleteListingSure":
"Really delete? The listing disappears from the network, and people can no longer reach you through it.",
"own.daysLeft": "{n} days left",
"own.dayLeft": "1 day left",
"own.expired": "Expired",
"own.soon": "Expires soon. \"Renew\" publishes it again for 30 days.",
"pub.createTitle": "Publish a listing",
"pub.editTitle": "Edit listing",
"pub.intro":
"Your listing is signed and spread to the nodes of your region. It never contains your name, exact address or contact details.",
"pub.back": "← Back",
"pub.title": "Title",
"pub.description": "Description",
"pub.priceRent": "Rent per month (€)",
"pub.priceSale": "Price (€)",
"pub.area": "Area in m² (optional)",
"pub.rooms": "Rooms (optional, half rooms allowed)",
"pub.features": "Features (optional, separated by commas)",
"pub.location": "Location",
"pub.locationHelp":
"Paste coordinates, for example 53.5511, 9.9937 (click the place in OpenStreetMap or your map app and copy; a link works too). Only an area of about a kilometre is published, never the exact address.",
"pub.useLocation": "Use my location",
"pub.locationShown": "An area of about {w} × {h} m around {lat}, {lon} will be published (code {hash}).",
"pub.duration": "Visible for",
"pub.addrTitle": "Exact address (optional)",
"pub.addrHelp":
"Stays on your node and is never published. You release it to individual people later.",
"pub.publish": "Publish",
"pub.save": "Save changes",
"pub.working": "Publishing … (a small puzzle, a few seconds)",
"pub.notFound": "This listing does not exist (any more).",
"pub.eTitle": "Please enter a title (at most 120 characters, one line).",
"pub.eDescription": "The description is too long (at most 4000 characters) or contains characters that are not allowed.",
"pub.ePrice": "Please enter an amount above 0, for example 1150 or 1,150.50.",
"pub.eArea": "The area must be a whole number (at most 100000).",
"pub.eRooms": "Rooms: a number in half steps, for example 2.5.",
"pub.eFeatures": "At most 20 features of at most 40 characters each.",
"pub.eLocation": "The coordinates could not be read. Example: 53.5511, 9.9937",
"pub.eRegion":
"Your node does not follow region {region}, so you would not receive messages about this listing. Start the node with --region {region} or choose a place in {regions}.",
"pub.eRegionEdit": "A listing's region cannot change. Delete it and create a new one.",
"pub.eAddress": "The address is too long (at most 300 bytes).",
"verify.title": "Checked in your browser",
"verify.intro":
"This check runs locally, not on the server, so a node cannot forge listings unnoticed.",