Skip to content

Commit

Permalink
Provide persistent labels for grid selects.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimisgold committed Feb 8, 2024
1 parent 024833c commit 459fe21
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
26 changes: 15 additions & 11 deletions application/view/common/block-layout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');

$layoutGridColumnPositionOptions = ['auto' => $translate('Auto placement')];
$layoutGridColumnPositionOptions = ['auto' => $translate('Auto')];
foreach (range(1, 12) as $value) {
$layoutGridColumnPositionOptions[$value] = sprintf($translate('Position %s'), $value);
}
Expand All @@ -26,16 +26,20 @@ if ('blockGroup' === $layout) {
<span class="restore-value"><?php echo $translate('Block to be removed'); ?></span>
<?php if ('blockGroup' !== $layout): ?>
<span class="block-page-layout-grid-controls">
<select class="block-page-layout-grid-column-position-select" data-block-page-layout-grid-column-position="<?php echo $escape($layoutGridColumnPosition); ?>">
<?php foreach ($layoutGridColumnPositionOptions as $key => $value): ?>
<option value="<?php echo $escape($key); ?>"<?php echo ($layoutGridColumnPosition == $key) ? ' selected' : '' ?>><?php echo $escape($value); ?></option>
<?php endforeach; ?>
</select>
<select class="block-page-layout-grid-column-span-select" data-block-page-layout-grid-column-span="<?php echo $escape($layoutGridColumnSpan); ?>">
<?php foreach ($layoutGridColumnSpanOptions as $key => $value): ?>
<option value="<?php echo $escape($key); ?>"<?php echo ($layoutGridColumnSpan == $key) ? ' selected' : '' ?>><?php echo $escape($value); ?></option>
<?php endforeach; ?>
</select>
<label><?php echo $translate('Position'); ?>
<select class="block-page-layout-grid-column-position-select" data-block-page-layout-grid-column-position="<?php echo $escape($layoutGridColumnPosition); ?>">
<?php foreach ($layoutGridColumnPositionOptions as $key => $value): ?>
<option value="<?php echo $escape($key); ?>"<?php echo ($layoutGridColumnPosition == $key) ? ' selected' : '' ?>><?php echo $escape($key); ?></option>
<?php endforeach; ?>
</select>
</label>
<label><?php echo $translate('Span'); ?>
<select class="block-page-layout-grid-column-span-select" data-block-page-layout-grid-column-span="<?php echo $escape($layoutGridColumnSpan); ?>">
<?php foreach ($layoutGridColumnSpanOptions as $key => $value): ?>
<option value="<?php echo $escape($key); ?>"<?php echo ($layoutGridColumnSpan == $key) ? ' selected' : '' ?>><?php echo $escape($key); ?></option>
<?php endforeach; ?>
</select>
</label>
</span>
<?php endif; ?>
<ul class="actions center">
Expand Down
13 changes: 8 additions & 5 deletions application/view/omeka/site-admin/page/edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ $form->prepare();
<?php endforeach; ?>
</select>
</label>
<select name="o:layout_data[grid_columns]" id="page-layout-grid-columns-select" data-page-layout-grid-columns="<?php echo $escape($pageLayoutGridColumns); ?>">
<?php foreach ($pageLayoutGridColumnsOptions as $key => $value): ?>
<option value="<?php echo $escape($key); ?>"<?php echo ($pageLayoutGridColumns == $key) ? ' selected' : '' ?>><?php echo $escape($value); ?></option>
<?php endforeach; ?>
</select>
<label id="total-columns-label">
<?php echo $translate('Columns'); ?>
<select name="o:layout_data[grid_columns]" id="page-layout-grid-columns-select" data-page-layout-grid-columns="<?php echo $escape($pageLayoutGridColumns); ?>">
<?php foreach ($pageLayoutGridColumnsOptions as $key => $value): ?>
<option value="<?php echo $escape($key); ?>"<?php echo ($pageLayoutGridColumns == $key) ? ' selected' : '' ?>><?php echo $escape($key); ?></option>
<?php endforeach; ?>
</select>
</label>
<ul class="actions center">
<li><a href="#" id="preview-page-layout" aria-label="<?php echo $escape($translate('Preview layout')); ?>" title="<?php echo $escape($translate('Preview layout')); ?>"></a></li>
<li><a href="#" id="configure-page-layout-data" class="o-icon-settings" aria-label="<?php echo $escape($translate('Configure layout')); ?>" title="<?php echo $escape($translate('Configure layout')); ?>"></a></li>
Expand Down

0 comments on commit 459fe21

Please sign in to comment.