mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
Expand page for currency exchange rates.
This commit is contained in:
@@ -24,6 +24,9 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Http\Controllers\ExchangeRates;
|
namespace FireflyIII\Http\Controllers\ExchangeRates;
|
||||||
|
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
|
use Illuminate\View\Factory;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class IndexController extends Controller
|
class IndexController extends Controller
|
||||||
{
|
{
|
||||||
@@ -44,9 +47,14 @@ class IndexController extends Controller
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index(): View
|
||||||
{
|
{
|
||||||
return view('exchange-rates.index');
|
return view('exchange-rates.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function rates(TransactionCurrency $from, TransactionCurrency $to): View
|
||||||
|
{
|
||||||
|
return view('exchange-rates.rates', compact('from', 'to'));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
"/build/webhooks/edit.js": "/build/webhooks/edit.js",
|
"/build/webhooks/edit.js": "/build/webhooks/edit.js",
|
||||||
"/build/webhooks/show.js": "/build/webhooks/show.js",
|
"/build/webhooks/show.js": "/build/webhooks/show.js",
|
||||||
"/build/exchange-rates/index.js": "/build/exchange-rates/index.js",
|
"/build/exchange-rates/index.js": "/build/exchange-rates/index.js",
|
||||||
|
"/build/exchange-rates/rates.js": "/build/exchange-rates/rates.js",
|
||||||
"/public/v1/js/app.js": "/public/v1/js/app.js",
|
"/public/v1/js/app.js": "/public/v1/js/app.js",
|
||||||
"/public/v1/js/app.js.LICENSE.txt": "/public/v1/js/app.js.LICENSE.txt",
|
"/public/v1/js/app.js.LICENSE.txt": "/public/v1/js/app.js.LICENSE.txt",
|
||||||
"/public/v1/js/app_vue.js": "/public/v1/js/app_vue.js",
|
"/public/v1/js/app_vue.js": "/public/v1/js/app_vue.js",
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
"/public/v1/js/edit_transaction.js.LICENSE.txt": "/public/v1/js/edit_transaction.js.LICENSE.txt",
|
"/public/v1/js/edit_transaction.js.LICENSE.txt": "/public/v1/js/edit_transaction.js.LICENSE.txt",
|
||||||
"/public/v1/js/exchange-rates/index.js": "/public/v1/js/exchange-rates/index.js",
|
"/public/v1/js/exchange-rates/index.js": "/public/v1/js/exchange-rates/index.js",
|
||||||
"/public/v1/js/exchange-rates/index.js.LICENSE.txt": "/public/v1/js/exchange-rates/index.js.LICENSE.txt",
|
"/public/v1/js/exchange-rates/index.js.LICENSE.txt": "/public/v1/js/exchange-rates/index.js.LICENSE.txt",
|
||||||
|
"/public/v1/js/exchange-rates/rates.js": "/public/v1/js/exchange-rates/rates.js",
|
||||||
"/public/v1/js/ff/accounts/create.js": "/public/v1/js/ff/accounts/create.js",
|
"/public/v1/js/ff/accounts/create.js": "/public/v1/js/ff/accounts/create.js",
|
||||||
"/public/v1/js/ff/accounts/edit-reconciliation.js": "/public/v1/js/ff/accounts/edit-reconciliation.js",
|
"/public/v1/js/ff/accounts/edit-reconciliation.js": "/public/v1/js/ff/accounts/edit-reconciliation.js",
|
||||||
"/public/v1/js/ff/accounts/edit.js": "/public/v1/js/ff/accounts/edit.js",
|
"/public/v1/js/ff/accounts/edit.js": "/public/v1/js/ff/accounts/edit.js",
|
||||||
|
33
resources/assets/v1/src/components/exchange-rates/Rates.vue
Normal file
33
resources/assets/v1/src/components/exchange-rates/Rates.vue
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<!--
|
||||||
|
- Rates.vue
|
||||||
|
- Copyright (c) 2024 james@firefly-iii.org.
|
||||||
|
-
|
||||||
|
- This file is part of Firefly III (https://github.com/firefly-iii).
|
||||||
|
-
|
||||||
|
- This program is free software: you can redistribute it and/or modify
|
||||||
|
- it under the terms of the GNU Affero General Public License as
|
||||||
|
- published by the Free Software Foundation, either version 3 of the
|
||||||
|
- License, or (at your option) any later version.
|
||||||
|
-
|
||||||
|
- This program is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
- GNU Affero General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU Affero General Public License
|
||||||
|
- along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
39
resources/assets/v1/src/exchange-rates/rates.js
Normal file
39
resources/assets/v1/src/exchange-rates/rates.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* edit_transactions.js
|
||||||
|
* Copyright (c) 2019 james@firefly-iii.org
|
||||||
|
*
|
||||||
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Index from "../components/exchange-rates/Index";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* First we will load Axios via bootstrap.js
|
||||||
|
* jquery and bootstrap-sass preloaded in app.js
|
||||||
|
* vue, uiv and vuei18n are in app_vue.js
|
||||||
|
*/
|
||||||
|
|
||||||
|
require('../bootstrap');
|
||||||
|
const i18n = require('../i18n');
|
||||||
|
|
||||||
|
let props = {};
|
||||||
|
const app = new Vue({
|
||||||
|
i18n,
|
||||||
|
el: "#exchange_rates_rates",
|
||||||
|
render: (createElement) => {
|
||||||
|
return createElement(Index, {props: props})
|
||||||
|
},
|
||||||
|
});
|
@@ -49,3 +49,4 @@ mix.js('src/webhooks/show.js', 'build/webhooks').vue({version: 2}).copy('build',
|
|||||||
|
|
||||||
// exchange rates
|
// exchange rates
|
||||||
mix.js('src/exchange-rates/index.js', 'build/exchange-rates').vue({version: 2});
|
mix.js('src/exchange-rates/index.js', 'build/exchange-rates').vue({version: 2});
|
||||||
|
mix.js('src/exchange-rates/rates.js', 'build/exchange-rates').vue({version: 2});
|
||||||
|
@@ -92,4 +92,6 @@ return [
|
|||||||
|
|
||||||
// exchange rates
|
// exchange rates
|
||||||
'exchange_rates_index' => 'Exchange rates',
|
'exchange_rates_index' => 'Exchange rates',
|
||||||
|
'exchange_rates_rates' => 'Exchange rates between :from and :to (and the other way around)',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@@ -1398,7 +1398,7 @@ return [
|
|||||||
'menu_exchange_rates_index' => 'Exchange rates',
|
'menu_exchange_rates_index' => 'Exchange rates',
|
||||||
'header_exchange_rates' => 'Exchange rates',
|
'header_exchange_rates' => 'Exchange rates',
|
||||||
'exchange_rates_intro' =>'Firefly III supports downloading and using exchange rates. Read more about this in <a href="https://docs.firefly-iii.org/LOL_NOT_FINISHED_YET_TODO">the documentation</a>.',
|
'exchange_rates_intro' =>'Firefly III supports downloading and using exchange rates. Read more about this in <a href="https://docs.firefly-iii.org/LOL_NOT_FINISHED_YET_TODO">the documentation</a>.',
|
||||||
'exchange_rates_from_to' => 'Between {from} and {to}',
|
'exchange_rates_from_to' => 'Between {from} and {to} (and the other way around)',
|
||||||
|
|
||||||
// Financial administrations
|
// Financial administrations
|
||||||
'administration_index' => 'Financial administration',
|
'administration_index' => 'Financial administration',
|
||||||
|
12
resources/views/exchange-rates/rates.twig
Normal file
12
resources/views/exchange-rates/rates.twig
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{% set VUE_SCRIPT_NAME = 'exchange-rates/rates' %}
|
||||||
|
{% extends './layout/default' %}
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, from, to) }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div id="exchange_rates_rate"></div>
|
||||||
|
{% endblock %}
|
||||||
|
{% block scripts %}
|
||||||
|
|
||||||
|
{% endblock %}
|
@@ -1,7 +1,7 @@
|
|||||||
{% set VUE_SCRIPT_NAME = 'webhooks/index' %}
|
{% set VUE_SCRIPT_NAME = 'webhooks/index' %}
|
||||||
{% extends './layout/default' %}
|
{% extends './layout/default' %}
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, objectType) }}
|
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@@ -762,6 +762,13 @@ Breadcrumbs::for(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Breadcrumbs::for(
|
||||||
|
'exchange-rates.rates',
|
||||||
|
static function (Generator $breadcrumbs, TransactionCurrency $from, TransactionCurrency $to): void {
|
||||||
|
$breadcrumbs->parent('exchange-rates.index');
|
||||||
|
$breadcrumbs->push(trans('breadcrumbs.exchange_rates_rates', ['from' => $from->name, 'to' => $to->name]), route('exchange-rates.rates', [$from->code, $to->code]));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// PROFILE
|
// PROFILE
|
||||||
|
@@ -365,6 +365,7 @@ Route::group(
|
|||||||
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\ExchangeRates', 'prefix' => 'exchange-rates', 'as' => 'exchange-rates.'],
|
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\ExchangeRates', 'prefix' => 'exchange-rates', 'as' => 'exchange-rates.'],
|
||||||
static function (): void {
|
static function (): void {
|
||||||
Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);
|
Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);
|
||||||
|
Route::get('{fromCurrencyCode}/{toCurrencyCode}', ['uses' => 'IndexController@rates', 'as' => 'rates']);
|
||||||
// Route::get('create', ['uses' => 'CreateController@create', 'as' => 'create']);
|
// Route::get('create', ['uses' => 'CreateController@create', 'as' => 'create']);
|
||||||
// Route::get('edit/{currency}', ['uses' => 'EditController@edit', 'as' => 'edit']);
|
// Route::get('edit/{currency}', ['uses' => 'EditController@edit', 'as' => 'edit']);
|
||||||
// Route::get('delete/{currency}', ['uses' => 'DeleteController@delete', 'as' => 'delete']);
|
// Route::get('delete/{currency}', ['uses' => 'DeleteController@delete', 'as' => 'delete']);
|
||||||
|
Reference in New Issue
Block a user