This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new abb7d85  Add missing admin button to non-social view
abb7d85 is described below

commit abb7d85f8c915b29c87b9f2b26f504c4b39a0ad0
Author: Sebb <[email protected]>
AuthorDate: Fri Sep 24 16:41:43 2021 +0100

    Add missing admin button to non-social view
---
 webui/js/ponymail.js            | 13 +++++++++++++
 webui/js/source/render-email.js | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 25f7480..178409b 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -3493,6 +3493,19 @@ async function render_email(state, json) {
     }, ' '));
     toolbar.inject(sourcebutton);
 
+    // Admin button?
+    if (ponymail_preferences.login && ponymail_preferences.login.credentials 
&& ponymail_preferences.login.credentials.admin) {
+        let adminbutton = new HTML('a', {
+            href: 'admin/%s'.format(json.mid),
+            target: '_self',
+            title: "Modify email",
+            class: 'btn toolbar_btn toolbar_button_admin'
+        }, new HTML('span', {
+            class: 'glyphicon glyphicon-cog'
+        }, ' '));
+        toolbar.inject(adminbutton);
+    }
+
     text.inject(toolbar);
 }
 
diff --git a/webui/js/source/render-email.js b/webui/js/source/render-email.js
index d327569..7c2868e 100644
--- a/webui/js/source/render-email.js
+++ b/webui/js/source/render-email.js
@@ -164,6 +164,19 @@ async function render_email(state, json) {
     }, ' '));
     toolbar.inject(sourcebutton);
 
+    // Admin button?
+    if (ponymail_preferences.login && ponymail_preferences.login.credentials 
&& ponymail_preferences.login.credentials.admin) {
+        let adminbutton = new HTML('a', {
+            href: 'admin/%s'.format(json.mid),
+            target: '_self',
+            title: "Modify email",
+            class: 'btn toolbar_btn toolbar_button_admin'
+        }, new HTML('span', {
+            class: 'glyphicon glyphicon-cog'
+        }, ' '));
+        toolbar.inject(adminbutton);
+    }
+
     text.inject(toolbar);
 }
 

Reply via email to