Browse Source

优化后台页面样式和Sidebar

Karson 2 years ago
parent
commit
37e844181e

+ 0 - 1
application/admin/controller/Index.php

@@ -44,7 +44,6 @@ class Index extends Backend
             'dashboard' => 'hot',
             'addon'     => ['new', 'red', 'badge'],
             'auth/rule' => __('Menu'),
-            'general'   => ['new', 'purple'],
         ], $this->view->site['fixedpage']);
         $action = $this->request->request('action');
         if ($this->request->isPost()) {

+ 8 - 0
public/assets/css/backend.css

@@ -1522,6 +1522,14 @@ table.table-nowrap thead > tr > th {
   border-bottom: 1px solid #eee;
   border-radius: 0;
 }
+.sidebar-menu li.active > a > .fa-angle-left,
+.sidebar-menu li.active > a > .pull-right-container > .fa-angle-left {
+  -webkit-transform: rotate(0deg);
+  -moz-transform: rotate(0deg);
+  -o-transform: rotate(0deg);
+  -ms-transform: rotate(0deg);
+  transform: rotate(0deg);
+}
 .sidebar-menu li.treeview-open > a > .fa-angle-left,
 .sidebar-menu li.treeview-open > a > .pull-right-container > .fa-angle-left {
   -webkit-transform: rotate(-90deg);

File diff suppressed because it is too large
+ 1 - 1
public/assets/css/backend.min.css


+ 30 - 0
public/assets/css/skins/_all-skins.css

@@ -2481,6 +2481,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-blue .sidebar-menu li.treeview.active > a,
+.skin-black-blue .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #555299;
+  border-left-color: #555299;
+}
 .skin-black-blue .sidebar-menu .treeview-menu {
   padding-left: 0;
 }
@@ -2717,6 +2722,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-purple .sidebar-menu li.treeview.active > a,
+.skin-black-purple .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #555299;
+  border-left-color: #555299;
+}
 .skin-black-purple .sidebar-menu .treeview-menu {
   padding-left: 0;
 }
@@ -2953,6 +2963,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-green .sidebar-menu li.treeview.active > a,
+.skin-black-green .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #555299;
+  border-left-color: #555299;
+}
 .skin-black-green .sidebar-menu .treeview-menu {
   padding-left: 0;
 }
@@ -3189,6 +3204,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-red .sidebar-menu li.treeview.active > a,
+.skin-black-red .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #555299;
+  border-left-color: #555299;
+}
 .skin-black-red .sidebar-menu .treeview-menu {
   padding-left: 0;
 }
@@ -3425,6 +3445,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-yellow .sidebar-menu li.treeview.active > a,
+.skin-black-yellow .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #555299;
+  border-left-color: #555299;
+}
 .skin-black-yellow .sidebar-menu .treeview-menu {
   padding-left: 0;
 }
@@ -3661,6 +3686,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-pink .sidebar-menu li.treeview.active > a,
+.skin-black-pink .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #555299;
+  border-left-color: #555299;
+}
 .skin-black-pink .sidebar-menu .treeview-menu {
   padding-left: 0;
 }

+ 5 - 0
public/assets/css/skins/skin-black-blue.css

@@ -198,6 +198,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-blue .sidebar-menu li.treeview.active > a,
+.skin-black-blue .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #181f23;
+  border-left-color: #181f23;
+}
 .skin-black-blue .sidebar-menu .treeview-menu {
   padding-left: 0;
 }

+ 5 - 0
public/assets/css/skins/skin-black-green.css

@@ -198,6 +198,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-green .sidebar-menu li.treeview.active > a,
+.skin-black-green .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #181f23;
+  border-left-color: #181f23;
+}
 .skin-black-green .sidebar-menu .treeview-menu {
   padding-left: 0;
 }

+ 5 - 0
public/assets/css/skins/skin-black-pink.css

@@ -198,6 +198,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-pink .sidebar-menu li.treeview.active > a,
+.skin-black-pink .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #181f23;
+  border-left-color: #181f23;
+}
 .skin-black-pink .sidebar-menu .treeview-menu {
   padding-left: 0;
 }

+ 5 - 0
public/assets/css/skins/skin-black-purple.css

@@ -198,6 +198,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-purple .sidebar-menu li.treeview.active > a,
+.skin-black-purple .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #181f23;
+  border-left-color: #181f23;
+}
 .skin-black-purple .sidebar-menu .treeview-menu {
   padding-left: 0;
 }

+ 5 - 0
public/assets/css/skins/skin-black-red.css

@@ -198,6 +198,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-red .sidebar-menu li.treeview.active > a,
+.skin-black-red .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #181f23;
+  border-left-color: #181f23;
+}
 .skin-black-red .sidebar-menu .treeview-menu {
   padding-left: 0;
 }

+ 5 - 0
public/assets/css/skins/skin-black-yellow.css

@@ -198,6 +198,11 @@
   background: transparent;
   border-left-color: transparent;
 }
+.skin-black-yellow .sidebar-menu li.treeview.active > a,
+.skin-black-yellow .sidebar-menu li.treeview.treeview-open > a {
+  background-color: #181f23;
+  border-left-color: #181f23;
+}
 .skin-black-yellow .sidebar-menu .treeview-menu {
   padding-left: 0;
 }

+ 1 - 0
public/assets/js/backend/index.js

