Skip to content

Commit

Permalink
Bump up foc/bui to v5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Dec 13, 2024
1 parent 82c58db commit 34508ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"require": {
"cakephp/cakephp": "^5.0",
"friendsofcake/crud": "^7.0",
"friendsofcake/bootstrap-ui": "^5.0"
"friendsofcake/bootstrap-ui": "^5.1"
},
"require-dev": {
"friendsofcake/cakephp-test-utilities": "^3.0",
Expand Down
21 changes: 11 additions & 10 deletions templates/element/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
}
?>

<div class="search-filters">
<div class="search-filters mb-3">
<?php
$searchOptions = $searchOptions ?? [];
$searchOptions += ['align' => 'inline', 'id' => 'searchFilter'];

echo $this->Form->create(null, $searchOptions);
echo $this->Form->hidden('_search');
?>

<?= $this->Form->create(null, $searchOptions) ?>
<?= $this->Form->hidden('_search') ?>

<?= $this->Form->controls($searchInputs, ['fieldset' => false]); ?>
<?= $this->Form->button(__d('crud', 'Filter results'), ['type' => 'submit', 'class' => 'btn btn-primary']); ?>
<?php if ($this->Search->isSearch()) : ?>
<div class="col-auto">
<?= $this->Search->resetLink(__d('crud', 'Reset'), ['class' => 'btn btn-primary']) ?>
</div>
<?php endif ?>

<div class="col-auto">
<?= $this->Form->button(__d('crud', 'Filter results'), ['type' => 'submit', 'class' => 'btn btn-primary']); ?>
<?php if ($this->Search->isSearch()) : ?>
<?= $this->Search->resetLink(__d('crud', 'Reset'), ['class' => 'btn btn-secondary']) ?>
<?php endif ?>
</div>

<?= $this->Form->end(); ?>
</div>
4 changes: 2 additions & 2 deletions tests/TestCase/View/Helper/CrudViewHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public function testIntrospect(): void
$this->assertEquals($entity->created->i18nFormat(), $result);

$result = $this->CrudView->introspect('created', 'invalid');
$this->assertEquals('<span class="bg-info badge">N/A</span>', $result);
$this->assertEquals('<span class="text-bg-info badge">N/A</span>', $result);

$result = $this->CrudView->introspect('created', null);
$this->assertEquals('<span class="bg-info badge">N/A</span>', $result);
$this->assertEquals('<span class="text-bg-info badge">N/A</span>', $result);

$this->CrudView->setConfig('fieldFormatters', [
'datetime' => function () {
Expand Down

0 comments on commit 34508ef

Please sign in to comment.