From 0294f1c722e88627af2a5ceb0eed8c1d52bb1b9c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 23 Aug 2020 18:50:49 +0100 Subject: [PATCH] Ticket url in event --- daemon.py | 3 ++- posts.py | 33 +++++++++++++++++++-------------- translations/ar.json | 3 ++- translations/ca.json | 3 ++- translations/cy.json | 3 ++- translations/de.json | 3 ++- translations/en.json | 3 ++- translations/es.json | 3 ++- translations/fr.json | 3 ++- translations/ga.json | 3 ++- translations/hi.json | 3 ++- translations/it.json | 3 ++- translations/ja.json | 3 ++- translations/oc.json | 3 ++- translations/pt.json | 3 ++- translations/ru.json | 3 ++- translations/zh.json | 3 ++- webinterface.py | 3 +++ 18 files changed, 54 insertions(+), 30 deletions(-) diff --git a/daemon.py b/daemon.py index 1f94d4c30..d6e15ba41 100644 --- a/daemon.py +++ b/daemon.py @@ -5864,7 +5864,8 @@ class PubServer(BaseHTTPRequestHandler): maximumAttendeeCapacity, fields['repliesModerationOption'], anonymousParticipationEnabled, - fields['eventStatus']) + fields['eventStatus'], + fields['ticketUrl']) if messageJson: if fields['schedulePost']: return 1 diff --git a/posts.py b/posts.py index e2dfd5363..ec49a6359 100644 --- a/posts.py +++ b/posts.py @@ -619,7 +619,8 @@ def appendEventFields(newPost: {}, eventDateStr: str, endDateStr: str, location: str, - maximumAttendeeCapacity: int) -> None: + maximumAttendeeCapacity: int, + ticketUrl: str) -> None: """Appends Mobilizon-type event fields to a post """ if not eventUUID: @@ -644,6 +645,8 @@ def appendEventFields(newPost: {}, newPost['location'] = location if maximumAttendeeCapacity: newPost['maximumAttendeeCapacity'] = maximumAttendeeCapacity + if ticketUrl: + newPost['ticketUrl'] = ticketUrl def createPostBase(baseDir: str, nickname: str, domain: str, port: int, @@ -662,7 +665,7 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int, maximumAttendeeCapacity=None, repliesModerationOption=None, anonymousParticipationEnabled=None, - eventStatus=None) -> {}: + eventStatus=None, ticketUrl=None) -> {}: """Creates a message """ mentionedRecipients = \ @@ -896,7 +899,8 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int, repliesModerationOption, category, joinMode, eventDateStr, endDateStr, - location, maximumAttendeeCapacity) + location, maximumAttendeeCapacity, + ticketUrl) else: idStr = \ httpPrefix + '://' + domain + '/users/' + nickname + \ @@ -943,7 +947,8 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int, repliesModerationOption, category, joinMode, eventDateStr, endDateStr, - location, maximumAttendeeCapacity) + location, maximumAttendeeCapacity, + ticketUrl) if ccUrl: if len(ccUrl) > 0: newPost['cc'] = [ccUrl] @@ -1120,7 +1125,7 @@ def createPublicPost(baseDir: str, False, False, inReplyTo, inReplyToAtomUri, subject, schedulePost, eventDate, eventTime, location, None, None, None, None, None, - None, None, None, None) + None, None, None, None, None) def createBlogPost(baseDir: str, @@ -1173,7 +1178,7 @@ def createQuestionPost(baseDir: str, False, False, None, None, subject, False, None, None, None, None, None, None, None, None, - None, None, None, None) + None, None, None, None, None) messageJson['object']['type'] = 'Question' messageJson['object']['oneOf'] = [] messageJson['object']['votersCount'] = 0 @@ -1222,7 +1227,7 @@ def createUnlistedPost(baseDir: str, False, False, inReplyTo, inReplyToAtomUri, subject, schedulePost, eventDate, eventTime, location, None, None, None, None, None, - None, None, None, None) + None, None, None, None, None) def createFollowersOnlyPost(baseDir: str, @@ -1255,7 +1260,7 @@ def createFollowersOnlyPost(baseDir: str, False, False, inReplyTo, inReplyToAtomUri, subject, schedulePost, eventDate, eventTime, location, None, None, None, None, None, - None, None, None, None) + None, None, None, None, None) def createEventPost(baseDir: str, @@ -1273,7 +1278,7 @@ def createEventPost(baseDir: str, maximumAttendeeCapacity=None, repliesModerationOption=None, anonymousParticipationEnabled=None, - eventStatus=None) -> {}: + eventStatus=None, ticketUrl=None) -> {}: """Mobilizon-type Event post """ if not attachImageFilename: @@ -1307,7 +1312,7 @@ def createEventPost(baseDir: str, endDate, endTime, maximumAttendeeCapacity, repliesModerationOption, anonymousParticipationEnabled, - eventStatus) + eventStatus, ticketUrl) def getMentionedPeople(baseDir: str, httpPrefix: str, @@ -1379,7 +1384,7 @@ def createDirectMessagePost(baseDir: str, False, False, inReplyTo, inReplyToAtomUri, subject, schedulePost, eventDate, eventTime, location, None, None, None, None, None, - None, None, None, None) + None, None, None, None, None) # mentioned recipients go into To rather than Cc messageJson['to'] = messageJson['object']['cc'] messageJson['object']['to'] = messageJson['to'] @@ -1473,7 +1478,7 @@ def createReportPost(baseDir: str, True, False, None, None, subject, False, None, None, None, None, None, None, None, None, - None, None, None, None) + None, None, None, None, None) if not postJsonObject: continue @@ -1634,7 +1639,7 @@ def sendPost(projectVersion: str, inReplyToAtomUri, subject, False, None, None, None, None, None, None, None, None, - None, None, None, None) + None, None, None, None, None) # get the senders private key privateKeyPem = getPersonKey(nickname, domain, baseDir, 'private') @@ -1782,7 +1787,7 @@ def sendPostViaServer(projectVersion: str, inReplyToAtomUri, subject, False, None, None, None, None, None, None, None, None, - None, None, None, None) + None, None, None, None, None) authHeader = createBasicAuthHeader(fromNickname, password) diff --git a/translations/ar.json b/translations/ar.json index dbfdab999..cbf796db8 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -277,5 +277,6 @@ "Cancelled": "ألغيت", "Event banner image description": "وصف صورة شعار الحدث", "Banner image": "صورة بانر", - "Maximum attendees": "الحد الأقصى للحضور" + "Maximum attendees": "الحد الأقصى للحضور", + "Ticket URL": "عنوان URL للتذكرة" } diff --git a/translations/ca.json b/translations/ca.json index dfb820e6b..310a661c3 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -277,5 +277,6 @@ "Cancelled": "Cancel·lat", "Event banner image description": "Descripció de la imatge del banner de l’esdeveniment", "Banner image": "Imatge de pancarta", - "Maximum attendees": "Màxim d’assistents" + "Maximum attendees": "Màxim d’assistents", + "Ticket URL": "URL de l'entrada" } diff --git a/translations/cy.json b/translations/cy.json index 626f61f2f..d2cece7ae 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -277,5 +277,6 @@ "Cancelled": "Wedi'i ganslo", "Event banner image description": "Disgrifiad delwedd baner y digwyddiad", "Banner image": "Delwedd baner", - "Maximum attendees": "Uchafswm mynychwyr" + "Maximum attendees": "Uchafswm mynychwyr", + "Ticket URL": "URL y tocyn" } diff --git a/translations/de.json b/translations/de.json index c5744c5eb..5e5b00215 100644 --- a/translations/de.json +++ b/translations/de.json @@ -277,5 +277,6 @@ "Cancelled": "Abgesagt", "Event banner image description": "Beschreibung des Ereignisbannerbildes", "Banner image": "Bannerbild", - "Maximum attendees": "Maximale Teilnehmerzahl" + "Maximum attendees": "Maximale Teilnehmerzahl", + "Ticket URL": "Ticket URL" } diff --git a/translations/en.json b/translations/en.json index 9fe0967fd..32950fcc6 100644 --- a/translations/en.json +++ b/translations/en.json @@ -277,5 +277,6 @@ "Cancelled": "Cancelled", "Event banner image description": "Event banner image description", "Banner image": "Banner image", - "Maximum attendees": "Maximum attendees" + "Maximum attendees": "Maximum attendees", + "Ticket URL": "Ticket URL" } diff --git a/translations/es.json b/translations/es.json index 5971ee9f7..3023aba06 100644 --- a/translations/es.json +++ b/translations/es.json @@ -277,5 +277,6 @@ "Cancelled": "Cancelada", "Event banner image description": "Descripción de la imagen del banner del evento", "Banner image": "Imagen de banner", - "Maximum attendees": "Asistentes máximos" + "Maximum attendees": "Asistentes máximos", + "Ticket URL": "URL del ticket" } diff --git a/translations/fr.json b/translations/fr.json index 4bb72abaf..ba35142d3 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -277,5 +277,6 @@ "Cancelled": "Annulé", "Event banner image description": "Description de l'image de la bannière de l'événement", "Banner image": "Image de bannière", - "Maximum attendees": "Nombre maximum de participants" + "Maximum attendees": "Nombre maximum de participants", + "Ticket URL": "URL du ticket" } diff --git a/translations/ga.json b/translations/ga.json index c0bd69ecd..f2d7dfd0f 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -277,5 +277,6 @@ "Cancelled": "Cealaithe", "Event banner image description": "Tuairisc íomhá meirge na hócáide", "Banner image": "Íomhá meirge", - "Maximum attendees": "Uasmhéid freastail" + "Maximum attendees": "Uasmhéid freastail", + "Ticket URL": "URL na dticéad" } diff --git a/translations/hi.json b/translations/hi.json index eece055d7..f1408a8b8 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -277,5 +277,6 @@ "Cancelled": "रद्द", "Event banner image description": "घटना बैनर छवि विवरण", "Banner image": "बैनर की छवि", - "Maximum attendees": "अधिकतम उपस्थित" + "Maximum attendees": "अधिकतम उपस्थित", + "Ticket URL": "टिकट URL" } diff --git a/translations/it.json b/translations/it.json index 5e5113d1d..26129d99f 100644 --- a/translations/it.json +++ b/translations/it.json @@ -277,5 +277,6 @@ "Cancelled": "Annullata", "Event banner image description": "Descrizione dell'immagine del banner dell'evento", "Banner image": "Immagine banner", - "Maximum attendees": "Numero massimo di partecipanti" + "Maximum attendees": "Numero massimo di partecipanti", + "Ticket URL": "URL del biglietto" } diff --git a/translations/ja.json b/translations/ja.json index 27710682f..7168441e0 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -277,5 +277,6 @@ "Cancelled": "キャンセル", "Event banner image description": "イベントバナー画像の説明", "Banner image": "バナー画像", - "Maximum attendees": "最大参加者" + "Maximum attendees": "最大参加者", + "Ticket URL": "チケットURL" } diff --git a/translations/oc.json b/translations/oc.json index d7c0d467e..d4de3fa48 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -273,5 +273,6 @@ "Cancelled": "Cancelled", "Event banner image description": "Event banner image description", "Banner image": "Banner image", - "Maximum attendees": "Maximum attendees" + "Maximum attendees": "Maximum attendees", + "Ticket URL": "Ticket URL" } diff --git a/translations/pt.json b/translations/pt.json index 66c9735b0..82f591749 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -277,5 +277,6 @@ "Cancelled": "Cancelada", "Event banner image description": "Descrição da imagem do banner do evento", "Banner image": "Imagem de banner", - "Maximum attendees": "Máximo de participantes" + "Maximum attendees": "Máximo de participantes", + "Ticket URL": "URL do bilhete" } diff --git a/translations/ru.json b/translations/ru.json index 4d7b8d24e..5f00471d4 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -277,5 +277,6 @@ "Cancelled": "Отменено", "Event banner image description": "Описание изображения баннера мероприятия", "Banner image": "Изображение баннера", - "Maximum attendees": "Максимальное количество участников" + "Maximum attendees": "Максимальное количество участников", + "Ticket URL": "URL билета" } diff --git a/translations/zh.json b/translations/zh.json index b49b24fe8..eab8eece1 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -277,5 +277,6 @@ "Cancelled": "取消", "Event banner image description": "活动横幅图片说明", "Banner image": "横幅图片", - "Maximum attendees": "参加人数上限" + "Maximum attendees": "参加人数上限", + "Ticket URL": "工单URL" } diff --git a/webinterface.py b/webinterface.py index 2e497b67c..29707c2a4 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2167,6 +2167,9 @@ def htmlNewPost(mediaInstance: bool, translate: {}, translate['Location'] + ': \n' dateAndLocation += '\n' if endpoint == 'newevent': + dateAndLocation += '
\n' + dateAndLocation += '\n' dateAndLocation += '
\n' dateAndLocation += '\n'