@@ -67,6 +67,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
                 var visible = nextul.is(":visible");
                 if (nextul.length == 0) {
                     $(this).parents("li").addClass("active");
+                    $(this).closest(".treeview").addClass("treeview-open");
                 } else {
                 }
                 e.stopPropagation();

+ 25 - 9
public/assets/js/require-form.js

@@ -61,8 +61,10 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
                             var msg = ret.hasOwnProperty("msg") && ret.msg !== "" ? ret.msg : __('Operation completed');
                             parent.Toastr.success(msg);
                             parent.$(".btn-refresh").trigger("click");
-                            var index = parent.Layer.getFrameIndex(window.name);
-                            parent.Layer.close(index);
+                            if (window.name) {
+                                var index = parent.Layer.getFrameIndex(window.name);
+                                parent.Layer.close(index);
+                            }
                             return false;
                         }, function (data, ret) {
                             that.holdSubmit(false);
@@ -513,13 +515,27 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
                     var baseregex = /^([a-z0-9\_]+)([>|<|=|\!]=?)(.*)$/i, strregex = /^('|")(.*)('|")$/, regregex = /^regex:(.*)$/;
                     // @formatter:off
                     var operator_result = {
-                        '>': function(a, b) { return a > b; },
-                        '>=': function(a, b) { return a >= b; },
-                        '<': function(a, b) { return a < b; },
-                        '<=': function(a, b) { return a <= b; },
-                        '==': function(a, b) { return a == b; },
-                        '!=': function(a, b) { return a != b; },
-                        'in': function(a, b) { return b.split(/\,/).indexOf(a) > -1; },
+                        '>': function (a, b) {
+                            return a > b;
+                        },
+                        '>=': function (a, b) {
+                            return a >= b;
+                        },
+                        '<': function (a, b) {
+                            return a < b;
+                        },
+                        '<=': function (a, b) {
+                            return a <= b;
+                        },
+                        '==': function (a, b) {
+                            return a == b;
+                        },
+                        '!=': function (a, b) {
+                            return a != b;
+                        },
+                        'in': function (a, b) {
+                            return b.split(/\,/).indexOf(a) > -1;
+                        },
                         'regex': function (a, b) {
                             var regParts = b.match(/^\/(.*?)\/([gim]*)$/);
                             var regexp = regParts ? new RegExp(regParts[1], regParts[2]) : new RegExp(b);

+ 4 - 0
public/assets/less/backend.less

@@ -1552,6 +1552,10 @@ table.table-nowrap {
     }
 }
 
+.sidebar-menu li.active > a > .fa-angle-left, .sidebar-menu li.active > a > .pull-right-container > .fa-angle-left {
+    .rotate(0deg);
+}
+
 .sidebar-menu li.treeview-open > a > .fa-angle-left, .sidebar-menu li.treeview-open > a > .pull-right-container > .fa-angle-left {
     .rotate(-90deg);
 }

+ 7 - 0
public/assets/less/skins/skin-black-blue.less

@@ -99,6 +99,13 @@
             border-left-color: transparent;
         }
 
+        li.treeview {
+            &.active > a,&.treeview-open > a {
+                background-color: @sidebar-dark-submenu-bg;
+                border-left-color: @sidebar-dark-submenu-bg;
+            }
+        }
+
         .treeview-menu {
             padding-left: 0;
 

+ 7 - 0
public/assets/less/skins/skin-black-green.less

@@ -99,6 +99,13 @@
             border-left-color: transparent;
         }
 
+        li.treeview {
+            &.active > a,&.treeview-open > a {
+                background-color: @sidebar-dark-submenu-bg;
+                border-left-color: @sidebar-dark-submenu-bg;
+            }
+        }
+
         .treeview-menu {
             padding-left: 0;
 

+ 7 - 0
public/assets/less/skins/skin-black-pink.less

@@ -99,6 +99,13 @@
             border-left-color: transparent;
         }
 
+        li.treeview {
+            &.active > a,&.treeview-open > a {
+                background-color: @sidebar-dark-submenu-bg;
+                border-left-color: @sidebar-dark-submenu-bg;
+            }
+        }
+
         .treeview-menu {
             padding-left: 0;
 

+ 7 - 0
public/assets/less/skins/skin-black-purple.less

@@ -99,6 +99,13 @@
             border-left-color: transparent;
         }
 
+        li.treeview {
+            &.active > a,&.treeview-open > a {
+                background-color: @sidebar-dark-submenu-bg;
+                border-left-color: @sidebar-dark-submenu-bg;
+            }
+        }
+
         .treeview-menu {
             padding-left: 0;
 

+ 7 - 0
public/assets/less/skins/skin-black-red.less

@@ -99,6 +99,13 @@
             border-left-color: transparent;
         }
 
+        li.treeview {
+            &.active > a,&.treeview-open > a {
+                background-color: @sidebar-dark-submenu-bg;
+                border-left-color: @sidebar-dark-submenu-bg;
+            }
+        }
+
         .treeview-menu {
             padding-left: 0;
 

+ 7 - 0
public/assets/less/skins/skin-black-yellow.less

@@ -99,6 +99,13 @@
             border-left-color: transparent;
         }
 
+        li.treeview {
+            &.active > a,&.treeview-open > a {
+                background-color: @sidebar-dark-submenu-bg;
+                border-left-color: @sidebar-dark-submenu-bg;
+            }
+        }
+
         .treeview-menu {
             padding-left: 0;