Skip to content

Firefly III: a personal finances manager

Various cosmetic fixes for /all lists [skip ci]

James Cole20a30a2d1d76
diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php
index 7975bc26a5..ac47290093 100644
--- a/app/Http/Controllers/CategoryController.php
+++ b/app/Http/Controllers/CategoryController.php
@@ -402,7 +402,7 @@ class CategoryController extends Controller
// count journals without budget in this period:
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
- $collector->setAllAssetAccounts()->setRange($end, $currentEnd)->withoutCategory()->withOpposingAccount();
+ $collector->setAllAssetAccounts()->setRange($end, $currentEnd)->withoutCategory()->withOpposingAccount()->disableInternalFilter();
$count = $collector->getJournals()->count();
// amount transferred
diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php
index 72f24920d6..5d8ba72116 100644
--- a/app/Http/breadcrumbs.php
+++ b/app/Http/breadcrumbs.php
@@ -274,6 +274,7 @@ Breadcrumbs::register(
'budgets.show', function (BreadCrumbGenerator $breadcrumbs, Budget $budget) {
$breadcrumbs->parent('budgets.index');
$breadcrumbs->push(e($budget->name), route('budgets.show', [$budget->id]));
+ $breadcrumbs->push(trans('firefly.everything'), route('budgets.show', [$budget->id]));
}
);
@@ -723,9 +724,19 @@ Breadcrumbs::register(
Breadcrumbs::register(
- 'tags.show', function (BreadCrumbGenerator $breadcrumbs, Tag $tag) {
+ 'tags.show', function (BreadCrumbGenerator $breadcrumbs, Tag $tag, string $moment, Carbon $start, Carbon $end) {
$breadcrumbs->parent('tags.index');
- $breadcrumbs->push(e($tag->tag), route('tags.show', [$tag->id]));
+ $breadcrumbs->push(e($tag->tag), route('tags.show', [$tag->id], $moment));
+ if ($moment === 'all') {
+ $breadcrumbs->push(trans('firefly.everything'), route('tags.show', [$tag->id], $moment));
+ }
+ if($moment !== '') {
+ $title = trans(
+ 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))),
+ 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))]
+ );
+ $breadcrumbs->push($title, route('tags.show', [$tag->id], $moment));
+ }
}
);
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 2190dcdc92..965c7c5f46 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -131,9 +131,11 @@ return [
'all_transfers' => 'All transfers',
'title_transfers_between' => 'All transfers between :start and :end',
'all_transfer' => 'All transfers',
+ 'all_journals_for_tag' => 'All transactions for tag ":tag"',
'title_transfer_between' => 'All transfers between :start and :end',
'all_journals_for_category' => 'All transactions for category :name',
'journals_in_period_for_category' => 'All transactions for category :name between :start and :end',
+ 'journals_in_period_for_tag' => 'All transactions for tag :tag between :start and :end',
'not_available_demo_user' => 'The feature you try to access is not available to demo users.',
'exchange_rate_instructions' => 'Asset account "@name" only accepts transactions in @native_currency. If you wish to use @foreign_currency instead, make sure that the amount in @native_currency is known as well:',
'transfer_exchange_rate_instructions' => 'Source asset account "@source_name" only accepts transactions in @source_currency. Destination asset account "@dest_name" only accepts transactions in @dest_currency. You must provide the transferred amount correctly in both currencies.',
diff --git a/resources/views/accounts/show.twig b/resources/views/accounts/show.twig
index d7aff66784..157ec9d074 100644
--- a/resources/views/accounts/show.twig
+++ b/resources/views/accounts/show.twig
@@ -104,7 +104,7 @@
{% if periods.count > 0 %}
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% for period in periods %}
- {% if (period.spent != 0 or period.earned != 0) or (accountType == 'Asset account') %}
+ {% if (period.spent != 0 or period.earned != 0) %}
<div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
<div class="box-header with-border">
<h3 class="box-title"><a href="{{ route('accounts.show',[account.id,period.string]) }}">{{ period.name }}</a>
diff --git a/resources/views/budgets/no-budget.twig b/resources/views/budgets/no-budget.twig
index 2509c7eb22..fd23bde560 100644
--- a/resources/views/budgets/no-budget.twig
+++ b/resources/views/budgets/no-budget.twig
@@ -41,24 +41,26 @@
{% if periods.count > 0 %}
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% for period in periods %}
- <div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
- <div class="box-header with-border">
- <h3 class="box-title"><a href="{{ route('budgets.no-budget',[period.string]) }}">{{ period.name }}</a>
- </h3>
+ {% if period.count > 0 %}
+ <div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
+ <div class="box-header with-border">
+ <h3 class="box-title"><a href="{{ route('budgets.no-budget',[period.string]) }}">{{ period.name }}</a>
+ </h3>
+ </div>
+ <div class="box-body no-padding">
+ <table class="table table-hover">
+ <tr>
+ <td style="width:33%;">{{ 'transactions'|_ }}</td>
+ <td style="text-align: right;">{{ period.count }}</td>
+ </tr>
+ <tr>
+ <td style="width:33%;">{{ 'spent'|_ }}</td>
+ <td style="text-align: right;">{{ period.sum|formatAmount }}</td>
+ </tr>
+ </table>
+ </div>
</div>
- <div class="box-body no-padding">
- <table class="table table-hover">
- <tr>
- <td style="width:33%;">{{ 'transactions'|_ }}</td>
- <td style="text-align: right;">{{ period.count }}</td>
- </tr>
- <tr>
- <td style="width:33%;">{{ 'spent'|_ }}</td>
- <td style="text-align: right;">{{ period.sum|formatAmount }}</td>
- </tr>
- </table>
- </div>
- </div>
+ {% endif %}
{% endfor %}
</div>
{% endif %}
diff --git a/resources/views/budgets/show.twig b/resources/views/budgets/show.twig
index 93f7cabe37..8cf4719544 100644
--- a/resources/views/budgets/show.twig
+++ b/resources/views/budgets/show.twig
@@ -44,6 +44,14 @@
</div>
<div class="box-body">
{% include 'list.journals-tasker' with {hideBudgets:true, hideBills:true} %}
+ {% if budgetLimit %}
+ <p>
+ <i class="fa fa-calendar" aria-hidden="true"></i>
+ <a href="{{ route('budgets.show', [budget.id]) }}">
+ {{ 'show_all_no_filter'|_ }}
+ </a>
+ </p>
+ {% endif %}
</div>
</div>
</div>
diff --git a/resources/views/categories/no-category.twig b/resources/views/categories/no-category.twig
index 601c371a62..c6ebc131f4 100644
--- a/resources/views/categories/no-category.twig
+++ b/resources/views/categories/no-category.twig
@@ -41,32 +41,40 @@
{% if periods.count > 0 %}
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% for period in periods %}
- <div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
- <div class="box-header with-border">
- <h3 class="box-title"><a href="{{ route('categories.no-category',[period.string]) }}">{{ period.name }}</a>
- </h3>
+ {% if period.count > 0 %}
+ <div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
+ <div class="box-header with-border">
+ <h3 class="box-title"><a href="{{ route('categories.no-category',[period.string]) }}">{{ period.name }}</a>
+ </h3>
+ </div>
+ <div class="box-body no-padding">
+ <table class="table table-hover">
+ <tr>
+ <td style="width:33%;">{{ 'transactions'|_ }}</td>
+ <td style="text-align: right;">{{ period.count }}</td>
+ </tr>
+ {% if period.spent != 0 %}
+ <tr>
+ <td style="width:33%;">{{ 'spent'|_ }}</td>
+ <td style="text-align: right;">{{ period.spent|formatAmount }}</td>
+ </tr>
+ {% endif %}
+ {% if period.earned != 0 %}
+ <tr>
+ <td style="width:33%;">{{ 'earned'|_ }}</td>
+ <td style="text-align: right;">{{ period.earned|formatAmount }}</td>
+ </tr>
+ {% endif %}
+ {% if period.transferred != 0 %}
+ <tr>
+ <td style="width:33%;">{{ 'transferred'|_ }}</td>
+ <td style="text-align: right;" class="text-info">{{ period.transferred|formatAmountPlain }}</td>
+ </tr>
+ {% endif %}
+ </table>
+ </div>
</div>
- <div class="box-body no-padding">
- <table class="table table-hover">
- <tr>
- <td style="width:33%;">{{ 'transactions'|_ }}</td>
- <td style="text-align: right;">{{ period.count }}</td>
- </tr>
- <tr>
- <td style="width:33%;">{{ 'spent'|_ }}</td>
- <td style="text-align: right;">{{ period.spent|formatAmount }}</td>
- </tr>
- <tr>
- <td style="width:33%;">{{ 'earned'|_ }}</td>
- <td style="text-align: right;">{{ period.earned|formatAmount }}</td>
- </tr>
- <tr>
- <td style="width:33%;">{{ 'transferred'|_ }}</td>
- <td style="text-align: right;" class="text-info">{{ period.transferred|formatAmountPlain }}</td>
- </tr>
- </table>
- </div>
- </div>
+ {% endif %}
{% endfor %}
</div>
{% endif %}
diff --git a/resources/views/categories/show.twig b/resources/views/categories/show.twig
index 13a43903b2..d3d29e3b8a 100644
--- a/resources/views/categories/show.twig
+++ b/resources/views/categories/show.twig
@@ -73,7 +73,7 @@
</div>
<div class="box-body">
{% include 'list.journals-tasker' with {hideCategories: true} %}
- {% if entries %}
+ {% if periods %}
<p>
<i class="fa fa-calendar" aria-hidden="true"></i>
<a href="{{ route('categories.show', [category.id,'all']) }}">
@@ -94,34 +94,42 @@
{% if periods.count > 0 %}
<div class="col-lg-2 col-md-4 col-sm-12 col-xs-12">
{% for period in periods %}
- <div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
- <div class="box-header with-border">
- <h3 class="box-title"><a href="{{ route('categories.show',[category.id,period.string]) }}">{{ period.name }}</a>
- </h3>
+ {% if period.spent != 0 or period.earned != 0 or period.sum != 0 %}
+ <div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
+ <div class="box-header with-border">
+ <h3 class="box-title"><a href="{{ route('categories.show',[category.id,period.string]) }}">{{ period.name }}</a>
+ </h3>
+ </div>
+ <div class="box-body no-padding">
+ <table class="table table-hover">
+ {% if period.spent != 0 %}
+ <tr>
+ <td style="width:33%;">{{ 'spent'|_ }}</td>
+ <td style="text-align: right;">{{ period.spent|formatAmount }}</td>
+ </tr>
+ {% endif %}
+ {% if period.earned != 0 %}
+ <tr>
+ <td style="width:33%;">{{ 'earned'|_ }}</td>
+ <td style="text-align: right;">{{ period.earned|formatAmount }}</td>
+ </tr>
+ {% endif %}
+ {% if period.earned != 0 and period.spent != 0 %}
+ <tr>
+ <td style="width:33%;">{{ 'sum'|_ }}</td>
+ <td style="text-align: right;">{{ period.sum|formatAmount }}</td>
+ </tr>
+ {% endif %}
+ {% if period.transferred != 0 %}
+ <tr>
+ <td style="width:33%;">{{ 'transferred'|_ }}</td>
+ <td style="text-align: right;" class="text-info">{{ period.transferred|formatAmountPlain }}</td>
+ </tr>
+ {% endif %}
+ </table>
+ </div>
</div>
- <div class="box-body no-padding">
- <table class="table table-hover">
- <tr>
- <td style="width:33%;">{{ 'spent'|_ }}</td>
- <td style="text-align: right;">{{ period.spent|formatAmount }}</td>
- </tr>
- <tr>
- <td style="width:33%;">{{ 'earned'|_ }}</td>
- <td style="text-align: right;">{{ period.earned|formatAmount }}</td>
- </tr>
- {% if period.earned != 0 and period.spent != 0 %}
- <tr>
- <td style="width:33%;">{{ 'sum'|_ }}</td>
- <td style="text-align: right;">{{ period.sum|formatAmount }}</td>
- </tr>
- {% endif %}
- <tr>
- <td style="width:33%;">{{ 'transferred'|_ }}</td>
- <td style="text-align: right;" class="text-info">{{ period.transferred|formatAmountPlain }}</td>
- </tr>
- </table>
- </div>
- </div>
+ {% endif %}
{% endfor %}
</div>
{% endif %}
diff --git a/resources/views/tags/show.twig b/resources/views/tags/show.twig
index 75845f6132..dd59f3d558 100644
--- a/resources/views/tags/show.twig
+++ b/resources/views/tags/show.twig
@@ -102,23 +102,6 @@
</div>
</div>
<div class="box-body">
-
- {% if periods %}
- <p>
- <i class="fa fa-calendar" aria-hidden="true"></i>
- <a href="{{ route('tags.show', [tag.id,'all']) }}">
- {{ 'show_all_no_filter'|_ }}
- </a>
- </p>
- {% else %}
- <p>
- <i class="fa fa-calendar" aria-hidden="true"></i>
- <a href="{{ route('tags.show', [tag.id]) }}">
- {{ 'show_the_current_period_and_overview'|_ }}
- </a>
- </p>
- {% endif %}
-
{% include 'list/journals-tasker' %}
{% if periods %}
diff --git a/resources/views/transactions/index.twig b/resources/views/transactions/index.twig
index 342b82ac39..4a72c0cb2f 100644
--- a/resources/views/transactions/index.twig
+++ b/resources/views/transactions/index.twig
@@ -41,38 +41,40 @@
{% if periods.count > 0 %}
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% for period in periods %}
- <div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
- <div class="box-header with-border">
- <h3 class="box-title"><a href="{{ route('transactions.index',[what, period.string]) }}">{{ period.name }}</a>
- </h3>
- </div>
- <div class="box-body no-padding">
- <table class="table table-hover">
- <tr>
- <td style="width:33%;">{{ 'transactions'|_ }}</td>
- <td style="text-align: right;">{{ period.count }}</td>
- </tr>
- {% if what == 'withdrawal' %}
- <tr>
- <td style="width:33%;">{{ 'spent'|_ }}</td>
- <td style="text-align: right;">{{ period.spent|formatAmount }}</td>
- </tr>
- {% endif %}
- {% if what == 'deposit' %}
+ {% if period.count > 0 %}
+ <div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
+ <div class="box-header with-border">
+ <h3 class="box-title"><a href="{{ route('transactions.index',[what, period.string]) }}">{{ period.name }}</a>
+ </h3>
+ </div>
+ <div class="box-body no-padding">
+ <table class="table table-hover">
<tr>
- <td style="width:33%;">{{ 'earned'|_ }}</td>
- <td style="text-align: right;">{{ period.earned|formatAmount }}</td>
+ <td style="width:33%;">{{ 'transactions'|_ }}</td>
+ <td style="text-align: right;">{{ period.count }}</td>
</tr>
- {% endif %}
- {% if what == 'transfers' or what == 'transfer' %}
- <tr>
- <td style="width:33%;">{{ 'transferred'|_ }}</td>
- <td style="text-align: right;" class="text-info">{{ period.transferred|formatAmountPlain }}</td>
- </tr>
- {% endif %}
- </table>
+ {% if what == 'withdrawal' %}
+ <tr>
+ <td style="width:33%;">{{ 'spent'|_ }}</td>
+ <td style="text-align: right;">{{ period.spent|formatAmount }}</td>
+ </tr>
+ {% endif %}
+ {% if what == 'deposit' %}
+ <tr>
+ <td style="width:33%;">{{ 'earned'|_ }}</td>
+ <td style="text-align: right;">{{ period.earned|formatAmount }}</td>
+ </tr>
+ {% endif %}
+ {% if what == 'transfers' or what == 'transfer' %}
+ <tr>
+ <td style="width:33%;">{{ 'transferred'|_ }}</td>
+ <td style="text-align: right;" class="text-info">{{ period.transferred|formatAmountPlain }}</td>
+ </tr>
+ {% endif %}
+ </table>
+ </div>
</div>
- </div>
+ {% endif %}
{% endfor %}
</div>
{% endif %}