Ticket url in event

merge-requests/8/head
Bob Mottram 2020-08-23 18:50:49 +01:00
parent 1ff70dd8a4
commit 0294f1c722
18 changed files with 54 additions and 30 deletions

View File

@ -5864,7 +5864,8 @@ class PubServer(BaseHTTPRequestHandler):
maximumAttendeeCapacity, maximumAttendeeCapacity,
fields['repliesModerationOption'], fields['repliesModerationOption'],
anonymousParticipationEnabled, anonymousParticipationEnabled,
fields['eventStatus']) fields['eventStatus'],
fields['ticketUrl'])
if messageJson: if messageJson:
if fields['schedulePost']: if fields['schedulePost']:
return 1 return 1

View File

@ -619,7 +619,8 @@ def appendEventFields(newPost: {},
eventDateStr: str, eventDateStr: str,
endDateStr: str, endDateStr: str,
location: str, location: str,
maximumAttendeeCapacity: int) -> None: maximumAttendeeCapacity: int,
ticketUrl: str) -> None:
"""Appends Mobilizon-type event fields to a post """Appends Mobilizon-type event fields to a post
""" """
if not eventUUID: if not eventUUID:
@ -644,6 +645,8 @@ def appendEventFields(newPost: {},
newPost['location'] = location newPost['location'] = location
if maximumAttendeeCapacity: if maximumAttendeeCapacity:
newPost['maximumAttendeeCapacity'] = maximumAttendeeCapacity newPost['maximumAttendeeCapacity'] = maximumAttendeeCapacity
if ticketUrl:
newPost['ticketUrl'] = ticketUrl
def createPostBase(baseDir: str, nickname: str, domain: str, port: int, 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, maximumAttendeeCapacity=None,
repliesModerationOption=None, repliesModerationOption=None,
anonymousParticipationEnabled=None, anonymousParticipationEnabled=None,
eventStatus=None) -> {}: eventStatus=None, ticketUrl=None) -> {}:
"""Creates a message """Creates a message
""" """
mentionedRecipients = \ mentionedRecipients = \
@ -896,7 +899,8 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int,
repliesModerationOption, repliesModerationOption,
category, joinMode, category, joinMode,
eventDateStr, endDateStr, eventDateStr, endDateStr,
location, maximumAttendeeCapacity) location, maximumAttendeeCapacity,
ticketUrl)
else: else:
idStr = \ idStr = \
httpPrefix + '://' + domain + '/users/' + nickname + \ httpPrefix + '://' + domain + '/users/' + nickname + \
@ -943,7 +947,8 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int,
repliesModerationOption, repliesModerationOption,
category, joinMode, category, joinMode,
eventDateStr, endDateStr, eventDateStr, endDateStr,
location, maximumAttendeeCapacity) location, maximumAttendeeCapacity,
ticketUrl)
if ccUrl: if ccUrl:
if len(ccUrl) > 0: if len(ccUrl) > 0:
newPost['cc'] = [ccUrl] newPost['cc'] = [ccUrl]
@ -1120,7 +1125,7 @@ def createPublicPost(baseDir: str,
False, False, inReplyTo, inReplyToAtomUri, subject, False, False, inReplyTo, inReplyToAtomUri, subject,
schedulePost, eventDate, eventTime, location, schedulePost, eventDate, eventTime, location,
None, None, None, None, None, None, None, None, None, None,
None, None, None, None) None, None, None, None, None)
def createBlogPost(baseDir: str, def createBlogPost(baseDir: str,
@ -1173,7 +1178,7 @@ def createQuestionPost(baseDir: str,
False, False, None, None, subject, False, False, None, None, subject,
False, None, None, None, None, None, False, None, None, None, None, None,
None, None, None, None, None, None,
None, None, None, None) None, None, None, None, None)
messageJson['object']['type'] = 'Question' messageJson['object']['type'] = 'Question'
messageJson['object']['oneOf'] = [] messageJson['object']['oneOf'] = []
messageJson['object']['votersCount'] = 0 messageJson['object']['votersCount'] = 0
@ -1222,7 +1227,7 @@ def createUnlistedPost(baseDir: str,
False, False, inReplyTo, inReplyToAtomUri, subject, False, False, inReplyTo, inReplyToAtomUri, subject,
schedulePost, eventDate, eventTime, location, schedulePost, eventDate, eventTime, location,
None, None, None, None, None, None, None, None, None, None,
None, None, None, None) None, None, None, None, None)
def createFollowersOnlyPost(baseDir: str, def createFollowersOnlyPost(baseDir: str,
@ -1255,7 +1260,7 @@ def createFollowersOnlyPost(baseDir: str,
False, False, inReplyTo, inReplyToAtomUri, subject, False, False, inReplyTo, inReplyToAtomUri, subject,
schedulePost, eventDate, eventTime, location, schedulePost, eventDate, eventTime, location,
None, None, None, None, None, None, None, None, None, None,
None, None, None, None) None, None, None, None, None)
def createEventPost(baseDir: str, def createEventPost(baseDir: str,
@ -1273,7 +1278,7 @@ def createEventPost(baseDir: str,
maximumAttendeeCapacity=None, maximumAttendeeCapacity=None,
repliesModerationOption=None, repliesModerationOption=None,
anonymousParticipationEnabled=None, anonymousParticipationEnabled=None,
eventStatus=None) -> {}: eventStatus=None, ticketUrl=None) -> {}:
"""Mobilizon-type Event post """Mobilizon-type Event post
""" """
if not attachImageFilename: if not attachImageFilename:
@ -1307,7 +1312,7 @@ def createEventPost(baseDir: str,
endDate, endTime, maximumAttendeeCapacity, endDate, endTime, maximumAttendeeCapacity,
repliesModerationOption, repliesModerationOption,
anonymousParticipationEnabled, anonymousParticipationEnabled,
eventStatus) eventStatus, ticketUrl)
def getMentionedPeople(baseDir: str, httpPrefix: str, def getMentionedPeople(baseDir: str, httpPrefix: str,
@ -1379,7 +1384,7 @@ def createDirectMessagePost(baseDir: str,
False, False, inReplyTo, inReplyToAtomUri, subject, False, False, inReplyTo, inReplyToAtomUri, subject,
schedulePost, eventDate, eventTime, location, schedulePost, eventDate, eventTime, location,
None, None, None, None, None, None, None, None, None, None,
None, None, None, None) None, None, None, None, None)
# mentioned recipients go into To rather than Cc # mentioned recipients go into To rather than Cc
messageJson['to'] = messageJson['object']['cc'] messageJson['to'] = messageJson['object']['cc']
messageJson['object']['to'] = messageJson['to'] messageJson['object']['to'] = messageJson['to']
@ -1473,7 +1478,7 @@ def createReportPost(baseDir: str,
True, False, None, None, subject, True, False, None, None, subject,
False, None, None, None, None, None, False, None, None, None, None, None,
None, None, None, None, None, None,
None, None, None, None) None, None, None, None, None)
if not postJsonObject: if not postJsonObject:
continue continue
@ -1634,7 +1639,7 @@ def sendPost(projectVersion: str,
inReplyToAtomUri, subject, inReplyToAtomUri, subject,
False, None, None, None, None, None, False, None, None, None, None, None,
None, None, None, None, None, None,
None, None, None, None) None, None, None, None, None)
# get the senders private key # get the senders private key
privateKeyPem = getPersonKey(nickname, domain, baseDir, 'private') privateKeyPem = getPersonKey(nickname, domain, baseDir, 'private')
@ -1782,7 +1787,7 @@ def sendPostViaServer(projectVersion: str,
inReplyToAtomUri, subject, inReplyToAtomUri, subject,
False, None, None, None, None, None, False, None, None, None, None, None,
None, None, None, None, None, None,
None, None, None, None) None, None, None, None, None)
authHeader = createBasicAuthHeader(fromNickname, password) authHeader = createBasicAuthHeader(fromNickname, password)

