Support showSetup in list views of the RelationController

This commit is contained in:
Luke Towers 2023-11-04 01:32:19 -06:00
parent 9486aca1a0
commit 539ad66b4b
3 changed files with 4 additions and 2 deletions

View File

@ -665,6 +665,7 @@ class RelationController extends ControllerBehavior
$config = $this->makeConfigForMode('view', 'list');
$config->model = $this->relationModel;
$config->alias = $this->alias . 'ViewList';
$config->showSetup = $this->getConfig('view[showSetup]', true);
$config->showSorting = $this->getConfig('view[showSorting]', true);
$config->defaultSort = $this->getConfig('view[defaultSort]');
$config->recordsPerPage = $this->getConfig('view[recordsPerPage]');
@ -814,7 +815,7 @@ class RelationController extends ControllerBehavior
$config = $this->makeConfigForMode('manage', 'list');
$config->model = $this->relationModel;
$config->alias = $this->alias . 'ManageList';
$config->showSetup = false;
$config->showSetup = $this->getConfig('manage[showSetup]', !$isPivot);
$config->showCheckboxes = $this->getConfig('manage[showCheckboxes]', !$isPivot);
$config->showSorting = $this->getConfig('manage[showSorting]', !$isPivot);
$config->defaultSort = $this->getConfig('manage[defaultSort]');

View File

@ -45,6 +45,7 @@
<?php if ($showSetup): ?>
<th class="list-setup">
<a href="javascript:;"
id="<?= $this->getId('setupButton') ?>"
title="<?= e(trans('backend::lang.list.setup_title')) ?>"
data-control="popup"
data-handler="<?= $this->getEventHandler('onLoadSetup') ?>"></a>

View File

@ -1,4 +1,4 @@
<?= Form::open() ?>
<?= Form::open(['data-request-parent' => '#' . $this->getId('setupButton')]) ?>
<div class="modal-header">
<button type="button" class="close" data-dismiss="popup">&times;</button>
<h4 class="modal-title"><?= e(trans('backend::lang.list.setup_title')) ?></h4>