From 385b37ed4afc7ccc04d76d4b4646fdc40a8c6b6e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 22 Aug 2020 14:40:48 +0100 Subject: [PATCH] Adding new event screen --- daemon.py | 6 +++- translations/ar.json | 12 +++++++- translations/ca.json | 12 +++++++- translations/cy.json | 12 +++++++- translations/de.json | 12 +++++++- translations/en.json | 12 +++++++- translations/es.json | 12 +++++++- translations/fr.json | 12 +++++++- translations/ga.json | 12 +++++++- translations/hi.json | 12 +++++++- translations/it.json | 12 +++++++- translations/ja.json | 12 +++++++- translations/oc.json | 12 +++++++- translations/pt.json | 12 +++++++- translations/ru.json | 12 +++++++- translations/zh.json | 12 +++++++- webinterface.py | 72 +++++++++++++++++++++++++++++++++++++------- 17 files changed, 231 insertions(+), 27 deletions(-) diff --git a/daemon.py b/daemon.py index c11e4c54..f6330ead 100644 --- a/daemon.py +++ b/daemon.py @@ -5525,6 +5525,10 @@ class PubServer(BaseHTTPRequestHandler): commentsEnabled = False else: commentsEnabled = True + if not fields.get('privateEvent'): + privateEvent = False + else: + privateEvent = True if postType == 'newpost': messageJson = \ createPublicPost(self.server.baseDir, @@ -5744,7 +5748,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, self.server.httpPrefix, mentionsStr + fields['message'], - fields['followersOnlyEvent'], + privateEvent, False, False, commentsEnabled, filename, attachmentMediaType, fields['imageDescription'], diff --git a/translations/ar.json b/translations/ar.json index 9968a7e6..0179e241 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -258,5 +258,15 @@ "Notes": "ملاحظات", "Allow replies.": "السماح بالردود.", "Event": "حدث", - "Create an event": "أنشئ حدثًا" + "Create an event": "أنشئ حدثًا", + "Describe the event": "صف الحدث", + "Start Date": "تاريخ البدء", + "End Date": "تاريخ الانتهاء", + "Categories": "التصنيفات", + "This is a private event.": "هذا هو الحدث الخاص.", + "Allow anonymous participation.": "السماح بالمشاركة المجهولة.", + "Anyone can join": "يمكن لأي شخص الانضمام", + "Apply to join": "تقديم طلب للانضمام", + "Invitation only": "المدعوون فقط", + "Joining": "انضمام" } diff --git a/translations/ca.json b/translations/ca.json index 1f670ff2..4e552fab 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -258,5 +258,15 @@ "Notes": "Notes", "Allow replies.": "Permetre respostes.", "Event": "Esdeveniment", - "Create an event": "Crea un esdeveniment" + "Create an event": "Crea un esdeveniment", + "Describe the event": "Descriviu l’esdeveniment", + "Start Date": "Data d'inici", + "End Date": "Data de finalització", + "Categories": "Categories", + "This is a private event.": "Aquest és un esdeveniment privat.", + "Allow anonymous participation.": "Permet una participació anònima.", + "Anyone can join": "Qualsevol persona s’hi pot apuntar", + "Apply to join": "Sol·liciteu participar", + "Invitation only": "Només invitació", + "Joining": "Unir-se" } diff --git a/translations/cy.json b/translations/cy.json index 2d148bce..c1a47db0 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -258,5 +258,15 @@ "Notes": "Nodiadau", "Allow replies.": "Caniatáu atebion.", "Event": "Digwyddiad", - "Create an event": "Creu digwyddiad" + "Create an event": "Creu digwyddiad", + "Describe the event": "Disgrifiwch y digwyddiad", + "Start Date": "Dyddiad cychwyn", + "End Date": "Dyddiad Gorffen", + "Categories": "Categorïau", + "This is a private event.": "Digwyddiad preifat yw hwn.", + "Allow anonymous participation.": "Caniatáu cyfranogiad dienw.", + "Anyone can join": "Gall unrhyw un ymuno", + "Apply to join": "Gwnewch gais i ymuno", + "Invitation only": "Gwahoddiad yn unig", + "Joining": "Yn ymuno" } diff --git a/translations/de.json b/translations/de.json index 16773b7c..d3a67ebb 100644 --- a/translations/de.json +++ b/translations/de.json @@ -258,5 +258,15 @@ "Notes": "Anmerkungen", "Allow replies.": "Antworten zulassen.", "Event": "Veranstaltung", - "Create an event": "Erstellen Sie ein Ereignis" + "Create an event": "Erstellen Sie ein Ereignis", + "Describe the event": "Beschreiben Sie das Ereignis", + "Start Date": "Anfangsdatum", + "End Date": "Endtermin", + "Categories": "Kategorien", + "This is a private event.": "Dies ist eine private Veranstaltung.", + "Allow anonymous participation.": "Anonyme Teilnahme zulassen.", + "Anyone can join": "Jeder kann mitmachen", + "Apply to join": "Sich anmelden um teilzunehmen", + "Invitation only": "Nur Einladungen", + "Joining": "Beitritt" } diff --git a/translations/en.json b/translations/en.json index 955c3f67..f06e079a 100644 --- a/translations/en.json +++ b/translations/en.json @@ -258,5 +258,15 @@ "Notes": "Notes", "Allow replies.": "Allow replies.", "Event": "Event", - "Create an event": "Create an event" + "Create an event": "Create an event", + "Describe the event": "Describe the event", + "Start Date": "Start Date", + "End Date": "End Date", + "Categories": "Categories", + "This is a private event.": "This is a private event.", + "Allow anonymous participation.": "Allow anonymous participation.", + "Anyone can join": "Anyone can join", + "Apply to join": "Apply to join", + "Invitation only": "Invitation only", + "Joining": "Joining" } diff --git a/translations/es.json b/translations/es.json index c960362c..992e086c 100644 --- a/translations/es.json +++ b/translations/es.json @@ -258,5 +258,15 @@ "Notes": "Notas", "Allow replies.": "Permitir respuestas.", "Event": "Evento", - "Create an event": "Crea un evento" + "Create an event": "Crea un evento", + "Describe the event": "Describe el evento", + "Start Date": "Fecha de inicio", + "End Date": "Fecha final", + "Categories": "Categorías", + "This is a private event.": "Este es un evento privado.", + "Allow anonymous participation.": "Permitir la participación anónima.", + "Anyone can join": "Cualquiera puede unirse", + "Apply to join": "Aplica para unirte", + "Invitation only": "Sólo con Invitación", + "Joining": "Unión" } diff --git a/translations/fr.json b/translations/fr.json index 003cef88..2b059550 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -258,5 +258,15 @@ "Notes": "Remarques", "Allow replies.": "Autoriser les réponses.", "Event": "un événement", - "Create an event": "Créer un événement" + "Create an event": "Créer un événement", + "Describe the event": "Décrivez l'événement", + "Start Date": "Date de début", + "End Date": "Date de fin", + "Categories": "Catégories", + "This is a private event.": "Ceci est un événement privé.", + "Allow anonymous participation.": "Autorisez la participation anonyme.", + "Anyone can join": "Tout le monde peut joindre", + "Apply to join": "Postuler pour rejoindre", + "Invitation only": "Invitation uniquement", + "Joining": "Joindre" } diff --git a/translations/ga.json b/translations/ga.json index 2e6981a5..012cd257 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -258,5 +258,15 @@ "Notes": "Nótaí", "Allow replies.": "Ceadaigh freagraí.", "Event": "Imeacht", - "Create an event": "Cruthaigh imeacht" + "Create an event": "Cruthaigh imeacht", + "Describe the event": "Déan cur síos ar an ócáid", + "Start Date": "Dáta tosaigh", + "End Date": "Dáta deiridh", + "Categories": "Catagóirí", + "This is a private event.": "Is ócáid phríobháideach é seo.", + "Allow anonymous participation.": "Lig rannpháirtíocht gan ainm.", + "Anyone can join": "Is féidir le duine ar bith a bheith páirteach", + "Apply to join": "Déan iarratas ar bhallraíocht", + "Invitation only": "Cuireadh amháin", + "Joining": "Ag teacht le chéile" } diff --git a/translations/hi.json b/translations/hi.json index 85f5690a..94f61656 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -258,5 +258,15 @@ "Notes": "टिप्पणियाँ", "Allow replies.": "जवाब दें।", "Event": "प्रतिस्पर्धा", - "Create an event": "एक घटना बनाएँ" + "Create an event": "एक घटना बनाएँ", + "Describe the event": "घटना का वर्णन करें", + "Start Date": "आरंभ करने की तिथि", + "End Date": "अंतिम तिथि", + "Categories": "श्रेणियाँ", + "This is a private event.": "यह एक निजी कार्यक्रम है।", + "Allow anonymous participation.": "अनाम भागीदारी की अनुमति दें।", + "Anyone can join": "कोई भी शामिल हो सकता है", + "Apply to join": "जुड़ने के लिए आवेदन करें", + "Invitation only": "केवल आमंत्रण", + "Joining": "में शामिल होने से" } diff --git a/translations/it.json b/translations/it.json index 24c97411..a09cee38 100644 --- a/translations/it.json +++ b/translations/it.json @@ -258,5 +258,15 @@ "Notes": "Appunti", "Allow replies.": "Consenti risposte.", "Event": "Evento", - "Create an event": "Crea un evento" + "Create an event": "Crea un evento", + "Describe the event": "Descrivi l'evento", + "Start Date": "Data d'inizio", + "End Date": "Data di fine", + "Categories": "Categorie", + "This is a private event.": "Questo è un evento privato.", + "Allow anonymous participation.": "Consenti la partecipazione anonima.", + "Anyone can join": "Chiunque può partecipare", + "Apply to join": "Richiedi di partecipare", + "Invitation only": "Solo su invito", + "Joining": "Partecipare" } diff --git a/translations/ja.json b/translations/ja.json index f565dcef..e20f14b7 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -258,5 +258,15 @@ "Notes": "ノート", "Allow replies.": "返信を許可します。", "Event": "イベント", - "Create an event": "イベントを作成する" + "Create an event": "イベントを作成する", + "Describe the event": "イベントについて説明する", + "Start Date": "開始日", + "End Date": "終了日", + "Categories": "カテゴリー", + "This is a private event.": "これはプライベートイベントです。", + "Allow anonymous participation.": "匿名参加を許可します。", + "Anyone can join": "誰でも参加できます", + "Apply to join": "参加を申し込む", + "Invitation only": "招待のみ", + "Joining": "接合" } diff --git a/translations/oc.json b/translations/oc.json index 26464498..7c9a8d62 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -254,5 +254,15 @@ "Notes": "Notes", "Allow replies.": "Allow replies.", "Event": "Event", - "Create an event": "Create an event" + "Create an event": "Create an event", + "Describe the event": "Describe the event", + "Start Date": "Start Date", + "End Date": "End Date", + "Categories": "Categories", + "This is a private event.": "This is a private event.", + "Allow anonymous participation.": "Allow anonymous participation.", + "Anyone can join": "Anyone can join", + "Apply to join": "Apply to join", + "Invitation only": "Invitation only", + "Joining": "Joining" } diff --git a/translations/pt.json b/translations/pt.json index f7cd8b5d..605d4478 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -258,5 +258,15 @@ "Notes": "Notas", "Allow replies.": "Permitir respostas.", "Event": "Evento", - "Create an event": "Crie um evento" + "Create an event": "Crie um evento", + "Describe the event": "Descreva o evento", + "Start Date": "Data de início", + "End Date": "Data final", + "Categories": "Categorias", + "This is a private event.": "Este é um evento privado.", + "Allow anonymous participation.": "Permita a participação anônima.", + "Anyone can join": "Qualquer um pode participar", + "Apply to join": "Aplicar para participar", + "Invitation only": "Somente para convidados", + "Joining": "Juntando" } diff --git a/translations/ru.json b/translations/ru.json index e48c01d3..f85f966f 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -258,5 +258,15 @@ "Notes": "Ноты", "Allow replies.": "Разрешить ответы.", "Event": "Мероприятие", - "Create an event": "Создать мероприятие" + "Create an event": "Создать мероприятие", + "Describe the event": "Опишите событие", + "Start Date": "Дата начала", + "End Date": "Дата окончания", + "Categories": "Категории", + "This is a private event.": "Это частное мероприятие.", + "Allow anonymous participation.": "Разрешить анонимное участие.", + "Anyone can join": "Каждый может присоединиться", + "Apply to join": "Подать заявку на присоединение", + "Invitation only": "Только приглашение", + "Joining": "Присоединение" } diff --git a/translations/zh.json b/translations/zh.json index 18bdeba7..c3319d02 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -258,5 +258,15 @@ "Notes": "笔记", "Allow replies.": "允许回复。", "Event": "事件", - "Create an event": "建立活动" + "Create an event": "建立活动", + "Describe the event": "描述事件", + "Start Date": "开始日期", + "End Date": "结束日期", + "Categories": "分类目录", + "This is a private event.": "这是私人活动。", + "Allow anonymous participation.": "允许匿名参与。", + "Anyone can join": "任何人都可以加入", + "Apply to join": "申请加入", + "Invitation only": "仅邀请", + "Joining": "加盟" } diff --git a/webinterface.py b/webinterface.py index 465a4abf..abb5fee7 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1920,6 +1920,7 @@ def htmlNewPost(mediaInstance: bool, translate: {}, pathBase = path.replace('/newreport', '').replace('/newpost', '') pathBase = pathBase.replace('/newblog', '').replace('/newshare', '') pathBase = pathBase.replace('/newunlisted', '') + pathBase = pathBase.replace('/newevent', '') pathBase = pathBase.replace('/newreminder', '') pathBase = pathBase.replace('/newfollowers', '').replace('/newdm', '') @@ -1969,6 +1970,12 @@ def htmlNewPost(mediaInstance: bool, translate: {}, scopeIcon = 'scope_reminder.png' scopeDescription = translate['Reminder'] endpoint = 'newreminder' + elif path.endswith('/newevent'): + scopeIcon = 'scope_event.png' + scopeDescription = translate['Event'] + endpoint = 'newevent' + placeholderSubject = translate['Title'] + '...' + placeholderMessage = translate['Describe the event'] + '...' elif path.endswith('/newreport'): scopeIcon = 'scope_report.png' scopeDescription = translate['Report'] @@ -2029,12 +2036,25 @@ def htmlNewPost(mediaInstance: bool, translate: {}, endpoint != 'newquestion': dateAndLocation = '
' - dateAndLocation += \ - '

\n' + if endpoint == 'newevent': + # Event posts don't allow replies - they're just an announcement. + # They also have a few more checkboxes + dateAndLocation += \ + '

\n' + dateAndLocation += \ + '

' + \ + '

\n' + else: + dateAndLocation += \ + '

\n' - if not inReplyTo: + if not inReplyTo and endpoint != 'newevent': dateAndLocation += \ '

\n' - dateAndLocation += '\n' - dateAndLocation += '\n' - dateAndLocation += '

\n' + + if endpoint != 'newevent': + # select a date and time for this post + dateAndLocation += '\n' + dateAndLocation += '\n' + dateAndLocation += '

\n' + else: + # select start time for the event + dateAndLocation += '\n' + dateAndLocation += '\n' + dateAndLocation += '

\n' + # select end time for the event + dateAndLocation += \ + '

\n' + dateAndLocation += '\n' + dateAndLocation += '\n' + dateAndLocation += '

\n' + dateAndLocation += '
\n' dateAndLocation += '
\n' dateAndLocation += '
\n' dateAndLocation += '\n' + if endpoint == 'newevent': + dateAndLocation += '
\n' + dateAndLocation += '\n' dateAndLocation += '
\n' newPostForm = htmlHeader(cssFilename, newPostCSS)