added phone numbers to backend api and frontend modals

This commit is contained in:
2026-08-17 11:56:27 +02:00
parent 6c5d49e62b
commit 159a4f4388
3 changed files with 14 additions and 2 deletions
+12 -1
View File
@@ -12,12 +12,15 @@ class Person:
self.birthday = None
self.photo = None
self.numbers = []
self.seen_at = []
self.last_seen: date = None
self.uid = str(uuid.uuid4())
self.parse_name()
self.parse_numbers()
self.parse_photo()
self.parse_birthday()
@@ -28,7 +31,8 @@ class Person:
"last_seen": self.last_seen.isoformat() if self.last_seen else None,
"birthday": self.birthday.isoformat() if self.birthday else None,
"uid": self.uid,
"photo": bool(self.photo)
"photo": bool(self.photo),
"numbers": self.numbers
}
def parse_name(self):
@@ -43,6 +47,13 @@ class Person:
else:
return
def parse_numbers(self):
if not hasattr(self.vcard, "tel_list"):
return
for t in self.vcard.tel_list:
self.numbers.append(t.value)
def parse_birthday(self):
if not hasattr(self.vcard, "bday"):
return
+1
View File
@@ -298,6 +298,7 @@ function openPersonModal(uid){
['Birthday', person && person.birthday ? fmtBirthday(person.birthday) : '—'],
['Last seen', daysSince !== null ? `${daysSince}d ago` : '—'],
['Meetups together', meetups.length],
['Numbers', person.numbers.join(",\n") ?? "no number"]
];
const meetupChips = meetups.length
+1 -1
View File
@@ -200,7 +200,7 @@ main.grid{
height: 90px;
border-radius: 50%;
margin: 4px auto 12px;
background-size: cover;
background-size: 120%;
background-position: center;
background-color: var(--border);
}