1 Commits

4 changed files with 16 additions and 11 deletions

View File

@@ -2,13 +2,17 @@
* FinanceBuddy styles. * FinanceBuddy styles.
*/ */
/* Per-column net total in the column header (its own line, subtle pill). */ /* Per-column net total: its own full-width line under the column title (clears the right-floated
task count), so a wide amount never overflows the column. Keep the background pill (theme-safe
contrast). "Total:" is black; only the amount span is colored by sign. */
.fb-column-total { .fb-column-total {
display: inline-block; display: block;
clear: both;
margin-top: 3px; margin-top: 3px;
padding: 0 5px; padding: 0 5px;
font-weight: bold; font-weight: bold;
font-size: 0.95em; font-size: 0.95em;
color: #000;
background: rgba(0, 0, 0, 0.05); background: rgba(0, 0, 0, 0.05);
border-radius: 3px; border-radius: 3px;
} }

View File

@@ -77,7 +77,7 @@ class Plugin extends Base
public function getPluginVersion() public function getPluginVersion()
{ {
return '1.0.3'; return '1.0.4';
} }
public function getPluginHomepage() public function getPluginHomepage()

View File

@@ -1,7 +1,8 @@
<?php <?php
// Per-column net total in the column header (credits - debits). Shown in every column of an // Per-column net total in the column header (credits - debits). Shown in every column of an
// enabled board, including "total R$0,00" -- never hidden on zero. Server-side, re-renders on // enabled board, including "Total: R$0,00" -- never hidden on zero. Server-side, re-renders on
// every board refresh. // every board refresh. Rendered on its own full-width line under the title; "Total:" stays the
// default (black) and only the amount is colored by sign.
if (empty($column['project_id']) || ! $this->FinanceHelper->isEnabled($column['project_id'])) { if (empty($column['project_id']) || ! $this->FinanceHelper->isEnabled($column['project_id'])) {
return; return;
} }
@@ -9,16 +10,16 @@ if (empty($column['project_id']) || ! $this->FinanceHelper->isEnabled($column['p
$net = $this->FinanceHelper->columnNet($column); $net = $this->FinanceHelper->columnNet($column);
if ($net > 0) { if ($net > 0) {
$class = 'fb-column-total fb-total-credit'; $amount_class = 'fb-total-credit';
$sign = '+'; $sign = '+';
} elseif ($net < 0) { } elseif ($net < 0) {
$class = 'fb-column-total fb-total-debit'; $amount_class = 'fb-total-debit';
$sign = '-'; $sign = '-';
} else { } else {
$class = 'fb-column-total fb-total-zero'; $amount_class = 'fb-total-zero';
$sign = ''; $sign = '';
} }
?> ?>
<div class="<?= $class ?>"> <div class="fb-column-total">
<?= t('Total') ?>: <span class="fb-amount"><?= $sign ?>R$<?= \Kanboard\Plugin\FinanceBuddy\Helper\FinanceHelper::money(abs($net)) ?></span> <?= t('Total') ?>: <span class="fb-amount <?= $amount_class ?>"><?= $sign ?>R$<?= \Kanboard\Plugin\FinanceBuddy\Helper\FinanceHelper::money(abs($net)) ?></span>
</div> </div>

View File

@@ -1 +1 @@
FinanceBuddy v1.0.3 FinanceBuddy v1.0.4