mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Adds compact column, explicit option for deferred binding in relation controller, fix to list head width
This commit is contained in:
parent
7032e43b92
commit
5c78140268
@ -2558,6 +2558,7 @@ table.table.data tbody tr.safe td,table.table.data tbody tr.special td,table.tab
|
||||
table.table.data tbody td.column-break-word{word-wrap:break-word;word-break:break-all}
|
||||
table.table.data tbody td.column-single-line{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
table.table.data tbody td.column-slim{padding-left:0;padding-right:0}
|
||||
table.table.data tbody td.column-compact{padding:0}
|
||||
table.table.data tfoot a{color:#666666;text-decoration:none}
|
||||
table.table.data tfoot td,table.table.data tfoot th{border-color:#e2e2e2;padding:10px 15px}
|
||||
table.table.data .list-checkbox{padding-left:16px;padding-right:8px;width:52px;vertical-align:top;border-right:1px solid #eeeeee}
|
||||
|
@ -242,6 +242,10 @@ table.table.data {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
td.column-compact {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
tfoot {
|
||||
|
@ -147,6 +147,11 @@ class RelationController extends ControllerBehavior
|
||||
*/
|
||||
public $readOnly = false;
|
||||
|
||||
/**
|
||||
* @var bool Defers all binding actions using a session key when it is available.
|
||||
*/
|
||||
public $deferredBinding = false;
|
||||
|
||||
/**
|
||||
* Behavior constructor
|
||||
* @param Backend\Classes\Controller $controller
|
||||
@ -215,6 +220,7 @@ class RelationController extends ControllerBehavior
|
||||
$this->relationModel = $this->relationObject->getRelated();
|
||||
|
||||
$this->readOnly = $this->getConfig('readOnly');
|
||||
$this->deferredBinding = $this->getConfig('deferredBinding');
|
||||
$this->toolbarButtons = $this->evalToolbarButtons();
|
||||
$this->viewMode = $this->viewMode ?: $this->evalViewMode();
|
||||
$this->manageMode = $this->manageMode ?: $this->evalManageMode();
|
||||
@ -705,12 +711,14 @@ class RelationController extends ControllerBehavior
|
||||
$models = $this->relationModel->whereIn($foreignKeyName, $checkedIds)->get();
|
||||
foreach ($models as $model) {
|
||||
|
||||
if ($this->model->exists) {
|
||||
$this->relationObject->add($model);
|
||||
}
|
||||
else {
|
||||
$useDefer = $this->deferredBinding || !$this->model->exists;
|
||||
if ($useDefer) {
|
||||
$this->relationObject->add($model, $this->relationGetSessionKey());
|
||||
}
|
||||
else {
|
||||
$this->relationObject->add($model);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,10 @@
|
||||
</a>
|
||||
</th>
|
||||
<?php else: ?>
|
||||
<th class="list-cell-name-<?= $column->columnName ?>">
|
||||
<th
|
||||
<?php if ($column->width): ?>style="width: <?= $column->width ?>"<?php endif ?>
|
||||
class="list-cell-name-<?= $column->columnName ?>"
|
||||
>
|
||||
<span><?= $this->getHeaderValue($column) ?></span>
|
||||
</th>
|
||||
<?php endif ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user