Templates php

This commit is contained in:
2026-07-01 09:51:41 -03:00
parent 99fa73433a
commit 57bab4650b
3 changed files with 44 additions and 0 deletions

33
Template/config/show.php Normal file
View File

@@ -0,0 +1,33 @@
<div class="page-header">
<h2><?= t('Tweak Drag') ?></h2>
</div>
<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('plugin' => 'TweakDrag')) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<fieldset>
<?= $this->form->label(t('Column gap in pixels'), 'tweakdrag_column_gap_size') ?>
<?= $this->form->number('tweakdrag_column_gap_size', $values, $errors) ?>
<p class="form-help">
<?= t('Width of the gap between board columns when the option below is on. Default: 25.') ?>
</p>
</fieldset>
<fieldset>
<?= $this->form->checkbox('tweakdrag_column_gap', t('Widen the gap between columns'), 1, isset($values['tweakdrag_column_gap']) && $values['tweakdrag_column_gap'] == 1) ?>
<p class="form-help">
<?= t('Spreads the board columns further apart (by the pixel value above), easier to tell apart and to touch. Also adds some spacing at the left and right edges of the board.') ?>
</p>
</fieldset>
<fieldset>
<?= $this->form->checkbox('tweakdrag_drag_scroll', t('Drag the board background to scroll horizontally'), 1, isset($values['tweakdrag_drag_scroll']) && $values['tweakdrag_drag_scroll'] == 1) ?>
<p class="form-help">
<?= t('Like Trello: click and drag on the empty board background to scroll the columns sideways. Dragging a task card or a handle still works as usual.') ?>
</p>
</fieldset>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
</div>
</form>

View File

@@ -0,0 +1,3 @@
<li <?= $this->app->checkMenuSelection('ConfigController', 'show', 'TweakDrag') ?>>
<?= $this->url->link(t('Tweak Drag'), 'ConfigController', 'show', array('plugin' => 'TweakDrag')) ?>
</li>

View File

@@ -0,0 +1,8 @@
<style type="text/css">
:root {
--td-column-gap: <?= (int) $this->app->config('tweakdrag_column_gap_size', 25) ?>px;
}
<?php if ((int) $this->app->config('tweakdrag_column_gap', 1) === 1): ?>
#board { border-collapse: separate !important; border-spacing: var(--td-column-gap, 25px) 0 !important; }
<?php endif ?>
</style>