oms-Notification/Theme/Backend/notification-dashboard.tpl.php
Dennis Eichhorn ccbc1233cd
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled
bug fixes
2024-10-11 19:17:41 +00:00

60 lines
2.2 KiB
PHP
Executable File

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Notification
* @copyright Dennis Eichhorn
* @license OMS License 2.2
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */
/** @var \Modules\Notification\Models\Notification[] $notifications */
$notifications = $this->data['notifications'] ?? [];
?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head">
<?= $this->getHtml('Notifications', 'Notification'); ?>
<span class="end-xs">
<form id="iNotificationRead"
action="<?= UriFactory::build('{/api}notification/seen?{?}&csrf={$CSRF}'); ?>" method="POST"
data-redirect="<?= UriFactory::build('{%}'); ?>">
<input type="submit" class="end-xs save" value="<?= $this->getHtml('MarkSeen', 'Notification'); ?>">
</form>
</span>
</div>
<div class="slider">
<table id="notificationList" class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('Date', 'Notification'); ?>
<td>
<td class="wf-100"><?= $this->getHtml('Title', 'Notification'); ?>
<tbody>
<?php
$c = 0;
foreach ($notifications as $notification) : ++$c;
$url = UriFactory::build($notification->redirect);
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $notification->createdAt->format('Y-m-d'); ?></a>
<td><a href="<?= $url; ?>"><?= $this->getHtml(':status-' . $notification->type); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($notification->module); ?>: <?= $this->printHtml($notification->title); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</section>
</div>
</div>