refactor(settings/general): drop redundant blockquotes, collapse 3 cards into 2
App-title and language sit in one App identity card now (both single-field sections; separate cards were chrome-heavy). The trivial info blockquotes that paraphrased the field labels are gone, and the per-field descriptions on the user creation defaults dropped because the section blockquote already says when the values apply. The "User creation rules" label is renamed to "User creation defaults" so the card title matches its scope. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,9 +18,6 @@ $defaultRoleId = (int) ($values['default_role_id'] ?? 0);
|
||||
$defaultDepartmentId = (int) ($values['default_department_id'] ?? 0);
|
||||
$appTitle = (string) ($values['app_title'] ?? '');
|
||||
$appLocale = (string) ($values['app_locale'] ?? '');
|
||||
$defaultTenantDesc = $settings['default_tenant']['description'] ?? 'setting.default_tenant';
|
||||
$defaultRoleDesc = $settings['default_role']['description'] ?? 'setting.default_role';
|
||||
$defaultDepartmentDesc = $settings['default_department']['description'] ?? 'setting.default_department';
|
||||
$appTitleDesc = $settings['app_title']['description'] ?? 'setting.app_title';
|
||||
$appLocaleDesc = $settings['app_locale']['description'] ?? 'setting.app_locale';
|
||||
$locales = defined('APP_LOCALES') ? APP_LOCALES : [];
|
||||
@@ -63,59 +60,44 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
|
||||
<span class="app-details-card-summary-title"><?php e(t('App identity')); ?></span>
|
||||
<span class="app-details-card-summary-meta">
|
||||
<span class="badge" data-variant="neutral"><?php e($appTitle !== '' ? t('Configured') : t('Default')); ?></span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="app-details-card-container">
|
||||
<blockquote data-variant="info">
|
||||
<small><?php e(t('This setting controls the application name shown across the UI.')); ?></small>
|
||||
</blockquote>
|
||||
<label class="app-field">
|
||||
<span><?php e(t('App title')); ?> <span class="badge" data-variant="info"><?php e(t('Cached')); ?></span></span>
|
||||
<input type="text" name="app_title" value="<?php e($appTitle); ?>" placeholder="<?php e(appTitle()); ?>" <?php e($readonlyAttr); ?>>
|
||||
<small><?php e(t($appTitleDesc)); ?></small>
|
||||
<small class="muted"><?php e(t('Leave empty to use the runtime default title.')); ?></small>
|
||||
</label>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="app-details-card" name="internationalization" data-details-key="internationalization">
|
||||
<summary>
|
||||
<span class="app-details-card-summary-title"><?php e(t('Internationalization')); ?></span>
|
||||
<span class="app-details-card-summary-meta">
|
||||
<span class="badge" data-variant="neutral"><?php e($appLocale !== '' ? strtoupper($appLocale) : t('Default')); ?></span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="app-details-card-container">
|
||||
<blockquote data-variant="info">
|
||||
<small><?php e(t('This setting controls the default language for users without a personal preference.')); ?></small>
|
||||
</blockquote>
|
||||
<label class="app-field">
|
||||
<span><?php e(t('Default language')); ?> <span class="badge" data-variant="info"><?php e(t('Cached')); ?></span></span>
|
||||
<select name="app_locale" <?php e($disabledAttr); ?>>
|
||||
<option value=""><?php e(t('None')); ?></option>
|
||||
<?php foreach ($locales as $locale): ?>
|
||||
<?php
|
||||
$label = strtoupper($locale);
|
||||
if ($locale === 'de') {
|
||||
$label = t('German');
|
||||
} elseif ($locale === 'en') {
|
||||
$label = t('English');
|
||||
}
|
||||
?>
|
||||
<option value="<?php e($locale); ?>" <?php e($appLocale === $locale ? 'selected' : ''); ?>>
|
||||
<?php e($label); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<small><?php e(t($appLocaleDesc)); ?></small>
|
||||
</label>
|
||||
<div class="grid">
|
||||
<label class="app-field">
|
||||
<span><?php e(t('App title')); ?> <span class="badge" data-variant="info"><?php e(t('Cached')); ?></span></span>
|
||||
<input type="text" name="app_title" value="<?php e($appTitle); ?>" placeholder="<?php e(appTitle()); ?>" <?php e($readonlyAttr); ?>>
|
||||
<small><?php e(t($appTitleDesc)); ?></small>
|
||||
</label>
|
||||
<label class="app-field">
|
||||
<span><?php e(t('Default language')); ?> <span class="badge" data-variant="info"><?php e(t('Cached')); ?></span></span>
|
||||
<select name="app_locale" <?php e($disabledAttr); ?>>
|
||||
<option value=""><?php e(t('None')); ?></option>
|
||||
<?php foreach ($locales as $locale): ?>
|
||||
<?php
|
||||
$label = strtoupper($locale);
|
||||
if ($locale === 'de') {
|
||||
$label = t('German');
|
||||
} elseif ($locale === 'en') {
|
||||
$label = t('English');
|
||||
}
|
||||
?>
|
||||
<option value="<?php e($locale); ?>" <?php e($appLocale === $locale ? 'selected' : ''); ?>>
|
||||
<?php e($label); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<small><?php e(t($appLocaleDesc)); ?></small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<?php $configuredDefaultsCount = (int) ($defaultTenantId > 0) + (int) ($defaultDepartmentId > 0) + (int) ($defaultRoleId > 0); ?>
|
||||
<details class="app-details-card" name="user-creation" data-details-key="user-creation">
|
||||
<summary>
|
||||
<span class="app-details-card-summary-title"><?php e(t('User creation rules')); ?></span>
|
||||
<span class="app-details-card-summary-title"><?php e(t('User creation defaults')); ?></span>
|
||||
<span class="app-details-card-summary-meta">
|
||||
<span class="badge" data-variant="neutral"><?php e(sprintf(t('%d defaults configured'), $configuredDefaultsCount)); ?></span>
|
||||
</span>
|
||||
@@ -138,7 +120,6 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<small><?php e(t($defaultTenantDesc)); ?></small>
|
||||
</label>
|
||||
<label class="app-field">
|
||||
<span><?php e(t('Default department')); ?></span>
|
||||
@@ -153,7 +134,6 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<small><?php e(t($defaultDepartmentDesc)); ?></small>
|
||||
</label>
|
||||
</div>
|
||||
<label class="app-field">
|
||||
@@ -169,7 +149,6 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<small><?php e(t($defaultRoleDesc)); ?></small>
|
||||
</label>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user