feat(ui): copyable input partial + dynamic copy-target

- New core partial templates/partials/app-input-copy.phtml renders a
  standard label + input with a compact copy button overlaid on the
  right edge of the input. Used for privacy/imprint URLs on the tenant
  form; reusable for any field where a one-click copy is helpful.
- Extend the shared copy-field component (web/js/components/app-copy-field.js)
  with data-copy-target support — the button now reads the target input's
  .value at click-time, so users can edit a field and still copy the
  current value. Static data-copy-value keeps working unchanged.
- New component CSS web/css/components/app-input-copy.css positions the
  button absolute/inset + margin-block:auto (robust vertical centering
  regardless of input height) and uses a descendant selector (0,2,0)
  so the button wins over the global [data-tooltip] position:relative.
- Also register app-input-copy.css + app-tenant-logo.css in core.css
  @import list — they were only in the shared asset group before, which
  default-template admin pages don't load, so tenant-logo styles were
  effectively missing on admin tenant edit (topbar size etc.).
- Document the Copy-to-Clipboard + Copyable Input standards in
  docs/reference-frontend-javascript.md so future consumers don't
  re-invent the markup/selectors.
- File-upload preview: pending-file block restructured to a compact
  list-item row (small square thumb + filename/size stack + clear X)
  and removed the transparency checker pattern on the current-image
  preview in favour of a flat --app-preview-bg surface.
- Tenant edit page title + breadcrumb now show the tenant description
  ("Acme GmbH") instead of the generic "Mandant bearbeiten" when one
  is present.
- i18n: add "Copy to clipboard" / "In Zwischenablage kopieren" across
  both locales.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 21:26:11 +02:00
parent e814b5fd11
commit fa86009e3f
12 changed files with 262 additions and 41 deletions

View File

@@ -310,16 +310,22 @@ $openOverrideCard = $detailsOpenAll;
<summary><?php e(t('Legal')); ?></summary>
<hr>
<div class="grid">
<label for="privacy_url">
<span><?php e(t('Privacy URL')); ?></span>
<input type="url" name="privacy_url" id="privacy_url" value="<?php e($values['privacy_url'] ?? ''); ?>"
<?php e($readonlyAttr); ?> />
</label>
<label for="imprint_url">
<span><?php e(t('Imprint URL')); ?></span>
<input type="url" name="imprint_url" id="imprint_url" value="<?php e($values['imprint_url'] ?? ''); ?>"
<?php e($readonlyAttr); ?> />
</label>
<?php
$name = 'privacy_url';
$label = t('Privacy URL');
$type = 'url';
$value = (string) ($values['privacy_url'] ?? '');
$readonly = $isReadOnly;
require templatePath('partials/app-input-copy.phtml');
?>
<?php
$name = 'imprint_url';
$label = t('Imprint URL');
$type = 'url';
$value = (string) ($values['imprint_url'] ?? '');
$readonly = $isReadOnly;
require templatePath('partials/app-input-copy.phtml');
?>
</div>
</details>
</div>

View File

@@ -181,7 +181,9 @@ if ($canManageSso && empty($ldapUiState)) {
$validationSummaryErrors = $errorBag->toArray();
$errors = $errorBag->toFlatList();
$titleText = $canUpdateTenant ? t('Edit tenant') : t('View tenant');
$tenantLabel = trim((string) ($form['description'] ?? $tenant['description'] ?? ''));
$fallbackTitle = $canUpdateTenant ? t('Edit tenant') : t('View tenant');
$titleText = $tenantLabel !== '' ? $tenantLabel : $fallbackTitle;
Buffer::set('title', $titleText);
$breadcrumbs = [
['label' => t('Home'), 'path' => 'admin'],

View File

@@ -15,7 +15,10 @@ $canDeleteTenant = (bool) ($pageAuth['can_delete_tenant'] ?? false);
$canManageCustomFields = (bool) ($pageAuth['can_manage_custom_fields'] ?? false);
$canManageSso = (bool) ($pageAuth['can_manage_sso'] ?? false);
$isReadOnly = !$canUpdateTenant;
$titleText = $isReadOnly ? t('View tenant') : t('Edit tenant');
$tenantDescription = trim((string) ($values['description'] ?? ''));
$titleText = $tenantDescription !== ''
? $tenantDescription
: ($isReadOnly ? t('View tenant') : t('Edit tenant'));
$tenantUuid = (string) ($values['uuid'] ?? '');
$tenantLogoService = app(\MintyPHP\Service\Tenant\TenantLogoService::class);
$tenantFaviconService = app(\MintyPHP\Service\Tenant\TenantFaviconService::class);