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,
fields['repliesModerationOption'],
anonymousParticipationEnabled,
fields['eventStatus'])
fields['eventStatus'],
fields['ticketUrl'])
if messageJson:
if fields['schedulePost']:
return 1

View File

@ -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)

View File

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

View File

@ -277,5 +277,6 @@
"Cancelled": "Cancel·lat",
"Event banner image description": "Descripció de la imatge del banner de lesdeveniment",
"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",
"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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

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

View File

@ -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"
}

View File

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

View File

@ -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"
}

View File

@ -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"
}

View File

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

View File

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

View File

@ -2167,6 +2167,9 @@ def htmlNewPost(mediaInstance: bool, translate: {},
translate['Location'] + ': </label>\n'
dateAndLocation += '<input type="text" name="location">\n'
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">' + \
translate['Categories'] + ': </label>\n'
dateAndLocation += '<input type="text" name="category">\n'