From f83a6825b1fec8b183341fbf868924ccd0cd732e Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Sun, 27 Apr 2025 15:53:33 +0100
Subject: [PATCH] Save addresses to address book
---
maps.py | 26 ++++++++++++++++++++++++++
webapp_create_post.py | 14 +++++++++++---
2 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/maps.py b/maps.py
index 8cd846c69..bfefed4cf 100644
--- a/maps.py
+++ b/maps.py
@@ -97,6 +97,32 @@ def _get_location_from_tags(tags: []) -> str:
return None
+def html_address_book_list(base_dir: str, nickname: str, domain: str) -> str:
+ """Creates a list of potential addresses when creating a new post
+ with a location
+ """
+ list_str = '\n'
+ return list_str
+
+
def update_address_book(base_dir: str, nickname: str, domain: str,
location: str, address: str) -> None:
"""Adds an address to the address book for the given account
diff --git a/webapp_create_post.py b/webapp_create_post.py
index f4c58f7b3..77e8bb182 100644
--- a/webapp_create_post.py
+++ b/webapp_create_post.py
@@ -44,6 +44,7 @@ from webapp_utils import edit_text_field
from webapp_utils import edit_number_field
from webapp_utils import edit_currency_field
from webapp_post import individual_post_as_html
+from maps import html_address_book_list
from maps import get_map_preferences_url
from maps import get_map_preferences_coords
from maps import get_location_from_post
@@ -1079,9 +1080,16 @@ def html_new_post(edit_post_params: {},
edit_text_field(location_label_with_link, 'location',
default_location,
'https://www.openstreetmap.org/#map=') + '
\n'
- address_str = translate['Address']
- date_and_location += '\n' + \
- edit_text_field(address_str, 'locationAddress', '', '') + '
\n'
+
+ date_and_location += \
+ '
\n'
+ date_and_location += \
+ '\n'
+ date_and_location += \
+ html_address_book_list(base_dir, nickname, domain)
+
date_and_location += end_edit_section()
instance_title = get_config_param(base_dir, 'instanceTitle')