Phase 120 - Plan 01:
- Reusable PHP alert component (resources/views/components/alert.php)
with inline SVG icon per type, optional dismiss button.
- Missing .alert--info SCSS variant added (#eff6ff/#bfdbfe/#1e3a8a) -
fixes black-on-white alert after Fakturownia test connection.
- Flash::push(type, message) + Flash::all() with BC for set/get;
legacy key heuristic (error/.save/warning -> typed entries).
- Central flash renderer in 3 layouts (app/auth/public) iterating
Flash::all() through component (.alerts-stack wrap).
- Vanilla JS alert-dismiss.js with idempotent guard and delegated
click handler on [data-alert-dismiss].
- 36 views migrated off inline <div class="alert alert--TYPE">;
.flash--error/success removed from views (orders/show, shipments/prepare).
- SCSS rebuilt: public/assets/css/{app,login}.css.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
59 lines
2.8 KiB
PHP
59 lines
2.8 KiB
PHP
<?php
|
|
$integration = is_array($settings ?? null) ? $settings : [];
|
|
$appId = trim((string) ($integration['app_id'] ?? ''));
|
|
$hasAppSecret = (bool) ($integration['has_app_secret'] ?? false);
|
|
$hasAppId = (bool) ($integration['has_app_id'] ?? false);
|
|
$updatedAt = trim((string) ($integration['updated_at'] ?? ''));
|
|
?>
|
|
|
|
<section class="card">
|
|
<h2 class="section-title"><?= $e($t('settings.apaczka.title')) ?></h2>
|
|
<p class="muted mt-12"><?= $e($t('settings.apaczka.description')) ?></p>
|
|
|
|
<?php if (!empty($errorMessage)): ?>
|
|
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!empty($successMessage)): ?>
|
|
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
|
<?php endif; ?>
|
|
</section>
|
|
|
|
<section class="card mt-16">
|
|
<h3 class="section-title"><?= $e($t('settings.apaczka.config.title')) ?></h3>
|
|
<div class="muted mt-12">
|
|
<?= $e($t('settings.apaczka.status.app_id')) ?>:
|
|
<strong><?= $e($hasAppId ? $t('settings.apaczka.status.saved') : $t('settings.apaczka.status.missing')) ?></strong>
|
|
|
|
|
<?= $e($t('settings.apaczka.status.app_secret')) ?>:
|
|
<strong><?= $e($hasAppSecret ? $t('settings.apaczka.status.saved') : $t('settings.apaczka.status.missing')) ?></strong>
|
|
<?php if ($updatedAt !== ''): ?>
|
|
| <?= $e($t('settings.apaczka.status.updated_at')) ?>: <strong><?= $e($updatedAt) ?></strong>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<form class="statuses-form mt-16" action="/settings/integrations/apaczka/save" method="post" novalidate>
|
|
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
|
|
|
<label class="form-field">
|
|
<span class="field-label"><?= $e($t('settings.apaczka.fields.app_id')) ?></span>
|
|
<input class="form-control" type="text" name="app_id" maxlength="128" value="<?= $e($appId) ?>" required>
|
|
</label>
|
|
|
|
<label class="form-field">
|
|
<span class="field-label"><?= $e($t('settings.apaczka.fields.app_secret')) ?></span>
|
|
<input class="form-control" type="password" name="app_secret" autocomplete="new-password">
|
|
<span class="muted"><?= $e($hasAppSecret ? $t('settings.apaczka.app_secret.saved') : $t('settings.apaczka.app_secret.missing')) ?></span>
|
|
</label>
|
|
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn btn--primary"><?= $e($t('settings.apaczka.actions.save')) ?></button>
|
|
</div>
|
|
</form>
|
|
|
|
<form class="mt-12" action="/settings/integrations/apaczka/test" method="post">
|
|
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
|
<button type="submit" class="btn btn--secondary"><?= $e($t('settings.apaczka.actions.test')) ?></button>
|
|
</form>
|
|
</section>
|