From 54b76a03ce8ddc22043d5b50209032dc740f1d93 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 11 Aug 2018 19:22:28 +0200 Subject: [PATCH] Update views and translations. --- resources/lang/en_US/firefly.php | 1 + resources/views/accounts/show.twig | 6 +- resources/views/bills/show.twig | 2 +- resources/views/budgets/no-budget.twig | 4 +- resources/views/budgets/show.twig | 6 +- resources/views/categories/no-category.twig | 4 +- resources/views/categories/show.twig | 3 +- resources/views/list/journals.twig | 2 +- resources/views/list/transactions.twig | 79 +++++++++++++++++++ resources/views/partials/journal-row.twig | 70 ++++++++++++++++ resources/views/partials/transaction-row.twig | 30 +++---- resources/views/recurring/show.twig | 2 +- resources/views/transactions/index.twig | 7 +- 13 files changed, 193 insertions(+), 23 deletions(-) create mode 100644 resources/views/list/transactions.twig create mode 100644 resources/views/partials/journal-row.twig diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 29daa784c0..847f9162ca 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -37,6 +37,7 @@ return [ 'cancel' => 'Cancel', 'from' => 'From', 'to' => 'To', + 'help_translating' => 'This help text is not yet available in your language. Will you help translate?', 'showEverything' => 'Show everything', 'never' => 'Never', 'no_results_for_empty_search' => 'Your search was empty, so nothing was found.', diff --git a/resources/views/accounts/show.twig b/resources/views/accounts/show.twig index b702c942e1..8e13be1ad7 100644 --- a/resources/views/accounts/show.twig +++ b/resources/views/accounts/show.twig @@ -96,7 +96,11 @@ {% else %} {% set showReconcile = false %} {% endif %} - {% include 'list.journals' with {sorting:true, hideBills:true, hideBudgets: true, hideCategories: true, showReconcile: showReconcile} %} + {% if periods.count > 0 %} + {% include 'list.transactions' with {sorting:true, showReconcile: showReconcile} %} + {% else %} + {% include 'list.transactions' with {sorting:true, showReconcile: showReconcile, showCategories: true, showBudgets: true, showBill:true} %} + {% endif %}

{% if periods.count > 0 %} diff --git a/resources/views/bills/show.twig b/resources/views/bills/show.twig index f22355adb5..571fe05780 100644 --- a/resources/views/bills/show.twig +++ b/resources/views/bills/show.twig @@ -164,7 +164,7 @@

{{ 'connected_journals'|_ }}

- {% include 'list.journals' %} + {% include 'list.transactions' with {showCategories: true, showBudgets: true} %}
diff --git a/resources/views/budgets/no-budget.twig b/resources/views/budgets/no-budget.twig index 36680089d5..632f6f1368 100644 --- a/resources/views/budgets/no-budget.twig +++ b/resources/views/budgets/no-budget.twig @@ -22,13 +22,15 @@

{{ subTitle }}

- {% include 'list.journals' with {'journals': journals,'hideBudgets': true} %} + {% if periods.count > 0 %} + {% include 'list.transactions' %}

{{ 'show_all_no_filter'|_ }}

{% else %} + {% include 'list.transactions' with {showCategories:true, showBill:true} %}

{{ 'show_the_current_period_and_overview'|_ }} diff --git a/resources/views/budgets/show.twig b/resources/views/budgets/show.twig index 8fdc7a414e..e40e0ed0cc 100644 --- a/resources/views/budgets/show.twig +++ b/resources/views/budgets/show.twig @@ -89,7 +89,11 @@

{{ 'transactions'|_ }}

- {% include 'list.journals' with {hideBudgets:true, hideBills:true} %} + {% if budgetLimit %} + {% include 'list.transactions' %} + {% else %} + {% include 'list.transactions' with {showCategories: true} %} + {% endif %} {% if budgetLimit %}

diff --git a/resources/views/categories/no-category.twig b/resources/views/categories/no-category.twig index ed6778c54a..ca2dc081a8 100644 --- a/resources/views/categories/no-category.twig +++ b/resources/views/categories/no-category.twig @@ -22,13 +22,15 @@

{{ subTitle }}

- {% include 'list.journals' with {'journals': journals, 'hideCategories':true} %} + {% if periods.count > 0 %} + {% include 'list.transactions' %}

{{ 'show_all_no_filter'|_ }}

{% else %} + {% include 'list.transactions' with {showBudgets:true, showBill:true} %}

{{ 'show_the_current_period_and_overview'|_ }} diff --git a/resources/views/categories/show.twig b/resources/views/categories/show.twig index dc79577173..09d6992601 100644 --- a/resources/views/categories/show.twig +++ b/resources/views/categories/show.twig @@ -65,8 +65,8 @@

{{ 'transactions'|_ }}

- {% include 'list.journals' with {hideCategories: true, hideBills: true} %} {% if periods.count > 0 %} + {% include 'list.transactions' %}

@@ -74,6 +74,7 @@

{% else %} + {% include 'list.transactions' with {showBudgets:true, showBill:true} %}

diff --git a/resources/views/list/journals.twig b/resources/views/list/journals.twig index 2aa70cc42e..fa2440e856 100644 --- a/resources/views/list/journals.twig +++ b/resources/views/list/journals.twig @@ -28,7 +28,7 @@ {% for transaction in transactions %} - {% include 'partials.transaction-row' %} + {% include 'partials.journal-row' %} {% endfor %} diff --git a/resources/views/list/transactions.twig b/resources/views/list/transactions.twig new file mode 100644 index 0000000000..f83f1cefb7 --- /dev/null +++ b/resources/views/list/transactions.twig @@ -0,0 +1,79 @@ +{# render pagination #} +{{ transactions.render|raw }} + + + + + + + + + + + + + {# Only show budgets when asked in some way #} + {% if showBudgets %} + + {% endif %} + + {# Only show categories when asked in some way #} + {% if showCategories %} + + {% endif %} + + {# Only show bill when asked in some way #} + {% if showBill %} + + {% endif %} + + + + {% for transaction in transactions %} + {% include 'partials.transaction-row' %} + {% endfor %} + +
{{ trans('list.description') }}{{ trans('list.amount') }}
+

+
+
+ {{ transactions.render|raw }} +
+
+ diff --git a/resources/views/partials/journal-row.twig b/resources/views/partials/journal-row.twig new file mode 100644 index 0000000000..9f392268ee --- /dev/null +++ b/resources/views/partials/journal-row.twig @@ -0,0 +1,70 @@ + + {# input buttons #} + + +
{% if sorting %}{% endif %}
+ + + {# icon #} + + {{ transaction|transactionIcon }} + + + {# description #} + + {# is reconciled? #} + {{ transaction|transactionReconciled }} + + + {{ transaction|transactionDescription }} + + {# is a split journal #} + {{ transaction|transactionIsSplit }} + + {# count attachments #} + {{ transaction|transactionHasAtt }} + + + + + {{ transaction|transactionAmount }} + + {{ transaction.date.formatLocalized(monthAndDayFormat) }} + + + + {{ transaction|transactionSourceAccount }} + + + + {{ transaction|transactionDestinationAccount }} + + + {% if not hideBudgets %} + + {{ transaction|transactionBudgets }} + + {% endif %} + + {% if not hideCategories %} + + {{ transaction|transactionCategories }} + + {% endif %} + {% if not hideBills %} + + {% if transaction.bill_id %} + {{ transaction.bill_name }} + {% endif %} + + {% endif %} + diff --git a/resources/views/partials/transaction-row.twig b/resources/views/partials/transaction-row.twig index 9f392268ee..dd31b6c44c 100644 --- a/resources/views/partials/transaction-row.twig +++ b/resources/views/partials/transaction-row.twig @@ -1,17 +1,11 @@ - + + {# input buttons #} -
{% if sorting %}{% endif %}
+
{% if sorting %}{% endif %}
{# icon #} @@ -36,31 +30,39 @@ + {# amount #} {{ transaction|transactionAmount }} + + {# date #} {{ transaction.date.formatLocalized(monthAndDayFormat) }} + {# source #} {{ transaction|transactionSourceAccount }} - + {# dest #} {{ transaction|transactionDestinationAccount }} - {% if not hideBudgets %} + {# budget, if opted to show. #} + {% if showBudgets %} {{ transaction|transactionBudgets }} {% endif %} - {% if not hideCategories %} + {# category, if opted to show. #} + {% if showCategories %} {{ transaction|transactionCategories }} {% endif %} - {% if not hideBills %} + + {# bill, if opted to show#} + {% if showBill %} {% if transaction.bill_id %} {{ transaction.bill_name }} diff --git a/resources/views/recurring/show.twig b/resources/views/recurring/show.twig index b4cbf3875e..3d2438ba06 100644 --- a/resources/views/recurring/show.twig +++ b/resources/views/recurring/show.twig @@ -198,7 +198,7 @@
- {% include 'list.journals' with {sorting:false, hideBills:true, hideBudgets: true, showReconcile: false} %} + {% include 'list.transactions' with {showBudgets:true, showCategories:true} %}
diff --git a/resources/views/transactions/index.twig b/resources/views/transactions/index.twig index daeeed551f..5a55f2d527 100644 --- a/resources/views/transactions/index.twig +++ b/resources/views/transactions/index.twig @@ -31,7 +31,12 @@ {% endif %} {# actual list #} - {% include 'list.journals' with {'journals': journals} %} + {% if periods.count > 0 %} + {# page is not "all"-overview#} + {% include 'list.transactions' %} + {% else %} + {% include 'list.transactions' with {showCategories: true, showBudgets: true, showBill:true} %} + {% endif %}