diff --git a/CHANGELOG.md b/CHANGELOG.md
index bd9dfe180..396303b38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,17 @@
[Unreleased] (Only in development
branch)
+* [Add] Добавлен новый тип столбца `AdminColumn::boolean('active', 'Published'),` (алиас `text`) который просто рисует галочку при `true` и минус при `false`. C равнением по центру.
+ Замена коду:
+ ```
+ //было
+ AdminColumn::custom('Published', function ($instance) {
+ return $instance->active ? '' : '';})
+ ->setHtmlAttribute('class', 'text-center'),
+
+ //станет
+ AdminColumn::boolean('active', 'Published'),
+ ```
+
* [Feature] Добавлен ENV-редактор
Для тех кто уже с нами:
В sleeping_owl.php
@@ -12,7 +24,7 @@
|
*/
'env_editor_url' => 'env/editor',
-
+
/*
*
*
@@ -20,17 +32,17 @@
'env_editor_excluded_keys' => [
'APP_KEY', 'DB_*'
],
-
-
+
+
'env_editor_middlewares' => [],
-
+
'env_editor_policy' => Policy::class,
-
+
'show_editor' => false,
```
-
-
+
+
* [Feature] Subdomain routes for admin
Вы должны добавить в sleeping_owl.php ключ 'domain' => 'admin.example.com' где example.com и будет ваш домен.
* [Feature] Добавлено поведение для коламнов `text`, `link` и `relatedLink`. Может быть пропущен.
diff --git a/config/sleeping_owl.php b/config/sleeping_owl.php
index 633f50c1f..750caa773 100644
--- a/config/sleeping_owl.php
+++ b/config/sleeping_owl.php
@@ -160,6 +160,7 @@
'ckeditor' => [
'defaultLanguage' => config('app.locale'),
'height' => 200,
+ 'allowedContent' => true,
'extraPlugins' => 'uploadimage,image2,justify,youtube,uploadfile',
/*
* WARNING!!!! CKEDITOR on D & D and UploadImageDialog
diff --git a/resources/views/default/column/boolean.blade.php b/resources/views/default/column/boolean.blade.php
new file mode 100644
index 000000000..7826f7207
--- /dev/null
+++ b/resources/views/default/column/boolean.blade.php
@@ -0,0 +1,8 @@
+
+
+ {!! $value ? '' : '' !!} {!! $append !!}
+
+ @if($small)
+
{!! $small !!}
+ @endif
+
diff --git a/src/Display/Column/Boolean.php b/src/Display/Column/Boolean.php
new file mode 100644
index 000000000..69d9cdab9
--- /dev/null
+++ b/src/Display/Column/Boolean.php
@@ -0,0 +1,32 @@
+ $this->getModelValue(),
+ 'small' => $this->getModelSmallValue(),
+ ];
+ }
+}
diff --git a/src/Factories/DisplayColumnFactory.php b/src/Factories/DisplayColumnFactory.php
index d66917c42..38f10add7 100644
--- a/src/Factories/DisplayColumnFactory.php
+++ b/src/Factories/DisplayColumnFactory.php
@@ -18,6 +18,7 @@
* @method Column\Lists lists($name, $label = null)
* @method Column\Order order()
* @method Column\Text text($name, $label = null)
+ * @method Column\Boolean text($name, $label = null)
* @method Column\Link link($name, $label = null)
* @method Column\RelatedLink relatedLink($name, $label = null)
* @method Column\Email email($name, $label = null)
@@ -47,6 +48,7 @@ public function __construct(\Illuminate\Contracts\Foundation\Application $applic
'lists' => Column\Lists::class,
'order' => Column\Order::class,
'text' => Column\Text::class,
+ 'boolean' => Column\Boolean::class,
'link' => Column\Link::class,
'relatedLink' => Column\RelatedLink::class,
'email' => Column\Email::class,