\n'
# second row of buttons for moderator actions
if moderator and boxName == 'moderation':
From c113ca088b3e77be710dd069cbc58c00ac6836ba Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Wed, 30 Sep 2020 21:20:08 +0100
Subject: [PATCH 012/147] Indentaton
---
webinterface.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/webinterface.py b/webinterface.py
index 5c7e2f500..151a07f7a 100644
--- a/webinterface.py
+++ b/webinterface.py
@@ -4155,11 +4155,11 @@ def individualPostAsHtml(allowDownloads: bool,
nickname + '?options=' + postActor + \
';' + str(pageNumber) + ';' + avatarUrl + messageIdStr + '">\n'
avatarLink += \
- ' \n'
avatarImageInPost = \
- '
' + avatarLink.strip() + '
\n'
+ '
' + avatarLink.strip() + '
\n'
# don't create new html within the bookmarks timeline
# it should already have been created for the inbox
@@ -4615,6 +4615,7 @@ def individualPostAsHtml(allowDownloads: bool,
if announceAvatarUrl:
idx = 'Show options for this person'
replyAvatarImageInPost = \
+ ' ' \
'
\n'
# benchmark 9
timeDiff = int((time.time() - timelineStartTime) * 1000)
From 3e26f5f7459d220eb3ce68a938a320484b9d796e Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Thu, 1 Oct 2020 18:26:21 +0100
Subject: [PATCH 057/147] Edit links button
---
epicyon-profile.css | 17 ++++++++
translations/ar.json | 4 +-
translations/ca.json | 4 +-
translations/cy.json | 4 +-
translations/de.json | 4 +-
translations/en.json | 4 +-
translations/es.json | 4 +-
translations/fr.json | 4 +-
translations/ga.json | 4 +-
translations/hi.json | 4 +-
translations/it.json | 4 +-
translations/ja.json | 4 +-
translations/oc.json | 4 +-
translations/pt.json | 4 +-
translations/ru.json | 4 +-
translations/zh.json | 4 +-
webinterface.py | 101 ++++++++++++++++++++++++++++++++++++++++---
17 files changed, 157 insertions(+), 21 deletions(-)
diff --git a/epicyon-profile.css b/epicyon-profile.css
index 14ca13dd5..5ae53f19f 100644
--- a/epicyon-profile.css
+++ b/epicyon-profile.css
@@ -131,6 +131,23 @@ a, u {
color: var(--main-fg-color);
}
+.editLinksBtn {
+ border-radius: var(--button-corner-radius);
+ background-color: var(--button-background);
+ border: none;
+ color: var(--button-text);
+ text-align: center;
+ font-size: var(--font-size-header);
+ font-family: Arial, Helvetica, sans-serif;
+ padding: var(--button-height-padding);
+ width: 90%;
+ max-width: 200px;
+ min-width: 10ch;
+ transition: all 0.5s;
+ cursor: pointer;
+ margin: 5px;
+}
+
a:visited{
color: var(--main-visited-color);
background: var(--link-bg-color);
diff --git a/translations/ar.json b/translations/ar.json
index 3dca12e14..4e69f6281 100644
--- a/translations/ar.json
+++ b/translations/ar.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "تحذيرات المحتوى المُنشأ تلقائيًا",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag محظور",
- "This is a blogging instance": "هذا مثال على المدونات"
+ "This is a blogging instance": "هذا مثال على المدونات",
+ "Edit Links": "تحرير الارتباطات",
+ "One link per line. Description followed by the link.": "رابط واحد في كل سطر. الوصف متبوع بالرابط."
}
diff --git a/translations/ca.json b/translations/ca.json
index 017176036..11d3b6d20 100644
--- a/translations/ca.json
+++ b/translations/ca.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Advertiments de contingut autogenerats",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloquejat",
- "This is a blogging instance": "Aquesta és una instància de blocs"
+ "This is a blogging instance": "Aquesta és una instància de blocs",
+ "Edit Links": "Edita els enllaços",
+ "One link per line. Description followed by the link.": "Un enllaç per línia. Descripció seguida de l'enllaç."
}
diff --git a/translations/cy.json b/translations/cy.json
index 650520988..af176ce07 100644
--- a/translations/cy.json
+++ b/translations/cy.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Rhybuddion Cynnwys Autogenerated",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag wedi'i Blocio",
- "This is a blogging instance": "Dyma enghraifft blogio"
+ "This is a blogging instance": "Dyma enghraifft blogio",
+ "Edit Links": "Golygu Dolenni",
+ "One link per line. Description followed by the link.": "Un dolen y llinell. Disgrifiad wedi'i ddilyn gan y ddolen."
}
diff --git a/translations/de.json b/translations/de.json
index 619f00cf3..2ba4f5272 100644
--- a/translations/de.json
+++ b/translations/de.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Warnungen vor automatisch generierten Inhalten",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag blockiert",
- "This is a blogging instance": "Dies ist eine Blogging-Instanz"
+ "This is a blogging instance": "Dies ist eine Blogging-Instanz",
+ "Edit Links": "Links bearbeiten",
+ "One link per line. Description followed by the link.": "Ein Link pro Zeile. Beschreibung gefolgt vom Link."
}
diff --git a/translations/en.json b/translations/en.json
index ff911e7dc..6beb40bb5 100644
--- a/translations/en.json
+++ b/translations/en.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Autogenerated Content Warnings",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag Blocked",
- "This is a blogging instance": "This is a blogging instance"
+ "This is a blogging instance": "This is a blogging instance",
+ "Edit Links": "Edit Links",
+ "One link per line. Description followed by the link.": "One link per line. Description followed by the link."
}
diff --git a/translations/es.json b/translations/es.json
index 00dc1ab3e..937b3e01d 100644
--- a/translations/es.json
+++ b/translations/es.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Advertencias de contenido generado automáticamente",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloqueada",
- "This is a blogging instance": "Esta es una instancia de blogs"
+ "This is a blogging instance": "Esta es una instancia de blogs",
+ "Edit Links": "Editar enlaces",
+ "One link per line. Description followed by the link.": "Un enlace por línea. Descripción seguida del enlace."
}
diff --git a/translations/fr.json b/translations/fr.json
index 8318d3a31..c3a82bdfd 100644
--- a/translations/fr.json
+++ b/translations/fr.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Avertissements de contenu générés automatiquement",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloqué",
- "This is a blogging instance": "Ceci est une instance de blog"
+ "This is a blogging instance": "Ceci est une instance de blog",
+ "Edit Links": "Modifier les liens",
+ "One link per line. Description followed by the link.": "Un lien par ligne. Description suivie du lien."
}
diff --git a/translations/ga.json b/translations/ga.json
index 96c8f1977..8bcab8a68 100644
--- a/translations/ga.json
+++ b/translations/ga.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Rabhaidh Ábhar Uathghinte",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag Blocáilte",
- "This is a blogging instance": "Seo sampla blagála"
+ "This is a blogging instance": "Seo sampla blagála",
+ "Edit Links": "Cuir Naisc in eagar",
+ "One link per line. Description followed by the link.": "Nasc amháin in aghaidh an líne. Cur síos agus an nasc ina dhiaidh sin."
}
diff --git a/translations/hi.json b/translations/hi.json
index 6a6c7a6aa..d8366327a 100644
--- a/translations/hi.json
+++ b/translations/hi.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "स्वतः प्राप्त सामग्री चेतावनी",
"Indymedia": "Indymedia",
"Hashtag Blocked": "हैशटैग अवरुद्ध",
- "This is a blogging instance": "यह एक ब्लॉगिंग उदाहरण है"
+ "This is a blogging instance": "यह एक ब्लॉगिंग उदाहरण है",
+ "Edit Links": "लिंक संपादित करें",
+ "One link per line. Description followed by the link.": "प्रति पंक्ति एक लिंक। लिंक के बाद विवरण।"
}
diff --git a/translations/it.json b/translations/it.json
index 63c0d3c87..788f2eef2 100644
--- a/translations/it.json
+++ b/translations/it.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Avvisi sui contenuti generati automaticamente",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloccato",
- "This is a blogging instance": "Questa è un'istanza di blog"
+ "This is a blogging instance": "Questa è un'istanza di blog",
+ "Edit Links": "Modifica collegamenti",
+ "One link per line. Description followed by the link.": "Un collegamento per riga. Descrizione seguita dal collegamento."
}
diff --git a/translations/ja.json b/translations/ja.json
index 9849e09bf..7e1aa4a08 100644
--- a/translations/ja.json
+++ b/translations/ja.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "自動生成されたコンテンツの警告",
"Indymedia": "Indymedia",
"Hashtag Blocked": "ハッシュタグがブロックされました",
- "This is a blogging instance": "これはブログのインスタンスです"
+ "This is a blogging instance": "これはブログのインスタンスです",
+ "Edit Links": "リンクの編集",
+ "One link per line. Description followed by the link.": "1行に1つのリンク。 説明の後にリンクが続きます。"
}
diff --git a/translations/oc.json b/translations/oc.json
index 196cfb829..76d2807c2 100644
--- a/translations/oc.json
+++ b/translations/oc.json
@@ -284,5 +284,7 @@
"Autogenerated Content Warnings": "Autogenerated Content Warnings",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag Blocked",
- "This is a blogging instance": "This is a blogging instance"
+ "This is a blogging instance": "This is a blogging instance",
+ "Edit Links": "Edit Links",
+ "One link per line. Description followed by the link.": "One link per line. Description followed by the link."
}
diff --git a/translations/pt.json b/translations/pt.json
index 8c7535c9f..6b5c23bdd 100644
--- a/translations/pt.json
+++ b/translations/pt.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Avisos de conteúdo gerado automaticamente",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloqueada",
- "This is a blogging instance": "Esta é uma instância de blog"
+ "This is a blogging instance": "Esta é uma instância de blog",
+ "Edit Links": "Editar Links",
+ "One link per line. Description followed by the link.": "Um link por linha. Descrição seguida pelo link."
}
diff --git a/translations/ru.json b/translations/ru.json
index acacc35f6..16ff64360 100644
--- a/translations/ru.json
+++ b/translations/ru.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "Автоматические предупреждения о содержании",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Хештег заблокирован",
- "This is a blogging instance": "Это экземпляр блога"
+ "This is a blogging instance": "Это экземпляр блога",
+ "Edit Links": "Редактировать ссылки",
+ "One link per line. Description followed by the link.": "По одной ссылке в строке. Описание с последующей ссылкой."
}
diff --git a/translations/zh.json b/translations/zh.json
index 606ade752..b09145a61 100644
--- a/translations/zh.json
+++ b/translations/zh.json
@@ -288,5 +288,7 @@
"Autogenerated Content Warnings": "自动生成的内容警告",
"Indymedia": "Indymedia",
"Hashtag Blocked": "标签被阻止",
- "This is a blogging instance": "这是一个博客实例"
+ "This is a blogging instance": "这是一个博客实例",
+ "Edit Links": "编辑连结",
+ "One link per line. Description followed by the link.": "每行一个链接。 描述,然后是链接。"
}
diff --git a/webinterface.py b/webinterface.py
index fba7e676d..59706b6c7 100644
--- a/webinterface.py
+++ b/webinterface.py
@@ -1206,6 +1206,79 @@ def scheduledPostsExist(baseDir: str, nickname: str, domain: str) -> bool:
return False
+def htmlEditLinks(translate: {}, baseDir: str, path: str,
+ domain: str, port: int, httpPrefix: str) -> str:
+ """Shows the edit links screen
+ """
+ if '/users/' not in path:
+ return ''
+ pathOriginal = path
+ path = path.replace('/inbox', '').replace('/outbox', '')
+ path = path.replace('/shares', '')
+
+ nickname = getNicknameFromActor(path)
+ if not nickname:
+ return ''
+
+ domainFull = domain
+ if port:
+ if port != 80 and port != 443:
+ if ':' not in domain:
+ domainFull = domain + ':' + str(port)
+
+ # is the user a moderator?
+ if not isModerator(baseDir, nickname):
+ return ''
+
+ cssFilename = baseDir + '/epicyon-links.css'
+ if os.path.isfile(baseDir + '/links.css'):
+ cssFilename = baseDir + '/links.css'
+ with open(cssFilename, 'r') as cssFile:
+ editCSS = cssFile.read()
+ if httpPrefix != 'https':
+ editCSS = \
+ editCSS.replace('https://', httpPrefix + '://')
+
+ editLinksForm = htmlHeader(cssFilename, editCSS)
+ editLinksForm += \
+ '