]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Move footer to leftnav. Only show if screen height >650px.
authorBram Matthys <redacted>
Mon, 17 Apr 2023 15:29:21 +0000 (17:29 +0200)
committerBram Matthys <redacted>
Mon, 17 Apr 2023 15:30:54 +0000 (17:30 +0200)
Suggested by Madriix in https://github.com/unrealircd/unrealircd-webpanel/pull/25
(but done a bit differently by me)

Ideally this 650px would not be hardcoded and it would detect if
the menu would overflow into the "footer", eg if you have X plugins
loaded. But for now this is fine and allows about 3 items more
so we're OK.. for now.

css/unrealircd-admin.css
footer.php
header.php
plugins/file_auth/file_auth.php
plugins/sql_auth/sql_auth.php

index 09e6783443b914347d2089c072ecffdb871814cf..db859850588a743692c9420a6bfcea0974f45540 100644 (file)
@@ -53,6 +53,7 @@ footer {
        bottom: 0;
        width: 100%;
        height: 55px;
+       display: none !important;
   }
 
 .topnav {
@@ -248,3 +249,19 @@ body {
   text-align: center;
   font-size: 1rem;
 }
+
+/* Show version and 4-icons "footer" at bottom-left,
+ * if screen height is sufficient.
+ */
+@media only screen and (min-height: 650px) {
+    footer {
+        float: left;
+        width: 160px;
+        height: 60px;
+        display: block !important;
+    }
+
+    #sidebarlol {
+        height: calc(100% - 60px - 50px);
+    }
+}
index 930b6d6750da7f1cd6fc73fffb7ecd30793dfe87..6b1f1a114c0422de686ff798147f57cbe1ce22b4 100644 (file)
@@ -1,37 +1,41 @@
-<footer class="text-center bg-dark text-white fixed-bottom d-none d-md-block"  style="background-color: #f1f1f1;">
+<footer class="text-center bg-dark text-white fixed-bottom" style="background-color: #f1f1f1;">
        <!-- Grid container -->
        <div class="container">
                <!-- Section: Social media -->
-               
-               <?php $arr = []; Hook::run(HOOKTYPE_PRE_FOOTER, $arr); ?>
 
-               <section class="mt-1">
-               <a href="https://unrealircd.org/" class="btn btn-default" style="color:white">© 1999-<?php echo date('Y'); ?> UnrealIRCd</a>
+               <?php
+                       $arr = []; Hook::run(HOOKTYPE_PRE_FOOTER, $arr);
+                       echo "<small style=\"font-size: 70%\"><code>Admin Panel ".WEBPANEL_VERSION."</code></small>";
+               ?>
 
+               <section class="mt-1">
                        <!-- Twitter -->
                        <a
-                               class="btn btn-link btn-floating btn-lg text-white"
+                               class="btn btn-link btn-floating btn-md text-white"
                                href="https://twitter.com/Unreal_IRCd"
                                role="button"
                                data-mdb-ripple-color="dark"
+                               target="_blank"
                                ><i class="fab fa-twitter"></i
                        ></a>
                        <!-- Github -->
                        <a
-                               class="btn btn-link btn-floating btn-lg text-white"
+                               class="btn btn-link btn-floating btn-md text-white"
                                href="https://github.com/unrealircd/unrealircd-webpanel"
                                role="button"
                                data-mdb-ripple-color="dark"
+                               target="_blank"
                                ><i style="margin-left: -18px" class="fab fa-github"></i
                        ></a>
                        <!-- UnrealIRCd -->
                        <a
                                href="https://unrealircd.org"
                                role="button"
-                               data-mdb-ripple-color="dark">
-                               <img src="<?php echo get_config("base_url"); ?>img/unreal.jpg" width="23" height="23" style="margin-right: 25px"></a>
+                               data-mdb-ripple-color="dark"
+                               target="_blank">
+                               <img src="<?php echo get_config("base_url"); ?>img/unreal.jpg" width="16" height="16" style="margin-left: -7px; margin-right: 24px"></a>
 
-                       <i id="bugreport" style="margin-left: -18px; margin-right: 10px;" height="1000px" class="fa fa-bug" data-toggle="tooltip" data-placement="top" title="Report a bug (Opens in new tab)"></i>
+                       <i id="bugreport" style="margin-left: -18px; margin-right: 10px;" height="10px" class="fa fa-bug" data-toggle="tooltip" data-placement="top" title="Report a bug (Opens in new tab)"></i>
                
                <?php
 
index c0b18290c0104f23a66269705968962e6b500046..61c297e26aa3a860a25e492734fb9f193a0a48d8 100644 (file)
@@ -215,4 +215,4 @@ foreach ($pages as $name => $page)
        window.addEventListener('resize', function() {
                nav_resize_check();
        });
-</script>
\ No newline at end of file
+</script>
index 685def6938694e335b5d27aa56001d7dd3d18989..61a7fc4800b71662fd54707e33a444d1d7a7adad 100644 (file)
@@ -11,7 +11,6 @@ class file_auth
        function __construct()
        {
                Hook::func(HOOKTYPE_PRE_HEADER, 'file_auth::session_start');
-               Hook::func(HOOKTYPE_FOOTER, 'file_auth::add_footer_info');
                Hook::func(HOOKTYPE_USER_LOOKUP, 'file_auth::get_user');
                Hook::func(HOOKTYPE_USERMETA_ADD, 'file_auth::add_usermeta');
                Hook::func(HOOKTYPE_USERMETA_DEL, 'file_auth::del_usermeta');
@@ -43,17 +42,6 @@ class file_auth
                }
        }
 
-       // duplicate code
-       public static function add_footer_info($empty)
-       {
-               if (!($user = unreal_get_current_user()))
-                       return;
-
-               else {
-                       echo "<code>Admin Panel v" . WEBPANEL_VERSION . "</code>";
-               }
-       }
-
        public static function add_pre_overview_card($empty)
        {
                if (defined('DEFAULT_USER'))
index 99c5b932cd9167ca41752022a3a581230cbc7234..0c8ca634ec2eaa9ccb5bca3f3fa6803493069b1c 100644 (file)
@@ -15,7 +15,6 @@ class sql_auth
        {
                self::create_tables();
                Hook::func(HOOKTYPE_PRE_HEADER, 'sql_auth::session_start');
-               Hook::func(HOOKTYPE_FOOTER, 'sql_auth::add_footer_info');
                Hook::func(HOOKTYPE_USER_LOOKUP, 'sql_auth::get_user');
                Hook::func(HOOKTYPE_USERMETA_ADD, 'sql_auth::add_usermeta');
                Hook::func(HOOKTYPE_USERMETA_DEL, 'sql_auth::del_usermeta');
@@ -29,17 +28,6 @@ class sql_auth
 
        }
 
-
-       public static function add_footer_info($empty)
-       {
-               if (!($user = unreal_get_current_user()))
-                       return;
-
-               else {
-                       echo "<code>Admin Panel v" . WEBPANEL_VERSION . "</code>";
-               }
-       }
-
        public static function add_pre_overview_card($empty)
        {
                if (defined('SQL_DEFAULT_USER'))