Skip to content

Firefly III: a personal finances manager

Update files

Sander Dorigo1669821b8fc4
diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php
index 7b5378544c..bd1e9fce6e 100644
--- a/app/Http/Controllers/AttachmentController.php
+++ b/app/Http/Controllers/AttachmentController.php
@@ -50,7 +50,7 @@ final class AttachmentController extends Controller
// translations:
$this->middleware(function ($request, $next) {
- app('view')->share('mainTitleIcon', 'fa-paperclip');
+ app('view')->share('mainTitleIcon', 'bi-paperclip');
app('view')->share('title', (string) trans('firefly.attachments'));
$this->repository = app(AttachmentRepositoryInterface::class);
@@ -129,7 +129,7 @@ final class AttachmentController extends Controller
*/
public function edit(Request $request, Attachment $attachment): Factory|\Illuminate\Contracts\View\View
{
- $subTitleIcon = 'fa-pencil';
+ $subTitleIcon = 'bi-pencil';
$subTitle = (string) trans('firefly.edit_attachment', ['name' => $attachment->filename]);
// put previous url in session if not redirect from store (not "return_to_edit").
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 5673b9ee19..34f5934236 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -89,10 +89,9 @@ abstract class Controller extends BaseController
|> strtolower(...);
// is webhooks enabled?
- View::share(
- 'featuringWebhooks',
- true === config('firefly.feature_flags.webhooks') && true === AppConfiguration::get('allow_webhooks', config('firefly.allow_webhooks'))->data
- );
+ View::share('featuringWebhooks', true === config('firefly.feature_flags.webhooks') && true === AppConfiguration::get('allow_webhooks', config('firefly.allow_webhooks'))->data);
+ // is currency exchange enabled?
+ View::share('featuringCer', true === AppConfiguration::get('enable_exchange_rates', config('cer.enabled'))->data);
// share custom auth guard info.
$authGuard = config('firefly.authentication_guard');
diff --git a/app/Http/Controllers/ObjectGroup/EditController.php b/app/Http/Controllers/ObjectGroup/EditController.php
index 05976e40c7..a0d59fe975 100644
--- a/app/Http/Controllers/ObjectGroup/EditController.php
+++ b/app/Http/Controllers/ObjectGroup/EditController.php
@@ -63,7 +63,7 @@ final class EditController extends Controller
public function edit(ObjectGroup $objectGroup): Factory|View
{
$subTitle = (string) trans('firefly.edit_object_group', ['title' => $objectGroup->title]);
- $subTitleIcon = 'fa-pencil';
+ $subTitleIcon = 'bi-pencil';
if (true !== session('object-groups.edit.fromUpdate')) {
$this->rememberPreviousUrl('object-groups.edit.url');
diff --git a/app/Http/Controllers/PiggyBank/EditController.php b/app/Http/Controllers/PiggyBank/EditController.php
index 56780433f5..015196b411 100644
--- a/app/Http/Controllers/PiggyBank/EditController.php
+++ b/app/Http/Controllers/PiggyBank/EditController.php
@@ -70,7 +70,7 @@ final class EditController extends Controller
public function edit(PiggyBank $piggyBank): Factory|\Illuminate\Contracts\View\View
{
$subTitle = (string) trans('firefly.update_piggy_title', ['name' => $piggyBank->name]);
- $subTitleIcon = 'fa-pencil';
+ $subTitleIcon = 'bi-pencil';
$note = $piggyBank->notes()->first();
// Flash some data to fill the form.
$targetDate = $piggyBank->target_date?->format('Y-m-d');
diff --git a/app/Http/Controllers/TransactionCurrency/EditController.php b/app/Http/Controllers/TransactionCurrency/EditController.php
index 94db8c4b2c..31ca05ba85 100644
--- a/app/Http/Controllers/TransactionCurrency/EditController.php
+++ b/app/Http/Controllers/TransactionCurrency/EditController.php
@@ -77,7 +77,7 @@ final class EditController extends Controller
return redirect(route('currencies.index'));
}
- $subTitleIcon = 'fa-pencil';
+ $subTitleIcon = 'bi-pencil';
$subTitle = (string) trans('breadcrumbs.edit_currency', ['name' => $currency->name]);
$currency->symbol = htmlentities($currency->symbol);
diff --git a/app/Http/Controllers/Webhooks/EditController.php b/app/Http/Controllers/Webhooks/EditController.php
index 3153242742..ed5e13589d 100644
--- a/app/Http/Controllers/Webhooks/EditController.php
+++ b/app/Http/Controllers/Webhooks/EditController.php
@@ -47,7 +47,7 @@ final class EditController extends Controller
// translations:
$this->middleware(static function ($request, $next) {
app('view')->share('mainTitleIcon', 'fa-bolt');
- app('view')->share('subTitleIcon', 'fa-pencil');
+ app('view')->share('subTitleIcon', 'bi-pencil');
app('view')->share('title', (string) trans('firefly.webhooks'));
return $next($request);
diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php
index bf5cc26f95..b228519060 100644
--- a/app/Support/ExpandedForm.php
+++ b/app/Support/ExpandedForm.php
@@ -94,6 +94,7 @@ class ExpandedForm
$options = $this->expandOptionArray($name, $label, $options);
$classes = $this->getHolderClasses($name);
$value = $this->fillFieldValue($name, $value);
+ $inputClasses = $this->getErrorClassesForCheckbox($name);
unset($options['placeholder'], $options['autocomplete'], $options['class']);
@@ -104,8 +105,10 @@ class ExpandedForm
'label' => $label,
'value' => $value,
'options' => $options,
+ 'inputClasses' => $inputClasses,
])->render();
} catch (Throwable $e) {
+
Log::debug(sprintf('Could not render checkbox(): %s', $e->getMessage()));
$html = 'Could not render checkbox.';
diff --git a/app/Support/Form/FormSupport.php b/app/Support/Form/FormSupport.php
index 1dbd4e6074..916a72f746 100644
--- a/app/Support/Form/FormSupport.php
+++ b/app/Support/Form/FormSupport.php
@@ -146,10 +146,23 @@ trait FormSupport
$errors = session('errors');
if (null !== $errors && $errors->has($name)) {
- return 'form-group has-error has-feedback';
+ return 'has-error has-feedback';
}
- return 'form-group';
+ return 'has-error has-feedback';
+ }
+
+ protected function getErrorClassesForCheckbox(string $name): string
+ {
+ // Get errors from session:
+ /** @var null|MessageBag $errors */
+ $errors = session('errors');
+
+ if (null !== $errors && $errors->has($name)) {
+ return 'form-check-input is-invalid';
+ }
+
+ return 'form-check-input';
}
protected function label(string $name, ?array $options = null): string
diff --git a/config/translations.php b/config/translations.php
index 4b579d6729..1e3e886137 100644
--- a/config/translations.php
+++ b/config/translations.php
@@ -60,6 +60,7 @@ return [
'liability_direction_null_short',
'interest_calc_yearly',
'loading',
+ 'exchange_rates_from_to',
'errors_upload',
'updated_journal_js',
'upload_too_large',