View File

@ -277,5 +277,6 @@
"Cancelled": "ألغيت", "Cancelled": "ألغيت",
"Event banner image description": "وصف صورة شعار الحدث", "Event banner image description": "وصف صورة شعار الحدث",
"Banner image": "صورة بانر", "Banner image": "صورة بانر",
"Maximum attendees": "الحد الأقصى للحضور" "Maximum attendees": "الحد الأقصى للحضور",
"Ticket URL": "عنوان URL للتذكرة"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Cancel·lat", "Cancelled": "Cancel·lat",
"Event banner image description": "Descripció de la imatge del banner de lesdeveniment", "Event banner image description": "Descripció de la imatge del banner de lesdeveniment",
"Banner image": "Imatge de pancarta", "Banner image": "Imatge de pancarta",
"Maximum attendees": "Màxim dassistents" "Maximum attendees": "Màxim dassistents",
"Ticket URL": "URL de l'entrada"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Wedi'i ganslo", "Cancelled": "Wedi'i ganslo",
"Event banner image description": "Disgrifiad delwedd baner y digwyddiad", "Event banner image description": "Disgrifiad delwedd baner y digwyddiad",
"Banner image": "Delwedd baner", "Banner image": "Delwedd baner",
"Maximum attendees": "Uchafswm mynychwyr" "Maximum attendees": "Uchafswm mynychwyr",
"Ticket URL": "URL y tocyn"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Abgesagt", "Cancelled": "Abgesagt",
"Event banner image description": "Beschreibung des Ereignisbannerbildes", "Event banner image description": "Beschreibung des Ereignisbannerbildes",
"Banner image": "Bannerbild", "Banner image": "Bannerbild",
"Maximum attendees": "Maximale Teilnehmerzahl" "Maximum attendees": "Maximale Teilnehmerzahl",
"Ticket URL": "Ticket URL"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Cancelled", "Cancelled": "Cancelled",
"Event banner image description": "Event banner image description", "Event banner image description": "Event banner image description",
"Banner image": "Banner image", "Banner image": "Banner image",
"Maximum attendees": "Maximum attendees" "Maximum attendees": "Maximum attendees",
"Ticket URL": "Ticket URL"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Cancelada", "Cancelled": "Cancelada",
"Event banner image description": "Descripción de la imagen del banner del evento", "Event banner image description": "Descripción de la imagen del banner del evento",
"Banner image": "Imagen de banner", "Banner image": "Imagen de banner",
"Maximum attendees": "Asistentes máximos" "Maximum attendees": "Asistentes máximos",
"Ticket URL": "URL del ticket"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Annulé", "Cancelled": "Annulé",
"Event banner image description": "Description de l'image de la bannière de l'événement", "Event banner image description": "Description de l'image de la bannière de l'événement",
"Banner image": "Image de bannière", "Banner image": "Image de bannière",
"Maximum attendees": "Nombre maximum de participants" "Maximum attendees": "Nombre maximum de participants",
"Ticket URL": "URL du ticket"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Cealaithe", "Cancelled": "Cealaithe",
"Event banner image description": "Tuairisc íomhá meirge na hócáide", "Event banner image description": "Tuairisc íomhá meirge na hócáide",
"Banner image": "Íomhá meirge", "Banner image": "Íomhá meirge",
"Maximum attendees": "Uasmhéid freastail" "Maximum attendees": "Uasmhéid freastail",
"Ticket URL": "URL na dticéad"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "रद्द", "Cancelled": "रद्द",
"Event banner image description": "घटना बैनर छवि विवरण", "Event banner image description": "घटना बैनर छवि विवरण",
"Banner image": "बैनर की छवि", "Banner image": "बैनर की छवि",
"Maximum attendees": "अधिकतम उपस्थित" "Maximum attendees": "अधिकतम उपस्थित",
"Ticket URL": "टिकट URL"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Annullata", "Cancelled": "Annullata",
"Event banner image description": "Descrizione dell'immagine del banner dell'evento", "Event banner image description": "Descrizione dell'immagine del banner dell'evento",
"Banner image": "Immagine banner", "Banner image": "Immagine banner",
"Maximum attendees": "Numero massimo di partecipanti" "Maximum attendees": "Numero massimo di partecipanti",
"Ticket URL": "URL del biglietto"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "キャンセル", "Cancelled": "キャンセル",
"Event banner image description": "イベントバナー画像の説明", "Event banner image description": "イベントバナー画像の説明",
"Banner image": "バナー画像", "Banner image": "バナー画像",
"Maximum attendees": "最大参加者" "Maximum attendees": "最大参加者",
"Ticket URL": "チケットURL"
} }

