From 9d74c8830a5a14c76ba03dd39edf4a4d0dbcf209 Mon Sep 17 00:00:00 2001 From: fs Date: Sat, 25 Apr 2026 18:37:55 +0200 Subject: [PATCH] refactor(settings/branding): two side-by-side upload cards via barrier forms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Branding now follows the tenant-logos pattern: four hidden barrier forms (logo upload + delete, favicon upload + delete) declared once at the top and two file-upload partials placed side-by-side inside a grid, hooked to their forms via the HTML5 form="..." attribute. The redundant preview wrapper above each upload is gone — the file-upload partial already renders the current image, replace/delete buttons and metadata. The favicon hint moves from a separate blockquote into the upload's hint field so it sits in the dropzone where it matters. Co-Authored-By: Claude Opus 4.7 (1M context) --- i18n/default_de.json | 3 + i18n/default_en.json | 3 + pages/admin/settings/branding(default).phtml | 148 ++++++++++--------- 3 files changed, 85 insertions(+), 69 deletions(-) diff --git a/i18n/default_de.json b/i18n/default_de.json index 63547ca..44fd906 100644 --- a/i18n/default_de.json +++ b/i18n/default_de.json @@ -820,6 +820,7 @@ "Please select a primary tenant": "Bitte einen Hauptmandanten auswählen", "Please select at least one tenant": "Bitte mindestens einen Mandanten auswählen", "Please verify your email first": "Bitte bestätige zuerst deine E-Mail", + "PNG, square recommended (icons are center-cropped)": "PNG, quadratisch empfohlen (Icons werden zentriert beschnitten)", "Policy": "Regel", "Port": "Port", "POST Parameters": "POST-Parameter", @@ -886,6 +887,8 @@ "Remove permission": "Berechtigung entfernen", "Remove role": "Rolle entfernen", "Remove selected file": "Ausgewaehlte Datei entfernen", + "Remove the app logo?": "App-Logo entfernen?", + "Remove the favicon?": "Favicon entfernen?", "Replace": "Ersetzen", "Request": "Anfrage", "Request details": "Request-Details", diff --git a/i18n/default_en.json b/i18n/default_en.json index 87fe25d..fc68ae2 100644 --- a/i18n/default_en.json +++ b/i18n/default_en.json @@ -820,6 +820,7 @@ "Please select a primary tenant": "Please select a primary tenant", "Please select at least one tenant": "Please select at least one tenant", "Please verify your email first": "Please verify your email first", + "PNG, square recommended (icons are center-cropped)": "PNG, square recommended (icons are center-cropped)", "Policy": "Policy", "Port": "Port", "POST Parameters": "POST Parameters", @@ -886,6 +887,8 @@ "Remove permission": "Remove permission", "Remove role": "Remove role", "Remove selected file": "Remove selected file", + "Remove the app logo?": "Remove the app logo?", + "Remove the favicon?": "Remove the favicon?", "Replace": "Replace", "Request": "Request", "Request details": "Request details", diff --git a/pages/admin/settings/branding(default).phtml b/pages/admin/settings/branding(default).phtml index 643967a..ac4ca4b 100644 --- a/pages/admin/settings/branding(default).phtml +++ b/pages/admin/settings/branding(default).phtml @@ -23,82 +23,92 @@ $hasFavicon = app(\MintyPHP\Service\Branding\BrandingFaviconService::class)->has require templatePath('partials/app-details-titlebar.phtml'); ?> -
- - - - - - -
-
- - <?php e(t('App logo')); ?> - -
- -
- 'logo', - 'accept' => 'image/svg+xml,image/png,image/jpeg,image/webp', - 'hint' => t('Allowed file types: SVG, PNG, JPG, WEBP'), - 'currentSrc' => $hasLogo ? appLogoUrl(128) : '', - 'deleteAction' => $hasLogo ? 'admin/settings/logo-delete' : '', - ]; - require templatePath('partials/app-file-upload.phtml'); - ?> -
- - -
- -
- -
-
+ + + + + + -
- - - - - - -
-
- -
- -
- 'favicon', - 'accept' => 'image/png', - 'hint' => t('Allowed file types: PNG'), - 'currentSrc' => $hasFavicon ? asset('favicon/favicon-32x32.png') : '', - 'currentLabel' => t('Favicon'), - 'deleteAction' => $hasFavicon ? 'admin/settings/favicon-delete' : '', - ]; - require templatePath('partials/app-file-upload.phtml'); - ?> +
+
+ + + + + + +
+ 'logo', + 'accept' => 'image/svg+xml,image/png,image/jpeg,image/webp', + 'hint' => t('Allowed file types: SVG, PNG, JPG, WEBP'), + 'currentSrc' => $hasLogo ? appLogoUrl(256) : '', + 'currentLabel' => t('App logo'), + 'formId' => $canUpdateSettings ? 'branding-logo-form' : '', + 'deleteFormId' => $hasLogo && $canUpdateSettings ? 'branding-logo-delete-form' : '', + 'deleteConfirm' => t('Remove the app logo?'), + ]; + require templatePath('partials/app-file-upload.phtml'); + ?> +
- -
- - - -
-
+ +
+
+ +
+ + + + + + +
+ 'favicon', + 'accept' => 'image/png', + 'hint' => t('PNG, square recommended (icons are center-cropped)'), + 'currentSrc' => $hasFavicon ? asset('favicon/favicon-32x32.png') : '', + 'currentLabel' => t('Favicon'), + 'formId' => $canUpdateSettings ? 'branding-favicon-form' : '', + 'deleteFormId' => $hasFavicon && $canUpdateSettings ? 'branding-favicon-delete-form' : '', + 'deleteConfirm' => t('Remove the favicon?'), + ]; + require templatePath('partials/app-file-upload.phtml'); + ?> + +
+ + +
+ +
+
+