Set birthday on edit profile screen

main
Bob Mottram 2024-01-07 15:31:30 +00:00
parent 0f981dd4fd
commit 2be0fae78f
29 changed files with 86 additions and 27 deletions

View File

@ -7362,6 +7362,24 @@ class PubServer(BaseHTTPRequestHandler):
set_max_profile_posts(base_dir, nickname, domain,
20)
# birthday on edit profile screen
birth_date = ''
if actor_json.get('vcard:bday'):
birth_date = actor_json['vcard:bday']
if fields.get('birthDate'):
if fields['birthDate'] != birth_date:
new_birth_date = fields['birthDate']
if '-' in new_birth_date and \
len(new_birth_date.split('-')) == 3:
# set birth date
actor_json['vcard:bday'] = new_birth_date
actor_changed = True
else:
# set birth date
if birth_date:
actor_json['vcard:bday'] = ''
actor_changed = True
# change tox address
current_tox_address = get_tox_address(actor_json)
if fields.get('toxAddress'):

View File

@ -653,5 +653,6 @@
"Update type": "نوع التحديث",
"add a rating": "إضافة تقييم",
"Rating": "تقييم",
"reading": "قراءة"
"reading": "قراءة",
"Birthday": "عيد ميلاد"
}

View File

@ -653,5 +653,6 @@
"Update type": "আপডেটের ধরন",
"add a rating": "একটি রেটিং যোগ করুন",
"Rating": "রেটিং",
"reading": "পড়া"
"reading": "পড়া",
"Birthday": "জন্মদিন"
}

View File

@ -653,5 +653,6 @@
"Update type": "Tipus d'actualització",
"add a rating": "afegir una qualificació",
"Rating": "Valoració",
"reading": "lectura"
"reading": "lectura",
"Birthday": "Aniversari"
}

View File

@ -653,5 +653,6 @@
"Update type": "Math o ddiweddariad",
"add a rating": "ychwanegu sgôr",
"Rating": "Graddio",
"reading": "darllen"
"reading": "darllen",
"Birthday": "Penblwydd"
}

View File

@ -653,5 +653,6 @@
"Update type": "Update-Typ",
"add a rating": "Fügen Sie eine Bewertung hinzu",
"Rating": "Bewertung",
"reading": "lektüre"
"reading": "lektüre",
"Birthday": "Geburtstag"
}

View File

@ -653,5 +653,6 @@
"Update type": "Τύπος ενημέρωσης",
"add a rating": "προσθέστε μια βαθμολογία",
"Rating": "Εκτίμηση",
"reading": "ΑΝΑΓΝΩΣΗ"
"reading": "ΑΝΑΓΝΩΣΗ",
"Birthday": "Γενέθλια"
}

View File

@ -653,5 +653,6 @@
"Update type": "Update type",
"add a rating": "add a rating",
"Rating": "Rating",
"reading": "reading"
"reading": "reading",
"Birthday": "Birthday"
}

View File

@ -653,5 +653,6 @@
"Update type": "Tipo de actualización",
"add a rating": "agregar una calificación",
"Rating": "Clasificación",
"reading": "lectura"
"reading": "lectura",
"Birthday": "Cumpleaños"
}

View File

@ -653,5 +653,6 @@
"Update type": "نوع به روز رسانی",
"add a rating": "امتیاز اضافه کنید",
"Rating": "رتبه بندی",
"reading": "خواندن"
"reading": "خواندن",
"Birthday": "روز تولد"
}

View File

@ -653,5 +653,6 @@
"Update type": "Type de mise à jour",
"add a rating": "ajouter une note",
"Rating": "Notation",
"reading": "en lisant"
"reading": "en lisant",
"Birthday": "Anniversaire"
}

View File

@ -653,5 +653,6 @@
"Update type": "Cineál nuashonraithe",
"add a rating": "cuir rátáil",
"Rating": "Rátáil",
"reading": "ag léamh"
"reading": "ag léamh",
"Birthday": "Breithlá"
}

View File

@ -653,5 +653,6 @@
"Update type": "סוג עדכון",
"add a rating": "להוסיף דירוג",
"Rating": "דֵרוּג",
"reading": "קריאה"
"reading": "קריאה",
"Birthday": "יום הולדת"
}

View File

@ -653,5 +653,6 @@
"Update type": "अद्यतन प्रकार",
"add a rating": "एक रेटिंग जोड़ें",
"Rating": "रेटिंग",
"reading": "पढ़ना"
"reading": "पढ़ना",
"Birthday": "जन्मदिन"
}

