The [x] Done / [ ] Due checkbox v2.0
This commit is contained in:
23
Template/board/done_badge.php
Normal file
23
Template/board/done_badge.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Done/Due badge on the board card face. Rendered by template:board:private:task:before-title; the
|
||||
* CSS in layout/done_style.php pins it to the top-right (below the header) and colors the two states.
|
||||
* Only shown to users who may edit the task (a read-only viewer sees no badge). Expanded cards only
|
||||
* (collapsed cards do not fire this hook).
|
||||
*/
|
||||
if (! $this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])) {
|
||||
return;
|
||||
}
|
||||
$done = $this->OrganonDoneHelper->isDone($task);
|
||||
?>
|
||||
<span class="organontweaks-done<?= $done ? ' is-done' : '' ?>">
|
||||
<?= $this->url->link(
|
||||
$done ? '<i class="fa fa-check-square fa-fw"></i> '.t('Done') : '<i class="fa fa-square-o fa-fw"></i> '.t('Due'),
|
||||
'DoneController',
|
||||
'toggle',
|
||||
array('plugin' => 'OrganonTweaks', 'task_id' => $task['id'], 'project_id' => $task['project_id'], 'from' => 'board'),
|
||||
true,
|
||||
'',
|
||||
$done ? t('Mark as not done') : t('Mark as done')
|
||||
) ?>
|
||||
</span>
|
||||
@@ -62,6 +62,16 @@
|
||||
<p class="form-help"><?= t('Replaces the native column sort with a control that adds a number-aware Title sort and a "Persistent sort: ON/OFF" toggle. When ON, the column is re-sorted whenever a card is dropped in or created, so it stays sorted (a red up/down arrow marks it). OFF is the native one-shot sort.') ?></p>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?= t('Done badge') ?></legend>
|
||||
|
||||
<?= $this->form->checkbox('organon_tweaks_done_badge', t('Show a Done/Due badge on cards'), 1, isset($values['organon_tweaks_done_badge']) && $values['organon_tweaks_done_badge'] == 1) ?>
|
||||
<p class="form-help"><?= t('A two-state toggle badge on the board card (top-right) and the task view (near the due date): "Due" (red) until you click it, then "Done" (green). Off by default.') ?></p>
|
||||
|
||||
<?= $this->form->checkbox('organon_tweaks_done_closes_task', t('Marking Done also closes the task'), 1, isset($values['organon_tweaks_done_closes_task']) && $values['organon_tweaks_done_closes_task'] == 1) ?>
|
||||
<p class="form-help"><?= t('When on, "Done" means the task is closed (so it leaves the board unless you clear the status filter), and clicking Due reopens it -- native Close/Open stay in sync. When off, the badge is an independent marker that never changes the open/closed status.') ?></p>
|
||||
</fieldset>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
</div>
|
||||
|
||||
33
Template/layout/done_style.php
Normal file
33
Template/layout/done_style.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Done/Due badge styling (emitted into the head when the feature is enabled). Two states via
|
||||
* .is-done. The Due colors reuse FinanceBuddy's debit badge (#b94a48 / white); Done is a light green
|
||||
* with black font. On the board the badge is pinned top-right, below the header (the card .task-board
|
||||
* is position:relative); the title reserves right padding so the badge does not cover it. In the task
|
||||
* view it is a normal inline list item. Font size is inherited (0.9em on the board, matching the card
|
||||
* id / assignee). All values are safe to tune.
|
||||
*/
|
||||
?>
|
||||
<style>
|
||||
.organontweaks-done a {
|
||||
text-decoration: none;
|
||||
padding: 0 5px;
|
||||
border-radius: 3px;
|
||||
background: #b94a48;
|
||||
color: #fff;
|
||||
}
|
||||
.organontweaks-done.is-done a {
|
||||
background: #a5d6a7;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.task-board .organontweaks-done {
|
||||
position: absolute;
|
||||
top: 24px;
|
||||
right: 5px;
|
||||
z-index: 5;
|
||||
}
|
||||
.task-board .task-board-title {
|
||||
padding-right: 4.2em;
|
||||
}
|
||||
</style>
|
||||
24
Template/task/done_badge.php
Normal file
24
Template/task/done_badge.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Done/Due badge in the task view, 4th column (near the due date). Rendered by
|
||||
* template:task:details:fourth-column as a list item, matching the surrounding <li> fields. Same
|
||||
* two-state toggle as the board badge; only shown to users who may edit the task.
|
||||
*/
|
||||
if (! $this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])) {
|
||||
return;
|
||||
}
|
||||
$done = $this->OrganonDoneHelper->isDone($task);
|
||||
?>
|
||||
<li>
|
||||
<span class="organontweaks-done<?= $done ? ' is-done' : '' ?>">
|
||||
<?= $this->url->link(
|
||||
$done ? '<i class="fa fa-check-square fa-fw"></i> '.t('Done') : '<i class="fa fa-square-o fa-fw"></i> '.t('Due'),
|
||||
'DoneController',
|
||||
'toggle',
|
||||
array('plugin' => 'OrganonTweaks', 'task_id' => $task['id'], 'project_id' => $task['project_id'], 'from' => 'task'),
|
||||
true,
|
||||
'',
|
||||
$done ? t('Mark as not done') : t('Mark as done')
|
||||
) ?>
|
||||
</span>
|
||||
</li>
|
||||
Reference in New Issue
Block a user