View File

@ -273,5 +273,6 @@
"Cancelled": "Cancelled", "Cancelled": "Cancelled",
"Event banner image description": "Event banner image description", "Event banner image description": "Event banner image description",
"Banner image": "Banner image", "Banner image": "Banner image",
"Maximum attendees": "Maximum attendees" "Maximum attendees": "Maximum attendees",
"Ticket URL": "Ticket URL"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Cancelada", "Cancelled": "Cancelada",
"Event banner image description": "Descrição da imagem do banner do evento", "Event banner image description": "Descrição da imagem do banner do evento",
"Banner image": "Imagem de banner", "Banner image": "Imagem de banner",
"Maximum attendees": "Máximo de participantes" "Maximum attendees": "Máximo de participantes",
"Ticket URL": "URL do bilhete"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "Отменено", "Cancelled": "Отменено",
"Event banner image description": "Описание изображения баннера мероприятия", "Event banner image description": "Описание изображения баннера мероприятия",
"Banner image": "Изображение баннера", "Banner image": "Изображение баннера",
"Maximum attendees": "Максимальное количество участников" "Maximum attendees": "Максимальное количество участников",
"Ticket URL": "URL билета"
} }

View File

@ -277,5 +277,6 @@
"Cancelled": "取消", "Cancelled": "取消",
"Event banner image description": "活动横幅图片说明", "Event banner image description": "活动横幅图片说明",
"Banner image": "横幅图片", "Banner image": "横幅图片",
"Maximum attendees": "参加人数上限" "Maximum attendees": "参加人数上限",
"Ticket URL": "工单URL"
} }

View File

@ -2167,6 +2167,9 @@ def htmlNewPost(mediaInstance: bool, translate: {},
translate['Location'] + ': </label>\n' translate['Location'] + ': </label>\n'
dateAndLocation += '<input type="text" name="location">\n' dateAndLocation += '<input type="text" name="location">\n'
if endpoint == 'newevent': if endpoint == 'newevent':
dateAndLocation += '<br><label class="labels">' + \
translate['Ticket URL'] + ': </label>\n'
dateAndLocation += '<input type="text" name="ticketUrl">\n'
dateAndLocation += '<br><label class="labels">' + \ dateAndLocation += '<br><label class="labels">' + \
translate['Categories'] + ': </label>\n' translate['Categories'] + ': </label>\n'
dateAndLocation += '<input type="text" name="category">\n' dateAndLocation += '<input type="text" name="category">\n'