View File

@ -653,5 +653,6 @@
"Update type": "Tipo di aggiornamento",
"add a rating": "aggiungi una valutazione",
"Rating": "Valutazione",
"reading": "lettura"
"reading": "lettura",
"Birthday": "Compleanno"
}

View File

@ -653,5 +653,6 @@
"Update type": "更新タイプ",
"add a rating": "評価を追加する",
"Rating": "評価",
"reading": "読む"
"reading": "読む",
"Birthday": "誕生日"
}

View File

@ -653,5 +653,6 @@
"Update type": "업데이트 유형",
"add a rating": "평점 추가",
"Rating": "평가",
"reading": "독서"
"reading": "독서",
"Birthday": "생일"
}

View File

@ -653,5 +653,6 @@
"Update type": "Cureyê nûve bike",
"add a rating": "rêjeyek zêde bike",
"Rating": "Rating",
"reading": "xwendinî"
"reading": "xwendinî",
"Birthday": "Rojbûn"
}

View File

@ -653,5 +653,6 @@
"Update type": "Updatetype",
"add a rating": "een beoordeling toevoegen",
"Rating": "Beoordeling",
"reading": "lezing"
"reading": "lezing",
"Birthday": "Verjaardag"
}

View File

@ -649,5 +649,6 @@
"Update type": "Update type",
"add a rating": "add a rating",
"Rating": "Rating",
"reading": "reading"
"reading": "reading",
"Birthday": "Birthday"
}

View File

@ -653,5 +653,6 @@
"Update type": "Typ aktualizacji",
"add a rating": "dodaj ocenę",
"Rating": "Ocena",
"reading": "czytanie"
"reading": "czytanie",
"Birthday": "Urodziny"
}

View File

@ -653,5 +653,6 @@
"Update type": "Tipo de atualização",
"add a rating": "adicionar uma classificação",
"Rating": "Avaliação",
"reading": "leitura"
"reading": "leitura",
"Birthday": "Aniversário"
}

View File

@ -653,5 +653,6 @@
"Update type": "Тип обновления",
"add a rating": "добавить оценку",
"Rating": "Рейтинг",
"reading": "чтение"
"reading": "чтение",
"Birthday": "День рождения"
}

View File

@ -653,5 +653,6 @@
"Update type": "Aina ya sasisho",
"add a rating": "ongeza ukadiriaji",
"Rating": "Ukadiriaji",
"reading": "kusoma"
"reading": "kusoma",
"Birthday": "Siku ya kuzaliwa"
}

View File

@ -653,5 +653,6 @@
"Update type": "Güncelleme türü",
"add a rating": "derecelendirme ekle",
"Rating": "Değerlendirme",
"reading": "okuma"
"reading": "okuma",
"Birthday": "Doğum günü"
}

View File

@ -653,5 +653,6 @@
"Update type": "Тип оновлення",
"add a rating": "додати оцінку",
"Rating": "Рейтинг",
"reading": "читання"
"reading": "читання",
"Birthday": "день народження"
}

View File

@ -653,5 +653,6 @@
"Update type": "דערהייַנטיקן טיפּ",
"add a rating": "לייגן אַ ראַנג",
"Rating": "שאַץ",
"reading": "לייענען"
"reading": "לייענען",
"Birthday": "דיין געבורסטאָג"
}

View File

@ -653,5 +653,6 @@
"Update type": "更新类型",
"add a rating": "添加评级",
"Rating": "评分",
"reading": "阅读"
"reading": "阅读",
"Birthday": "生日"
}

View File

@ -2835,6 +2835,20 @@ def _html_edit_profile_main(base_dir: str, display_nickname: str, bio_str: str,
'maxRecentProfilePosts', max_profile_posts,
1, 20, max_recent_posts)
birth_date = ''
birth_date_field = 'vcard:bday'
if actor_json.get(birth_date_field):
if '-' in actor_json[birth_date_field]:
if len(actor_json[birth_date_field].split('-')) == 3:
if 'T' in actor_json[birth_date_field]:
actor_json[birth_date_field] = \
actor_json[birth_date_field].split('T')[0]
birth_date = actor_json[birth_date_field]
edit_profile_form += '<br>\n<label class="labels">' + \
translate['Birthday'] + ': </label>\n'
edit_profile_form += \
'<input type="date" name="birthDate" value="' + birth_date + '">\n'
edit_profile_form += ' </div>\n'
return edit_profile_form