mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 12:45:30 +00:00
Fix #5104
This commit is contained in:
@@ -116,6 +116,12 @@ class ShowController extends Controller
|
|||||||
$firstTransaction = $this->repository->oldestJournalDate($account) ?? $start;
|
$firstTransaction = $this->repository->oldestJournalDate($account) ?? $start;
|
||||||
$periods = $this->getAccountPeriodOverview($account, $firstTransaction, $end);
|
$periods = $this->getAccountPeriodOverview($account, $firstTransaction, $end);
|
||||||
|
|
||||||
|
// if layout = v2, overrule the page title.
|
||||||
|
if('v1'!==config('firefly.layout')) {
|
||||||
|
$subTitle = (string)trans('firefly.all_journals_for_account', ['name' => $account->name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @var GroupCollectorInterface $collector */
|
/** @var GroupCollectorInterface $collector */
|
||||||
$collector = app(GroupCollectorInterface::class);
|
$collector = app(GroupCollectorInterface::class);
|
||||||
$collector
|
$collector
|
||||||
|
@@ -106,6 +106,7 @@ export default {
|
|||||||
perPage: 51,
|
perPage: 51,
|
||||||
locale: 'en-US',
|
locale: 'en-US',
|
||||||
api: null,
|
api: null,
|
||||||
|
nameLoading:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -117,11 +118,30 @@ export default {
|
|||||||
let params = new URLSearchParams(window.location.search);
|
let params = new URLSearchParams(window.location.search);
|
||||||
this.currentPage = params.get('page') ? parseInt(params.get('page')) : 1;
|
this.currentPage = params.get('page') ? parseInt(params.get('page')) : 1;
|
||||||
this.getTransactions();
|
this.getTransactions();
|
||||||
|
this.updatePageTitle();
|
||||||
},
|
},
|
||||||
components: {TransactionListLarge},
|
components: {TransactionListLarge},
|
||||||
methods: {
|
methods: {
|
||||||
|
updatePageTitle: function () {
|
||||||
|
if (this.showReady && !this.nameLoading) {
|
||||||
|
// update page title.
|
||||||
|
this.nameLoading = true;
|
||||||
|
configureAxios().then(async (api) => {
|
||||||
|
let url = './api/v1/accounts/' + this.accountId;
|
||||||
|
api.get(url)
|
||||||
|
.then(response => {
|
||||||
|
let start = new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(this.start);
|
||||||
|
let end = new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(this.end);
|
||||||
|
document.getElementById('page-subTitle').innerText = this.$t('firefly.journals_in_period_for_account_js', {start: start, end: end, title: response.data.data.attributes.name});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
getTransactions: function () {
|
getTransactions: function () {
|
||||||
if (this.showReady && !this.loading) {
|
if (this.showReady && !this.loading) {
|
||||||
|
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
configureAxios().then(async (api) => {
|
configureAxios().then(async (api) => {
|
||||||
// console.log('Now getTransactions() x Start');
|
// console.log('Now getTransactions() x Start');
|
||||||
@@ -153,9 +173,11 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
start: function () {
|
start: function () {
|
||||||
this.getTransactions();
|
this.getTransactions();
|
||||||
|
this.updatePageTitle();
|
||||||
},
|
},
|
||||||
end: function () {
|
end: function () {
|
||||||
this.getTransactions();
|
this.getTransactions();
|
||||||
|
this.updatePageTitle();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -70,6 +70,7 @@
|
|||||||
"daily_budgets": "Daily budgets",
|
"daily_budgets": "Daily budgets",
|
||||||
"weekly_budgets": "Weekly budgets",
|
"weekly_budgets": "Weekly budgets",
|
||||||
"monthly_budgets": "Monthly budgets",
|
"monthly_budgets": "Monthly budgets",
|
||||||
|
"journals_in_period_for_account_js": "All transactions for account {title} between {start} and {end}",
|
||||||
"quarterly_budgets": "Quarterly budgets",
|
"quarterly_budgets": "Quarterly budgets",
|
||||||
"create_new_expense": "Create new expense account",
|
"create_new_expense": "Create new expense account",
|
||||||
"create_new_revenue": "Create new revenue account",
|
"create_new_revenue": "Create new revenue account",
|
||||||
|
@@ -51,7 +51,7 @@
|
|||||||
{{ title }} <small class="text-muted">
|
{{ title }} <small class="text-muted">
|
||||||
{% if subTitleIcon|default(false) %}<span
|
{% if subTitleIcon|default(false) %}<span
|
||||||
class="fa fas {{ subTitleIcon }}"></span>{% endif %}
|
class="fa fas {{ subTitleIcon }}"></span>{% endif %}
|
||||||
{{ subTitle|default('') }}</small></h1>
|
<span id="page-subTitle">{{ subTitle|default('') }}</span></small></h1>
|
||||||
</div><!-- /.col -->
|
</div><!-- /.col -->
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
{% block breadcrumbs %}{% endblock %}
|
{% block breadcrumbs %}{% endblock %}
|
||||||
|
Reference in New Issue
Block a user