Keep scale labels in place when switching to stars #44

Merged
gnilebein merged 1 commits from feature/star-rating into main 2026-11-11 13:10:15 +01:00
2 changed files with 5 additions and 1 deletions

No files matched your search

+4 -1
View File
@@ -156,7 +156,7 @@ $optionsError = $slide->getError('options_text');
['value' => \App\Model\Entity\Slide::SCALE_STARS, 'text' => __('Sterne (wie bei einer Produktbewertung)')],
], ['value' => $settings['style']]) ?>
</fieldset>
<div class="grid grid--2 grid--tight">
<div class="grid grid--2 grid--fill grid--tight">
<?= $this->Form->control('settings.scale_min', [
'type' => 'select', 'options' => [0 => '0', 1 => '1'],
'label' => __('Von'), 'value' => $settings['scale_min'],
@@ -168,6 +168,9 @@ $optionsError = $slide->getError('options_text');
'label' => $stars ? __('Anzahl Sterne') : __('Bis'), 'value' => $settings['scale_max'],
'data-label-numbers' => __('Bis'), 'data-label-stars' => __('Anzahl Sterne'),
]) ?>
</div>
<?php // Labels in their own row, so hiding "Von" (stars) does not move them. ?>
<div class="grid grid--2 grid--tight">
<?= $this->Form->control('settings.min_label', [
'label' => __('Beschriftung links (optional)'), 'maxlength' => 60,
'placeholder' => __('z. B. gar nicht'), 'value' => $settings['min_label'],
+1
View File
@@ -127,6 +127,7 @@ h3 { font-size: 1.05rem; margin-top: 1.6em; }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--fill { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } /* keeps empty columns: a lone field stays half width */
.grid--tight { gap: 0 16px; }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 900px) {