jqh 6 лет назад
Родитель
Сommit
2a62f95efa

+ 14 - 8
resources/assets/dcat-admin/main.css

@@ -835,7 +835,7 @@ input.label {
     letter-spacing: .05em;
 }
 .table-header-default.table>thead>tr>th {
-    border-bottom: 2px solid #f4f4f4;
+    border-bottom: 1px solid #f4f4f4;
 }
 .table>thead:first-child>tr:first-child>th:first-child {
     padding-left: 18px;
@@ -1218,12 +1218,10 @@ select.form-shadow {
 }
 
 .pagination > .active > a, .pagination > .active > a:focus, .pagination > .active > a:hover, .pagination > .active > span, .pagination > .active > span:focus, .pagination > .active > span:hover {
-    /*color: #2e609c;*/
-    /*color:var(--primary-dark);*/
-    /*background-color:rgba(64,153,222,.2);*/
-    background-color:var(--primary-80);
-    box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .1), 1px 2px 2px 0 rgba(0, 0, 0, .1), 0 1px 3px 1px rgba(0, 0, 0, .1);
-
+    background-color:transparent;
+    color: #777;
+    font-weight: bold;
+    cursor: not-allowed;
 }
 /*.pagination>.disabled>a, .pagination>.disabled>a:focus, .pagination>.disabled>a:hover, .pagination>.disabled>span, .pagination>.disabled>span:focus, .pagination>.disabled>span:hover{*/
 /*    background:transparent;*/
