mirror of
https://github.com/Karaka-Management/oms-Search.git
synced 2026-01-11 02:38:39 +00:00
bug fixes
This commit is contained in:
parent
da39cf2892
commit
bc9ddd0ea6
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
|
|
@ -9,5 +9,5 @@ jobs:
|
|||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.'
|
||||
issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
|
||||
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'
|
||||
|
|
|
|||
|
|
@ -126,7 +126,14 @@ final class Installer extends InstallerAbstract
|
|||
/** @noinspection PhpIncludeInspection */
|
||||
$moduleRoutes = include $data['path'];
|
||||
|
||||
self::$commands = \array_merge_recursive(self::$commands, $moduleRoutes);
|
||||
$tmp = \array_merge_recursive(self::$commands, $moduleRoutes);
|
||||
foreach ($tmp as $route => $endpoints) {
|
||||
\usort($endpoints, function (array $a, array $b) {
|
||||
return ($a['order'] ?? 0) <=> ($b['order'] ?? 0);
|
||||
});
|
||||
|
||||
self::$commands[$route] = $endpoints;
|
||||
}
|
||||
|
||||
\file_put_contents(__DIR__ . '/SearchCommands.php', '<?php return ' . ArrayParser::serializeArray(self::$commands) . ';', \LOCK_EX);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,9 +53,6 @@ final class BackendController extends Controller
|
|||
*
|
||||
* @api
|
||||
*
|
||||
* @todo Search prioritization
|
||||
* https://github.com/Karaka-Management/oms-Search/issues/1
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function search(HttpRequest $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
|
|
@ -74,8 +71,6 @@ final class BackendController extends Controller
|
|||
? []
|
||||
: $this->routeSearch($internalRequest, $internalResponse, $data);
|
||||
|
||||
$response->header = $internalResponse->header;
|
||||
|
||||
$responseData = \reset($temp);
|
||||
$view->data = empty($temp) || !\is_array($responseData) ? [] : $responseData;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
|
|
@ -10,6 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
|
@ -24,80 +26,85 @@ foreach ($this->data as $controller) :
|
|||
|
||||
$first = \reset($controller);
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="box col-xs-12">
|
||||
<h1><?= $first['module']; ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($first['type'] === 'list_links') : ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<table class="default sticky"><tbody>
|
||||
<?php foreach ($controller as $data) :
|
||||
if (empty($data)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$isEmpty = false;
|
||||
|
||||
$summary = $data['summary'];
|
||||
$summary = \trim($summary, " #\n");
|
||||
?>
|
||||
<tr data-href="<?= UriFactory::build($data['link']); ?>">
|
||||
<td class="wf-100">
|
||||
<a href="<?= UriFactory::build($data['link']); ?>">
|
||||
<?= $this->printHtml(\trim($data['title'])); ?>
|
||||
</a>
|
||||
<td class="sm-hidden">
|
||||
<?php if (!empty($data['tags'])) : ?>
|
||||
<div class="tag-list">
|
||||
<?php foreach ($data['tags'] as $tag) : ?>
|
||||
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>">
|
||||
<?= empty($tag->icon) ? '' : '<i class="g-icon">' . $this->printHtml($tag->icon) . '</i>'; ?>
|
||||
<?= $this->printHtml($tag->getL11n()); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="box col-xs-12">
|
||||
<h1><?= $first['module']; ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($first['type'] === 'list_links') : ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<table class="default sticky">
|
||||
<tbody>
|
||||
<?php foreach ($controller as $data) :
|
||||
if (empty($data)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$isEmpty = false;
|
||||
|
||||
$summary = $data['summary'];
|
||||
$summary = \trim($summary, " #\n");
|
||||
?>
|
||||
<tr data-href="<?= UriFactory::build($data['link']); ?>">
|
||||
<td class="wf-100">
|
||||
<a href="<?= UriFactory::build($data['link']); ?>">
|
||||
<?= $this->printHtml(\trim($data['title'])); ?>
|
||||
</a>
|
||||
<td class="sm-hidden">
|
||||
<?php if (!empty($data['tags'])) : ?>
|
||||
<div class="tag-list">
|
||||
<?php foreach ($data['tags'] as $tag) : ?>
|
||||
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>">
|
||||
<?= empty($tag->icon) ? '' : '<i class="g-icon">' . $this->printHtml($tag->icon) . '</i>'; ?>
|
||||
<?= $this->printHtml($tag->getL11n()); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif ($first['type'] === 'list_accounts') : ?>
|
||||
<div class="row">
|
||||
<?php foreach ($controller as $data) :
|
||||
if (empty($data)) {
|
||||
continue;
|
||||
}
|
||||
if (empty($data)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$isEmpty = false;
|
||||
?>
|
||||
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
|
||||
<section class="portlet">
|
||||
<div class="<?= empty($data['email']) && empty($data['phone']) && empty($data['city']) ? 'portlet-body' : 'portlet-head'; ?>">
|
||||
<a style="display: flex; align-items: center;" href="<?= UriFactory::build($data['link']); ?>">
|
||||
<img class="profile-image" alt="account" loading="lazy"
|
||||
src="<?= UriFactory::build($data['image']); ?>">
|
||||
<span style="margin-left: .5rem;"><?= $this->printHtml($data['title']); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?php if (!empty($data['email']) || !empty($data['phone']) || !empty($data['city'])) : ?>
|
||||
<div class="portlet-body">
|
||||
<div>
|
||||
<table class="wf-100" style="font-size: .9rem;">
|
||||
<?php if (!empty($data['email'])) : ?><tr><td><a href=""><?= $this->printHtml($data['email']); ?></a><?php endif; ?>
|
||||
<?php if (!empty($data['phone'])) : ?><tr><td><?= $this->printHtml($data['phone']); ?><?php endif; ?>
|
||||
<?php if (!empty($data['city'])) : ?><tr><td><?= $this->printHtml($data['city']); ?><?php endif; ?>
|
||||
</table>
|
||||
$isEmpty = false;
|
||||
?>
|
||||
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
|
||||
<section class="portlet">
|
||||
<div class="<?= empty($data['email']) && empty($data['phone']) && empty($data['city']) ? 'portlet-body' : 'portlet-head'; ?>">
|
||||
<a style="display: flex; align-items: center;" href="<?= UriFactory::build($data['link']); ?>">
|
||||
<img class="profile-image" alt="account" loading="lazy" src="<?= UriFactory::build($data['image']); ?>">
|
||||
<span style="margin-left: .5rem;"><?= $this->printHtml($data['title']); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if (!empty($data['email']) || !empty($data['phone']) || !empty($data['city'])) : ?>
|
||||
<div class="portlet-body">
|
||||
<div>
|
||||
<table class="wf-100" style="font-size: .9rem;">
|
||||
<?php if (!empty($data['email'])) : ?><tr>
|
||||
<td><a href=""><?= $this->printHtml($data['email']); ?></a><?php endif; ?>
|
||||
<?php if (!empty($data['phone'])) : ?>
|
||||
<tr>
|
||||
<td><?= $this->printHtml($data['phone']); ?><?php endif; ?>
|
||||
<?php if (!empty($data['city'])) : ?>
|
||||
<tr>
|
||||
<td><?= $this->printHtml($data['city']); ?><?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user