You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/10/05 17:10:15 UTC

[incubator-ponymail-foal] 01/02: Add login icon to admin page.

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

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

commit 4d7c552d8f548bb58bf353b36aed7400de51e0a9
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Oct 5 19:09:11 2021 +0200

    Add login icon to admin page.
---
 webui/admin.html        | 15 +++++++++++++++
 webui/js/ponymail.js    |  2 ++
 webui/js/source/mgmt.js |  2 ++
 3 files changed, 19 insertions(+)

diff --git a/webui/admin.html b/webui/admin.html
index 2d87cd6..018d5c0 100644
--- a/webui/admin.html
+++ b/webui/admin.html
@@ -47,6 +47,21 @@ the License. -->
       <a class="navbar-brand" href="./"><span><img src="images/foal.png" style="margin-top: -10px !important;" height="30"/>&nbsp;<span class='hidden-xs title'>Pony Mail!</span></a>
       </div>
 
+      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" style="float: left;">
+
+        <ul class="nav navbar-nav" id="userprefs" style="position: absolute; right: 18px;">
+          <li class="dropdown navbar-right" id="login">
+
+            <!-- user prefs -->
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img id="uimg" src="images/user_loggedout.png" style="width: 32px; margin-top: -4px;"  title="Not logged in"/>
+              <span class="caret"></span></a>
+            <ul class="dropdown-menu" id="prefs_dropdown">
+
+            </ul>
+          </li>
+        </ul>
+
+      </div>
 
     </div>
 
diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 3a9f96c..f1cb2b9 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -3082,6 +3082,8 @@ function admin_audit_next() {
 
 // Onload function for admin.html
 function admin_init() {
+    init_preferences(); // blank call to load defaults like social rendering
+    GET('%sapi/preferences.lua'.format(apiURL), init_preferences, null);
     GET('%sapi/preferences.lua'.format(apiURL), (state, json) => {mgmt_prefs = json}, null);
     let mid = location.href.split('/').pop();
     // Specific email/list handling?
diff --git a/webui/js/source/mgmt.js b/webui/js/source/mgmt.js
index b0f2b08..319e41e 100644
--- a/webui/js/source/mgmt.js
+++ b/webui/js/source/mgmt.js
@@ -401,6 +401,8 @@ function admin_audit_next() {
 
 // Onload function for admin.html
 function admin_init() {
+    init_preferences(); // blank call to load defaults like social rendering
+    GET('%sapi/preferences.lua'.format(apiURL), init_preferences, null);
     GET('%sapi/preferences.lua'.format(apiURL), (state, json) => {mgmt_prefs = json}, null);
     let mid = location.href.split('/').pop();
     // Specific email/list handling?