@@ -2126,7 +2124,7 @@ div.layui-layer-btn{
 }
 
 .material .box-header,.material .card-header {
-    padding: 11px;
+    padding: 12px;
 }
 .material .box-header .btn, .material .card-header .btn {
     /*text-transform: uppercase;*/
@@ -2163,6 +2161,14 @@ div.layui-layer-btn{
     display:inline!important;
 }
 
+.grid-column-header a {
+    color: rgba(0, 0, 0, 0.5)!important;
+    font-size: 13px;
+}
+.grid-column-header a:hover,.grid-column-header a.active {
+    color: var(--font)!important;
+}
+
 
 /*!
  * Waves v0.7.6

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
resources/assets/dcat-admin/main.min.css


+ 1 - 1
resources/assets/dcat-admin/markdown.css

@@ -1 +1 @@
-.editormd-html-preview code,.editormd-preview-container code{font-size:13px!important;font-family:"Inconsolata","Fira Mono",Consolas,"Liberation Mono",Menlo,Courier,monospace !important;word-wrap:break-word !important;}.com{color:#93A1A1 !important;}.lit{color:#6cf !important;}.opn{color:#93A1A1 !important;}.clo{color:#93A1A1 !important;}.tag{color:#6cf !important;}.atn{color:#00bfbf !important;}.atv{color:#fc8bb3 !important;}.dec{color:teal !important;}.var{color:teal !important;}.fun{color:#DC322F !important;}pre.prettyprint{padding:10px;border:1px solid #E1E1E8 !important;tab-size:4 !important;}pre.prettyprint.linenums{box-shadow:40px 0 0 #FBFBFC inset,41px 0 0 #ECECF0 inset !important;}pre.prettyprint.linenums ol.linenums{color:#1E347B !important;padding-left:30px !important;margin-top:0 !important;margin-bottom:0}pre.prettyprint.linenums ol.linenums li{color:#BEBEC5 !important;line-height:18px !important;padding-left:12px !important;background:#333 !important}pre.prettyprint.linenums ol.linenums li.L0,pre.prettyprint.linenums ol.linenums li.L1,pre.prettyprint.linenums ol.linenums li.L2,pre.prettyprint.linenums ol.linenums li.L3,pre.prettyprint.linenums ol.linenums li.L4,pre.prettyprint.linenums ol.linenums li.L5,pre.prettyprint.linenums ol.linenums li.L6,pre.prettyprint.linenums ol.linenums li.L7,pre.prettyprint.linenums ol.linenums li.L8,pre.prettyprint.linenums ol.linenums li.L9{list-style-type:decimal !important}.typ{color:#ef7c61!important;}pre.prettyprint{background:#333 !important;width:100%;border:0}.pln{color:#e9e4e5 !important;}.kwd{color:#4bb1b1!important;font-weight:bold;}.pun{color:#fff !important;}.str{color:#BCD42A!important;}pre.prettyprint.linenums{box-shadow:40px 0 0 #333 inset,41px 0 0 #444 inset !important;}pre.prettyprint{background-color:#333 !important;border:0 solid #333}.editormd-html-preview,.editormd-preview-container{padding:0}
+.editormd-html-preview code,.editormd-preview-container code{font-size:13px !important;font-family:"Inconsolata","Fira Mono",Consolas,"Liberation Mono",Menlo,Courier,monospace !important;word-wrap:break-word !important;}.markdown-body pre code{box-shadow:none;}.com{color:#93939e !important;}.tag,.typ{color:#DA564A !important;}.opn{color:#93A1A1 !important;}.clo{color:#93A1A1 !important;}.atn,.lit{color:#007ee5 !important;}.atv{color:#fc8bb3 !important;}.dec{color:teal !important;}.var{color:teal !important;}.fun{color:#DC322F !important;}pre.prettyprint{padding:10px;border:1px solid #E1E1E8 !important;tab-size:4 !important;}pre.prettyprint.linenums{box-shadow:40px 0 0 rgba(238,238,238,0.35) inset,41px 0 0 rgba(238,238,238,0.35) inset !important;}pre.prettyprint.linenums ol.linenums{color:#1E347B !important;padding-left:30px !important;margin-top:0 !important;margin-bottom:0}pre.prettyprint.linenums ol.linenums li{color:#BEBEC5 !important;line-height:18px !important;padding-left:12px !important;background:#F8F8F8;!important}pre.prettyprint.linenums ol.linenums li.L0,pre.prettyprint.linenums ol.linenums li.L1,pre.prettyprint.linenums ol.linenums li.L2,pre.prettyprint.linenums ol.linenums li.L3,pre.prettyprint.linenums ol.linenums li.L4,pre.prettyprint.linenums ol.linenums li.L5,pre.prettyprint.linenums ol.linenums li.L6,pre.prettyprint.linenums ol.linenums li.L7,pre.prettyprint.linenums ol.linenums li.L8,pre.prettyprint.linenums ol.linenums li.L9{list-style-type:decimal !important}pre.prettyprint{background:#F8F8F8 !important;width:100%;border:0!important;}.pln{color:#444 !important;}.kwd{color:#07a !important;font-weight:bold;}.pun{color:#999 !important;}.str{color:#2E7D32 !important;}pre.prettyprint{background-color:rgba(238,238,238,0.35);!important;border:0 solid #333}.editormd-html-preview,.editormd-preview-container{padding:0}

+ 2 - 2
resources/views/grid/quick-search.blade.php

@@ -1,5 +1,5 @@
 <form action="{!! $action !!}" class="input-no-border" pjax-container style="display:inline-block;margin:0 5px 13px 0;">
-    <div class="input-group quick-search" style="width:24.75rem;">
+    <div class="input-group quick-search" style="width:{{$width}}rem;">
 
         <input type="text"
                placeholder="{{ $placeholder }}"
@@ -8,7 +8,7 @@
                style="margin-left:-1px;padding:0 1.5rem 0 3.48rem;height:36px;line-height:36px;"
                value="{{ $value }}"
         >
-        <a onclick="$(this).submit()" style="overflow:hidden;position:absolute;top:8px;margin-left:-23.85rem;cursor:pointer;z-index:100">
+        <a onclick="$(this).submit()" style="overflow:hidden;position:absolute;top:8px;margin-left:-{{$width - 0.9}}rem;cursor:pointer;z-index:100">
             <svg xmlns="http://www.w3.org/2000/svg"
                  width="20"
                  height="20"

+ 1 - 1
resources/views/login.blade.php

@@ -82,7 +82,7 @@
       <div class="row" style="margin-top:28px">
         <div class="col-xs-8">
           @if(config('admin.auth.remember'))
-            <div class="checkbox checkbox-primary checkbox-circle">
+            <div class="checkbox checkbox-primary">
               <input id="remember" name="remember" type="checkbox" value="1" {{ (old('remember')) ? 'checked' : '' }}>
               <label for="remember">
                 {{ trans('admin.remember_me') }}

+ 3 - 1
src/Console/InstallCommand.php

@@ -37,6 +37,8 @@ class InstallCommand extends Command
         $this->initDatabase();
 
         $this->initAdminDirectory();
+
+        $this->info('Done.');
     }
 
     /**
@@ -65,7 +67,7 @@ class InstallCommand extends Command
         $this->directory = config('admin.directory');
 
         if (is_dir($this->directory)) {
-            $this->line("<error>{$this->directory} directory already exists !</error> ");
+            $this->warn("{$this->directory} directory already exists !");
 
             return;
         }

+ 1 - 1
src/Grid/Column/Filter/Between.php

@@ -146,7 +146,7 @@ JS;
         $this->addScript();
 
         $value = $this->getFilterValue(['start' => '', 'end' => '']);
-        $active = empty(array_filter($value)) ? '' : 'text-yellow';
+        $active = empty(array_filter($value)) ? '' : 'active';
 
         return <<<EOT
 &nbsp;<span class="dropdown" style="position:absolute">

+ 1 - 1
src/Grid/Column/Filter/Checkbox.php

@@ -36,7 +36,7 @@ JS;
         $this->addScript();
 
         $allCheck = (count($value) == count($this->options)) ? 'checked' : '';
-        $active = empty($value) ? '' : 'text-yellow';
+        $active = empty($value) ? '' : 'active';
 
         $allId = 'filter-all-'.Str::random(5);
 

+ 1 - 1
src/Grid/Column/Filter/Input.php

@@ -42,7 +42,7 @@ JS;
 
         $value = $this->getFilterValue();
 
-        $active = empty($value) ? '' : 'text-yellow';
+        $active = empty($value) ? '' : 'active';
 
         return <<<EOT
 &nbsp;<span class="dropdown" style="position: absolute">

+ 3 - 1
src/Grid/Column/HasHeader.php

@@ -102,7 +102,7 @@ trait HasHeader
      */
     public function renderHeader()
     {
-        return collect($this->headers)->map(function ($item) {
+        $headers = collect($this->headers)->map(function ($item) {
             if ($item instanceof Renderable) {
                 return $item->render();
             }
@@ -113,5 +113,7 @@ trait HasHeader
 
             return (string) $item;
         })->implode('');
+
+        return "<span class='grid-column-header'>$headers</span>";
     }
 }

+ 1 - 1
src/Grid/Header.php

@@ -123,6 +123,6 @@ class Header extends Widget
     {
         $headers = implode(' ', $this->html);
 
-        return "<th {$this->formatHtmlAttributes()}>{$this->label}{$headers}</th>";
+        return "<th {$this->formatHtmlAttributes()}>{$this->label}<span class='grid-column-header'>{$headers}</span></th>";
     }
 }

+ 17 - 0
src/Grid/Tools/QuickSearch.php

@@ -22,6 +22,11 @@ class QuickSearch extends AbstractTool
      */
     protected $queryName = '__search__';
 
+    /**
+     * @var int rem
+     */
+    protected $width = 24.25;
+
     /**
      * @param string|null $name
      * @return $this
@@ -41,6 +46,17 @@ class QuickSearch extends AbstractTool
         return $this->queryName;
     }
 
+    /**
+     * @param int $width
+     * @return $this
+     */
+    public function width(int $width)
+    {
+        $this->width = $width;
+
+        return $this;
+    }
+
     /**
      * Set placeholder.
      *
@@ -76,6 +92,7 @@ class QuickSearch extends AbstractTool
             'key' => $this->queryName,
             'value' => request($this->queryName),
             'placeholder' => $this->placeholder ?: trans('admin.search'),
+            'width' => $this->width,
         ];
 
         return view($this->view, $vars);

+ 10 - 5
src/Models/Menu.php

@@ -18,9 +18,10 @@ use Illuminate\Support\Facades\DB;
  */
 class Menu extends Model
 {
-    use MenuCache, ModelTree {
-        ModelTree::boot as treeBoot;
-    }
+    use MenuCache,
+        ModelTree {
+            ModelTree::boot as treeBoot;
+        }
 
     /**
      * The attributes that are mass assignable.
@@ -92,7 +93,7 @@ class Menu extends Model
         $connection = config('admin.database.connection') ?: config('database.default');
         $orderColumn = DB::connection($connection)->getQueryGrammar()->wrap($this->orderColumn);
 
-        $byOrder = $orderColumn.' = 0,'.$orderColumn;
+        $byOrder = 'ROOT ASC, '.$orderColumn;
 
         $self = new static;
         if ($this->queryCallback instanceof \Closure) {
@@ -103,7 +104,11 @@ class Menu extends Model
             $self = $self->with('permissions');
         }
 
-        return $self->with('roles')->orderByRaw($byOrder)->get()->toArray();
+        return $self->with('roles')
+            ->selectRaw('*, '.$orderColumn.' ROOT')
+            ->orderByRaw($byOrder)
+            ->get()
+            ->toArray();
     }
 
     /**

+ 3 - 3
src/Show.php

@@ -37,7 +37,7 @@ class Show implements Renderable
     /**
      * @var mixed
      */
-    protected $_id;
+    protected $__id;
 
     /**
      * @var Fluent
@@ -122,7 +122,7 @@ class Show implements Renderable
      */
     public function setId($id)
     {
-        $this->_id = $id;
+        $this->__id = $id;
     }
 
     /**
@@ -130,7 +130,7 @@ class Show implements Renderable
      */
     public function getId()
     {
-        return $this->_id;
+        return $this->__id;
     }
 
     /**

+ 6 - 2
src/Traits/ModelTree.php

@@ -155,7 +155,7 @@ trait ModelTree
     public function allNodes()
     {
         $orderColumn = DB::getQueryGrammar()->wrap($this->orderColumn);
-        $byOrder = $orderColumn.' = 0,'.$orderColumn;
+        $byOrder = 'ROOT ASC, '.$orderColumn;
 
         $self = new static();
 
@@ -163,7 +163,11 @@ trait ModelTree
             $self = call_user_func($this->queryCallback, $self);
         }
 
-        return $self->orderByRaw($byOrder)->get()->toArray();
+        return $self->selectRaw('*, '.$orderColumn.' ROOT')
+            ->orderByRaw($byOrder)
+            ->get()
+            ->toArray();
+
     }
 
     /**

Некоторые файлы не были показаны из-за большого количества измененных файлов