From 3b430d6780b4a3c74372bf1d0c01b36bb03dba29 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 16 Oct 2020 13:52:03 +0100 Subject: [PATCH] Add publish button --- 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 | 18 +++++++++++++----- 16 files changed, 43 insertions(+), 20 deletions(-) diff --git a/translations/ar.json b/translations/ar.json index 6d6e1ca22..603a17353 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -309,5 +309,6 @@ "Edit News Post": "تحرير منشور الأخبار", "A list of editor nicknames. One per line.": "قائمة بأسماء المحرر. واحد في كل سطر.", "Site Editors": "محررو الموقع", - "Allow news posts": "السماح بنشر الأخبار" + "Allow news posts": "السماح بنشر الأخبار", + "Publish": "ينشر" } diff --git a/translations/ca.json b/translations/ca.json index 33a3ee798..f8f82bba2 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -309,5 +309,6 @@ "Edit News Post": "Edita la publicació de notícies", "A list of editor nicknames. One per line.": "Una llista de sobrenoms de l'editor. Un per línia.", "Site Editors": "Editors de llocs", - "Allow news posts": "Permet publicacions de notícies" + "Allow news posts": "Permet publicacions de notícies", + "Publish": "Publica" } diff --git a/translations/cy.json b/translations/cy.json index d3ff8d095..c39c3014f 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -309,5 +309,6 @@ "Edit News Post": "Golygu News News", "A list of editor nicknames. One per line.": "Rhestr o lysenwau golygydd. Un i bob llinell.", "Site Editors": "Golygyddion Safle", - "Allow news posts": "Caniatáu swyddi newyddion" + "Allow news posts": "Caniatáu swyddi newyddion", + "Publish": "Cyhoeddi" } diff --git a/translations/de.json b/translations/de.json index 1129a9d11..2ce3fac07 100644 --- a/translations/de.json +++ b/translations/de.json @@ -309,5 +309,6 @@ "Edit News Post": "Nachrichtenbeitrag bearbeiten", "A list of editor nicknames. One per line.": "Eine Liste der Editor-Spitznamen. Eine pro Zeile.", "Site Editors": "Site-Editoren", - "Allow news posts": "Nachrichtenbeiträge zulassen" + "Allow news posts": "Nachrichtenbeiträge zulassen", + "Publish": "Veröffentlichen" } diff --git a/translations/en.json b/translations/en.json index de4893bab..9c5b4686f 100644 --- a/translations/en.json +++ b/translations/en.json @@ -309,5 +309,6 @@ "Edit News Post": "Edit News Post", "A list of editor nicknames. One per line.": "A list of editor nicknames. One per line.", "Site Editors": "Site Editors", - "Allow news posts": "Allow news posts" + "Allow news posts": "Allow news posts", + "Publish": "Publish" } diff --git a/translations/es.json b/translations/es.json index f8c4d3576..2edf00660 100644 --- a/translations/es.json +++ b/translations/es.json @@ -309,5 +309,6 @@ "Edit News Post": "Editar publicación de noticias", "A list of editor nicknames. One per line.": "Una lista de apodos de los editores. Uno por línea.", "Site Editors": "Editores del sitio", - "Allow news posts": "Permitir publicaciones de noticias" + "Allow news posts": "Permitir publicaciones de noticias", + "Publish": "Publicar" } diff --git a/translations/fr.json b/translations/fr.json index f9fdf312f..802c8550d 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -309,5 +309,6 @@ "Edit News Post": "Modifier l'article d'actualité", "A list of editor nicknames. One per line.": "Une liste de surnoms d'éditeur. Un par ligne.", "Site Editors": "Éditeurs du site", - "Allow news posts": "Autoriser les articles d'actualité" + "Allow news posts": "Autoriser les articles d'actualité", + "Publish": "Publier" } diff --git a/translations/ga.json b/translations/ga.json index 56d3d52b8..01181293e 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -309,5 +309,6 @@ "Edit News Post": "Cuir News Post in eagar", "A list of editor nicknames. One per line.": "Liosta leasainmneacha eagarthóra. Ceann in aghaidh na líne.", "Site Editors": "Eagarthóirí Suímh", - "Allow news posts": "Ceadaigh poist nuachta" + "Allow news posts": "Ceadaigh poist nuachta", + "Publish": "Fhoilsiú" } diff --git a/translations/hi.json b/translations/hi.json index 900ca3a0f..263272197 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -309,5 +309,6 @@ "Edit News Post": "समाचार पोस्ट संपादित करें", "A list of editor nicknames. One per line.": "संपादक उपनामों की एक सूची। प्रति पंक्ति एक।", "Site Editors": "साइट संपादकों", - "Allow news posts": "समाचार पोस्ट की अनुमति दें" + "Allow news posts": "समाचार पोस्ट की अनुमति दें", + "Publish": "प्रकाशित करना" } diff --git a/translations/it.json b/translations/it.json index 7ca28454c..e93791bac 100644 --- a/translations/it.json +++ b/translations/it.json @@ -309,5 +309,6 @@ "Edit News Post": "Modifica post di notizie", "A list of editor nicknames. One per line.": "Un elenco di soprannomi dell'editor. Uno per riga.", "Site Editors": "Editori del sito", - "Allow news posts": "Consenti post di notizie" + "Allow news posts": "Consenti post di notizie", + "Publish": "Pubblicare" } diff --git a/translations/ja.json b/translations/ja.json index 499ae2cb4..b02321f6a 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -309,5 +309,6 @@ "Edit News Post": "ニュース投稿を編集する", "A list of editor nicknames. One per line.": "編集者のニックネームのリスト。 1行に1つ。", "Site Editors": "サイト編集者", - "Allow news posts": "ニュース投稿を許可する" + "Allow news posts": "ニュース投稿を許可する", + "Publish": "公開する" } diff --git a/translations/oc.json b/translations/oc.json index 9f2745a36..aa45e85ac 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -305,5 +305,6 @@ "Edit News Post": "Edit News Post", "A list of editor nicknames. One per line.": "A list of editor nicknames. One per line.", "Site Editors": "Site Editors", - "Allow news posts": "Allow news posts" + "Allow news posts": "Allow news posts", + "Publish": "Publish" } diff --git a/translations/pt.json b/translations/pt.json index 096432607..e316fb199 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -309,5 +309,6 @@ "Edit News Post": "Editar Postagem de Notícias", "A list of editor nicknames. One per line.": "Uma lista de apelidos de editores. Um por linha.", "Site Editors": "Editores do site", - "Allow news posts": "Permitir postagens de notícias" + "Allow news posts": "Permitir postagens de notícias", + "Publish": "Publicar" } diff --git a/translations/ru.json b/translations/ru.json index a9d7e7a89..0452b6dfa 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -309,5 +309,6 @@ "Edit News Post": "Редактировать новость", "A list of editor nicknames. One per line.": "Список ников редакторов. По одному на строку.", "Site Editors": "Редакторы сайта", - "Allow news posts": "Разрешить публикации новостей" + "Allow news posts": "Разрешить публикации новостей", + "Publish": "Публиковать" } diff --git a/translations/zh.json b/translations/zh.json index 7e6297e43..9ed983313 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -309,5 +309,6 @@ "Edit News Post": "编辑新闻帖子", "A list of editor nicknames. One per line.": "编辑者昵称列表。 每行一个。", "Site Editors": "网站编辑", - "Allow news posts": "允许新闻发布" + "Allow news posts": "允许新闻发布", + "Publish": "发布" } diff --git a/webinterface.py b/webinterface.py index 3b00a06fa..fb17ff9be 100644 --- a/webinterface.py +++ b/webinterface.py @@ -3568,7 +3568,7 @@ def htmlProfile(defaultTimeline: str, httpPrefix, translate, iconsDir, False, False, newswire, False, - False, None) + False, None, False) profileFooterStr += ' \n' profileFooterStr += ' \n' profileFooterStr += ' \n' @@ -5589,7 +5589,7 @@ def votesIndicator(totalVotes: int, positiveVoting: bool) -> str: return totalVotesStr -def htmlNewswire(newswire: str, nickname: str, moderator: bool, +def htmlNewswire(newswire: {}, nickname: str, moderator: bool, translate: {}, positiveVoting: bool, iconsDir: str) -> str: """Converts a newswire dict into html """ @@ -5660,7 +5660,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, httpPrefix: str, translate: {}, iconsDir: str, moderator: bool, editor: bool, newswire: {}, positiveVoting: bool, - showBackButton: bool, timelinePath: str) -> str: + showBackButton: bool, timelinePath: str, + showPublishButton: bool) -> str: """Returns html content for the right column """ htmlStr = '' @@ -5703,6 +5704,13 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, '\n' + if showPublishButton: + htmlStr += \ + ' ' + \ + '\n' + if editor: if os.path.isfile(baseDir + '/accounts/newswiremoderation.txt'): # show the edit icon highlighted @@ -5820,7 +5828,7 @@ def htmlNewswireMobile(baseDir: str, nickname: str, httpPrefix, translate, iconsDir, moderator, editor, newswire, positiveVoting, - True, timelinePath) + True, timelinePath, True) htmlStr += htmlFooter() return htmlStr @@ -6507,7 +6515,7 @@ def htmlTimeline(defaultTimeline: str, httpPrefix, translate, iconsDir, moderator, editor, newswire, positiveVoting, - False, None) + False, None, True) tlStr += ' ' + \ rightColumnStr + ' \n' tlStr += ' \n'