forked from fa/breadcrumb-the-shire
Move breadcrumb rendering from individual page templates into the core topbar. Each page now sets $breadcrumbs in its action .php file; the topbar renders it automatically via the shared partial. - Remove global back/forward buttons and app-nav-history.js component - Remove Alt+Arrow keyboard shortcuts for history navigation - Render breadcrumb in topbar-left section (replaces button area) - Clean up breadcrumb CSS: context-neutral base (flex, no margin) - Recalculate sticky titlebar offset in details container - Migrate all 41 pages (core + helpdesk, audit, addressbook, api-docs) - Add missing breadcrumbs to addressbook detail view - Update architecture contract tests (nav-history references removed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
130 lines
4.3 KiB
PHTML
130 lines
4.3 KiB
PHTML
<?php
|
|
use MintyPHP\Domain\Taxonomy\MailLogStatus;
|
|
|
|
/**
|
|
* @var array $mailLog
|
|
*/
|
|
|
|
$mailLog = $mailLog ?? [];
|
|
$status = MailLogStatus::normalizeOr((string) ($mailLog['status'] ?? ''), MailLogStatus::Queued);
|
|
$statusBadge = $status->badgeVariant();
|
|
|
|
?>
|
|
|
|
<div class="app-details-container">
|
|
<section>
|
|
<div class="app-details-titlebar">
|
|
<h1>
|
|
<a href="admin/mail-log" title="<?php e(t('Back')); ?>" class="app-icon-button"><i class="bi bi-arrow-left"></i></a>
|
|
<?php e(t('View mail log')); ?>
|
|
</h1>
|
|
</div>
|
|
|
|
<div class="app-details-content">
|
|
<details open>
|
|
<summary><?php e(t('Email details')); ?></summary>
|
|
<hr>
|
|
<div class="app-details-section">
|
|
<div class="grid">
|
|
<div class="app-form-group">
|
|
<label><?php e(t('Recipient')); ?></label>
|
|
<input type="text" value="<?php e($mailLog['to_email'] ?? ''); ?>" readonly>
|
|
</div>
|
|
<div class="app-form-group">
|
|
<label><?php e(t('Subject')); ?></label>
|
|
<input type="text" value="<?php e($mailLog['subject'] ?? ''); ?>" readonly>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="app-form-group">
|
|
<label><?php e(t('Template')); ?></label>
|
|
<input type="text" value="<?php e($mailLog['template'] ?? '-'); ?>" readonly>
|
|
</div>
|
|
</div>
|
|
</details>
|
|
|
|
<?php if ($status === MailLogStatus::Sent): ?>
|
|
<hr>
|
|
<details open>
|
|
<summary><?php e(t('Delivery information')); ?></summary>
|
|
<hr>
|
|
<div class="app-details-section">
|
|
<div class="app-form-group">
|
|
<label><?php e(t('Sent at')); ?></label>
|
|
<input type="text" value="<?php e(dt($mailLog['sent_at'] ?? '')); ?>" readonly>
|
|
</div>
|
|
<?php if (!empty($mailLog['provider_message_id'])): ?>
|
|
<div class="app-form-group">
|
|
<label><?php e(t('Provider message ID')); ?></label>
|
|
<input type="text" value="<?php e($mailLog['provider_message_id'] ?? ''); ?>" readonly>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</details>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($status === MailLogStatus::Failed && !empty($mailLog['error_message'])): ?>
|
|
<hr>
|
|
<details open>
|
|
<summary><?php e(t('Error information')); ?></summary>
|
|
<hr>
|
|
<div class="app-details-section">
|
|
<div class="app-form-group">
|
|
<label><?php e(t('Error message')); ?></label>
|
|
<textarea readonly rows="6"><?php e($mailLog['error_message'] ?? ''); ?></textarea>
|
|
</div>
|
|
</div>
|
|
</details>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|
|
<aside id="app-details-aside-section">
|
|
<div class="app-details-aside-section">
|
|
<hgroup>
|
|
<strong><?php e($mailLog['to_email'] ?? ''); ?></strong>
|
|
<p><small><?php e(t('Mail log')); ?></small></p>
|
|
</hgroup>
|
|
<hr>
|
|
<div class="grid">
|
|
<div>
|
|
<small><?php e(t('ID')); ?></small>
|
|
<p>
|
|
<span class="badge" data-variant="neutral">
|
|
<?php e($mailLog['id'] ?? '-'); ?>
|
|
</span>
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<small>
|
|
<?php e(t('Status')); ?>
|
|
</small>
|
|
<div>
|
|
<span class="badge" data-variant="<?php e($statusBadge); ?>">
|
|
<?php e(t($status->labelToken())); ?>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<small><?php e(t('Created')); ?></small>
|
|
<p><?php e(dt($mailLog['created_at'] ?? '') ?: '-'); ?></p>
|
|
</div>
|
|
<?php if ($status === MailLogStatus::Sent && !empty($mailLog['sent_at'])): ?>
|
|
<div>
|
|
<small><?php e(t('Sent')); ?></small>
|
|
<p><?php e(dt($mailLog['sent_at'] ?? '') ?: '-'); ?></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php if (!empty($mailLog['provider_message_id'])): ?>
|
|
<div class="grid">
|
|
<div>
|
|
<small><?php e(t('Provider message ID')); ?></small>
|
|
<span class="badge" data-copy="true" data-copy-value="<?php e($mailLog['provider_message_id']); ?>"
|
|
data-variant="neutral"><?php e(substr($mailLog['provider_message_id'], 0, 20)); ?></span>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</aside>
|
|
</div>
|