Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Aios committed Oct 9, 2018
2 parents d27261d + c2ad354 commit cbe1282
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 7 deletions.
26 changes: 19 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<p align="center"><h2>[Unreleased] (Only in <code class=" language-php">development</code> branch)</h2></p>

* [Add] Добавлен новый тип столбца `AdminColumn::boolean('active', 'Published'),` (алиас `text`) который просто рисует галочку при `true` и минус при `false`. C равнением по центру.
Замена коду:
```
//было
AdminColumn::custom('Published', function ($instance) {
return $instance->active ? '<i class="fa fa-check"></i>' : '<i class="fa fa-minus"></i>';})
->setHtmlAttribute('class', 'text-center'),
//станет
AdminColumn::boolean('active', 'Published'),
```

* [Feature] Добавлен ENV-редактор
Для тех кто уже с нами:
В sleeping_owl.php
Expand All @@ -12,25 +24,25 @@
|
*/
'env_editor_url' => 'env/editor',

/*
*
*
*/
'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`. Может быть пропущен.
Expand Down
1 change: 1 addition & 0 deletions config/sleeping_owl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions resources/views/default/column/boolean.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div {!! $attributes !!}>
<div class="text-center">
{!! $value ? '<i class="fa fa-check"></i>' : '<i class="fa fa-minus"></i>' !!} {!! $append !!}
</div>
@if($small)
<small class="clearfix">{!! $small !!}</small>
@endif
</div>
32 changes: 32 additions & 0 deletions src/Display/Column/Boolean.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace SleepingOwl\Admin\Display\Column;

class Boolean extends NamedColumn
{
/**
* @var string
*/
protected $view = 'column.boolean';

/**
* @var bool
*/
protected $isSearchable = false;

/**
* @var bool
*/
protected $orderable = false;

/**
* @return array
*/
public function toArray()
{
return parent::toArray() + [
'value' => $this->getModelValue(),
'small' => $this->getModelSmallValue(),
];
}
}
2 changes: 2 additions & 0 deletions src/Factories/DisplayColumnFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit cbe1282

Please sign in to comment.