Skip to content

Firefly III: a personal finances manager

more updated views and help functions.

James Coled7dd34a5cf46
diff --git a/app/Helpers/Functions/helpers.php b/app/Helpers/Functions/helpers.php
index 072660f1a1..efb1c47825 100644
--- a/app/Helpers/Functions/helpers.php
+++ b/app/Helpers/Functions/helpers.php
@@ -24,9 +24,13 @@ declare(strict_types=1);
use Carbon\Carbon;
use Carbon\CarbonInterface;
+use FireflyIII\Enums\AccountTypeEnum;
+use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account;
+use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionCurrency;
+use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionJournalMeta;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Facades\Amount;
@@ -60,6 +64,155 @@ if (!function_exists('env_default_when_empty')) {
}
}
+if (!function_exists('sign_amount')) {
+
+ function sign_amount(string $amount, string $transactionType, string $sourceType): string
+ {
+ // withdrawals stay negative
+ if (TransactionTypeEnum::WITHDRAWAL->value !== $transactionType) {
+ $amount = bcmul($amount, '-1');
+ }
+
+ // opening balance and it comes from initial balance? its expense.
+ if (TransactionTypeEnum::OPENING_BALANCE->value === $transactionType && AccountTypeEnum::INITIAL_BALANCE->value !== $sourceType) {
+ $amount = bcmul($amount, '-1');
+ }
+
+ // reconciliation and it comes from reconciliation?
+ if (TransactionTypeEnum::RECONCILIATION->value === $transactionType && AccountTypeEnum::RECONCILIATION->value !== $sourceType) {
+ return bcmul($amount, '-1');
+ }
+
+ return $amount;
+ }
+}
+if (!function_exists('normal_journal_object_amount')) {
+ function normal_journal_object_amount(TransactionJournal $journal): string
+ {
+ $type = $journal->transactionType->type;
+
+ /** @var Transaction $first */
+ $first = $journal->transactions()->where('amount', '<', 0)->first();
+ $currency = $journal->transactionCurrency;
+ $amount = $first->amount ?? '0';
+ $colored = true;
+ $sourceType = $first->account->accountType()->first()->type;
+
+ $amount = sign_amount($amount, $type, $sourceType);
+
+ if (TransactionTypeEnum::TRANSFER->value === $type) {
+ $colored = false;
+ }
+ $result = Amount::formatFlat($currency->symbol, $currency->decimal_places, $amount, $colored);
+ if (TransactionTypeEnum::TRANSFER->value === $type) {
+ return sprintf('<span class="text-info money-transfer">%s</span>', $result);
+ }
+
+ return $result;
+ }
+}
+
+if (!function_exists('journal_object_has_foreign')) {
+ function journal_object_has_foreign(TransactionJournal $journal): bool
+ {
+ /** @var Transaction $first */
+ $first = $journal->transactions()->where('amount', '<', 0)->first();
+
+ return '' !== $first->foreign_amount;
+ }
+}
+
+if (function_exists('foreign_journal_object_amount')) {
+
+ function foreign_journal_object_amount(TransactionJournal $journal): string
+ {
+ $type = $journal->transactionType->type;
+
+ /** @var Transaction $first */
+ $first = $journal->transactions()->where('amount', '<', 0)->first();
+ $currency = $first->foreignCurrency;
+ $amount = '' === $first->foreign_amount ? '0' : $first->foreign_amount;
+ $colored = true;
+ $sourceType = $first->account->accountType()->first()->type;
+
+ $amount = sign_amount($amount, $type, $sourceType);
+
+ if (TransactionTypeEnum::TRANSFER->value === $type) {
+ $colored = false;
+ }
+ $result = Amount::formatFlat($currency->symbol, $currency->decimal_places, $amount, $colored);
+ if (TransactionTypeEnum::TRANSFER->value === $type) {
+ return sprintf('<span class="text-info money-transfer">%s</span>', $result);
+ }
+
+ return $result;
+ }
+}
+
+if (!function_exists('journal_object_amount')) {
+ function journal_object_amount(TransactionJournal $journal): string
+ {
+ $result = normal_journal_object_amount($journal);
+
+ // now append foreign amount, if any.
+ if (journal_object_has_foreign($journal)) {
+ $foreign = foreign_journal_object_amount($journal);
+ $result = sprintf('%s (%s)', $result, $foreign);
+ }
+
+ return $result;
+ }
+}
+
+if (!function_exists('journal_link_translation')) {
+ function journal_link_translation(string $direction, string $original): string
+ {
+ $key = sprintf('firefly.%s_%s', $original, $direction);
+ $translation = (string)trans($key);
+ if ($key === $translation) {
+ return $original;
+ }
+ return $translation;
+ }
+}
+
+if (!function_exists('all_journal_triggers')) {
+ function all_journal_triggers(): array
+ {
+ return [
+ 'store-journal' => (string)trans('firefly.rule_trigger_store_journal'),
+ 'update-journal' => (string)trans('firefly.rule_trigger_update_journal'),
+ 'manual-activation' => (string)trans('firefly.rule_trigger_manual'),
+ ];
+ }
+}
+
+if (!function_exists('all_rule_actions')) {
+ function all_rule_actions(): array
+ {
+ // array of valid values for actions
+ $ruleActions = array_keys(config('firefly.rule-actions'));
+ $possibleActions = [];
+ foreach ($ruleActions as $key) {
+ $possibleActions[$key] = (string)trans('firefly.rule_action_' . $key . '_choice');
+ }
+ unset($ruleActions);
+ asort($possibleActions);
+ return $possibleActions;
+ }
+}
+
+if (!function_exists('all_journal_triggers')) {
+ function all_journal_triggers(): array
+ {
+ return [
+ 'store-journal' => (string)trans('firefly.rule_trigger_store_journal'),
+ 'update-journal' => (string)trans('firefly.rule_trigger_update_journal'),
+ 'manual-activation' => (string)trans('firefly.rule_trigger_manual'),
+ ];
+ }
+}
+
if (!function_exists('mime_icon')) {
function mime_icon(string $file): string
{
diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php
index 75b95fc278..e4a6f91ef1 100644
--- a/app/Http/Controllers/Json/FrontpageController.php
+++ b/app/Http/Controllers/Json/FrontpageController.php
@@ -92,7 +92,7 @@ final class FrontpageController extends Controller
} catch (Throwable $e) {
Log::error(sprintf('Cannot render json.piggy-banks: %s', $e->getMessage()));
Log::error($e->getTraceAsString());
- $html = 'Could not render view.';
+ $html = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($html, 0, $e);
}
diff --git a/app/Http/Controllers/Json/RuleController.php b/app/Http/Controllers/Json/RuleController.php
index 71f9a5a0de..ac4c160633 100644
--- a/app/Http/Controllers/Json/RuleController.php
+++ b/app/Http/Controllers/Json/RuleController.php
@@ -43,7 +43,7 @@ final class RuleController extends Controller
*/
public function action(Request $request): JsonResponse
{
- $count = (int) $request->get('count') > 0 ? (int) $request->get('count') : 1;
+ $count = (int) $request->input('count') > 0 ? (int) $request->input('count') : 1;
$keys = array_keys(config('firefly.rule-actions'));
$actions = [];
foreach ($keys as $key) {
@@ -51,11 +51,11 @@ final class RuleController extends Controller
}
try {
- $view = view('rules.partials.action', ['actions' => $actions, 'count' => $count])->render();
+ $view = view('rules.partials.action', ['actions' => $actions, 'count' => $count,'oldAction' => null, 'oldValue' => null,'oldChecked' => null])->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage()));
Log::error($e->getTraceAsString());
- $view = 'Could not render view.';
+ $view = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($view, 0, $e);
}
@@ -70,7 +70,7 @@ final class RuleController extends Controller
*/
public function trigger(Request $request): JsonResponse
{
- $count = (int) $request->get('count') > 0 ? (int) $request->get('count') : 1;
+ $count = (int) $request->input('count') > 0 ? (int) $request->input('count') : 1;
$operators = config('search.operators');
$triggers = [];
foreach ($operators as $key => $operator) {
@@ -81,11 +81,11 @@ final class RuleController extends Controller
asort($triggers);
try {
- $view = view('rules.partials.trigger', ['triggers' => $triggers, 'count' => $count])->render();
+ $view = view('rules.partials.trigger', ['triggers' => $triggers, 'count' => $count,'oldTrigger' => null, 'oldProhibited' => null,'oldValue' => null,'oldChecked' =>null])->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render rules.partials.trigger: %s', $e->getMessage()));
Log::error($e->getTraceAsString());
- $view = 'Could not render view.';
+ $view = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($view, 0, $e);
}
diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php
index 7d658abb3e..e1fc7a6ad5 100644
--- a/app/Http/Controllers/SearchController.php
+++ b/app/Http/Controllers/SearchController.php
@@ -61,13 +61,13 @@ final class SearchController extends Controller
public function index(Request $request, SearchInterface $searcher): Factory|\Illuminate\Contracts\View\View
{
// search params:
- $fullQuery = $request->get('search');
- if (is_array($request->get('search'))) {
+ $fullQuery = $request->input('search');
+ if (is_array($request->input('search'))) {
$fullQuery = '';
}
$fullQuery = (string) $fullQuery;
- $page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
- $ruleId = (int) $request->get('rule');
+ $page = 0 === (int) $request->input('page') ? 1 : (int) $request->get('page');
+ $ruleId = (int) $request->input('rule');
$ruleChanged = false;
// find rule, check if query is different, offer to update.
@@ -132,7 +132,7 @@ final class SearchController extends Controller
} catch (Throwable $e) {
Log::error(sprintf('Cannot render search.search: %s', $e->getMessage()));
Log::error($e->getTraceAsString());
- $html = 'Could not render view.';
+ $html = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($html, 0, $e);
}
diff --git a/app/Support/Form/AccountForm.php b/app/Support/Form/AccountForm.php
index d4e5d0e25e..427dca1c34 100644
--- a/app/Support/Form/AccountForm.php
+++ b/app/Support/Form/AccountForm.php
@@ -122,7 +122,7 @@ class AccountForm
])->render();
} catch (Throwable $e) {
Log::debug(sprintf('Could not render assetAccountCheckList(): %s', $e->getMessage()));
- $html = 'Could not render assetAccountCheckList.';
+ $html = sprintf('Could not render assetAccountCheckList: %s', $e->getMessage());
throw new FireflyException($html, 0, $e);
}
diff --git a/app/Support/Http/Controllers/RenderPartialViews.php b/app/Support/Http/Controllers/RenderPartialViews.php
index 4ac5322ad3..4f638000eb 100644
--- a/app/Support/Http/Controllers/RenderPartialViews.php
+++ b/app/Support/Http/Controllers/RenderPartialViews.php
@@ -96,7 +96,7 @@ trait RenderPartialViews
$result = view('reports.options.budget', ['budgets' => $budgets])->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
- $result = 'Could not render view.';
+ $result = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e);
}
@@ -178,7 +178,7 @@ trait RenderPartialViews
$result = view('reports.options.category', ['categories' => $categories])->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render reports.options.category: %s', $e->getMessage()));
- $result = 'Could not render view.';
+ $result = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e);
}
@@ -232,7 +232,7 @@ trait RenderPartialViews
$result = view('reports.options.double', ['set' => $set])->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
- $result = 'Could not render view.';
+ $result = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e);
}
@@ -404,7 +404,7 @@ trait RenderPartialViews
$result = view('reports.options.no-options')->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render reports.options.no-options: %s', $e->getMessage()));
- $result = 'Could not render view.';
+ $result = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e);
}
@@ -437,7 +437,7 @@ trait RenderPartialViews
$result = view('reports.options.tag', ['tags' => $grouped])->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
- $result = 'Could not render view.';
+ $result = sprintf('Could not render view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e);
}
diff --git a/resources/views/components/layout/sidebar.blade.php b/resources/views/components/layout/sidebar.blade.php
index 779268a60f..3b10f3be9f 100644
--- a/resources/views/components/layout/sidebar.blade.php
+++ b/resources/views/components/layout/sidebar.blade.php
@@ -90,7 +90,7 @@
</li>
</ul>
</li>
- <li class="nav-item {{ menu_open_partial('rules.') }} {{ menu_open_partial('webhooks.') }} {{ menu_open_partial('recurring.') }}">
+ <li class="nav-item {{ menu_open_partial('rules.') }} {{ menu_open_partial('rule-groups.') }} {{ menu_open_partial('webhooks.') }} {{ menu_open_partial('recurring.') }}">
<a href="#" class="nav-link">
<em class="nav-icon bi bi-cpu"></em>
<p>
@@ -100,7 +100,7 @@
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
- <a href="{{ route('rules.index') }}" class="nav-link {{ menu_item_active_partial('rules.') }}">
+ <a href="{{ route('rules.index') }}" class="nav-link {{ menu_item_active_partial('rules.') }} {{ menu_item_active_partial('rule-groups.') }}">
<em class="nav-icon bi bi-shuffle"></em>
<p>{{__('firefly.rules')}}</p>
</a>
diff --git a/resources/views/form/assetAccountCheckList.blade.php b/resources/views/form/assetAccountCheckList.blade.php
index a2e28d50a2..86bd0ee290 100644
--- a/resources/views/form/assetAccountCheckList.blade.php
+++ b/resources/views/form/assetAccountCheckList.blade.php
@@ -1,24 +1,23 @@
-<div class="{{ classes }}" id="{{ name }}_holder">
- <label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
-
- <div class="col-sm-8">
- {% for groupName, accounts in grouped %}
- <strong>{{ groupName }}</strong><br/>
- {% for id, account in accounts %}
- <div class="checkbox ml-4">
- <label>
- {% if account in selected or (selected|length == 0 and options.select_all == true) %}
- {{ Html::checkbox(name~'[]',true, id).id(id) }}
+@foreach($grouped as $groupName => $accounts)
+ <div class="mb-3">
+ <div class="row" id="{{ $name }}_holder">
+ <div class="col-sm-3">{{ $groupName }}</div>
+ <div class="col-sm-9">
+ @foreach($accounts as $id => $account)
+ <div class="form-check has-validation">
+ {{-- {% if account in selected or (selected|length == 0 and options.select_all == true) %} --}}
+ @if(in_array($id, $selected) || (count($selected) == 0 && $options['select_all'] === true))
+ {{ Html::checkbox($name . '[]', true, $id)->class('form-check-input')->id($id) }}
@else
- {{ Html::checkbox(name~'[]',false, id).id(id) }}
+ {{ Html::checkbox($name . '[]', false, $id)->class('form-check-input')->id($id) }}
@endif
- {{ account|escape }}
- </label>
- </div>
- @endforeach
- @endforeach
- @include('form.help')
- @include('form.feedback')
+ <label class="form-check-label" for="{{ $id }}">
+ {{ $account }}
+ </label>
+ </div>
+ @endforeach
+ </div>
+ </div>
</div>
-</div>
+@endforeach
diff --git a/resources/views/form/password.blade.php b/resources/views/form/password.blade.php
index 860a2a91e2..b0fa7b4923 100644
--- a/resources/views/form/password.blade.php
+++ b/resources/views/form/password.blade.php
@@ -1,9 +1,10 @@
-<div class="{{ classes }}" id="{{ name }}_holder">
- <label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
-
- <div class="col-sm-8">
- {{ Html::input('password', name, value).id(options.id).class('form-control').attribute('placeholder',options.placeholder).attribute('autocomplete','off').attribute('spellcheck','false') }}
- @include('form.help')
+<div class="row mb-3" id="{{ $name }}_holder">
+ <div class="input-group has-validation">
+ <label for="{{ $options['id'] }}" class="col-sm-3 col-form-label has-validation">{{ $label }}</label>
+ <div class="col-sm-9">
+ {{ Html::input('password', $name, $value)->id($options['id'])->class($errors->has($name) ? 'is-invalid form-control' : 'form-control')->attribute('autocomplete','off')->attribute('spellcheck','false')->attribute('placeholder',$options['placeholder']) }}
@include('form.feedback')
+ @include('form.help')
</div>
</div>
+</div>
diff --git a/resources/views/list/accounts.blade.php b/resources/views/list/accounts.blade.php
index 98a0a38f5c..28ddc8bb52 100644
--- a/resources/views/list/accounts.blade.php
+++ b/resources/views/list/accounts.blade.php
@@ -67,7 +67,7 @@
<td class="text-end">
<span class="mr-2">
{% for key, balance in account.endBalances %}
- <span title="{{ key }}">
+ <span title="{{ $key }}">
{% if 'balance' == key %}
{% if not convertToPrimary %}
{!! format_amount_by_symbol(balance, account.currency.symbol, account.currency.decimal_places) }}
@@ -116,7 +116,7 @@
<td class="text-end hidden-sm hidden-xs hidden-md">
<span class="mr-1">
{% for key, balance in account.differences %}
- <span title="{{ key }}">
+ <span title="{{ $key }}">
{% if 'balance' == key %}
{% if not convertToPrimary %}
{!! format_amount_by_symbol(balance, account.currency.symbol, account.currency.decimal_places) }}
diff --git a/resources/views/partials/debug-table.blade.php b/resources/views/partials/debug-table.blade.php
index 2ad05e60ae..d29060a0ec 100644
--- a/resources/views/partials/debug-table.blade.php
+++ b/resources/views/partials/debug-table.blade.php
@@ -179,7 +179,7 @@
<td>Locale(s) supported</td>
<td>
{% for key, attempt in user.locale_attempts %}
- {{ key }}: {% if attempt %}:white_check_mark:@else:x:@endif<br>
+ {{ $key }}: {% if attempt %}:white_check_mark:@else:x:@endif<br>
@endforeach
</td>
</tr>
diff --git a/resources/views/preferences/index.blade.php b/resources/views/preferences/index.blade.php
index 630fa52408..a549a16c92 100644
--- a/resources/views/preferences/index.blade.php
+++ b/resources/views/preferences/index.blade.php
@@ -51,7 +51,7 @@
{% for key, lang in languages %}
<option {% if language == key %}
selected
- @endif value="{{ key }}">{{ lang.name_locale }}
+ @endif value="{{ $key }}">{{ lang.name_locale }}
({{ lang.name_english }})
</option>
@@ -81,7 +81,7 @@
{% for key, loc in locales %}
<option {% if locale == key %}
selected
- @endif value="{{ key }}">
+ @endif value="{{ $key }}">
{% if key == 'equal' %}
{{ 'equal_to_language'|_ }}
@else
@@ -172,7 +172,7 @@
<h3>{{ 'pref_home_screen_accounts'|_ }}</h3>
<p>{{ 'pref_home_screen_accounts_help'|_ }}</p>
{% for type, accounts in groupedAccounts %}
- <strong>{{ type }}</strong>
+ <strong>{{ $type }}</strong>
{% for id, name in accounts %}
<div class="form-group">
<div class="col-sm-10">
diff --git a/resources/views/rules/index.blade.php b/resources/views/rules/index.blade.php
index 447ea79c09..8bff38959b 100644
--- a/resources/views/rules/index.blade.php
+++ b/resources/views/rules/index.blade.php
@@ -1,11 +1,11 @@
@extends('layout.v3.session')
-@section('content')
-@if(1 === count($ruleGroups) && 0 === $ruleGroups[0]->count())
-@php
-$shownDemo = true
-@endphp
-<x-empty-page :route="route('rules.create', [$objectType])" type="rules" object-type="default" />
-@endif
+ @section('content')
+ @if(1 === count($ruleGroups) && 0 === $ruleGroups[0]->count())
+ @php
+ $shownDemo = true
+ @endphp
+ <x-empty-page :route="route('rules.create', [$objectType])" type="rules" object-type="default" />
+ @endif
@foreach($ruleGroups as $ruleGroup)
<div class="row mb-2">
<div class="col-lg-12 col-md-12 col-sm-12">
@@ -86,7 +86,7 @@ $shownDemo = true
<td>
<div class="btn-group btn-group-sm test_buttons">
{{-- show which transactions would match --}}
- <a href="{{ route('rules.search',$rule->id) }}" class="btn btn-outline-secondary {% if false == rule.strict %}test_rule_triggers@endif" data-id="{{ $rule->id }}" title="{{ __('firefly.test_rule_triggers') }}"><span data-id="{{ $rule->id }}" class="bi bi-flask"></span></a>
+ <a href="{{ route('rules.search',$rule->id) }}" class="btn btn-outline-secondary @if(false === $rule->strict) test_rule_triggers @endif" data-id="{{ $rule->id }}" title="{{ __('firefly.test_rule_triggers') }}"><span data-id="{{ $rule->id }}" class="bi bi-flask"></span></a>
@if($rule->active)
{{-- actually execute rule --}}
<a href="{{ route('rules.select-transactions',$rule->id) }}" class="btn btn-outline-secondary" title=" {{ trans('firefly.apply_rule_selection', ['title' => $rule->title]) }}"><span class="bi bi-power "></span></a>
diff --git a/resources/views/rules/partials/action.blade.php b/resources/views/rules/partials/action.blade.php
index 3c416dabef..046659f003 100644
--- a/resources/views/rules/partials/action.blade.php
+++ b/resources/views/rules/partials/action.blade.php
@@ -1,30 +1,30 @@
-<tr data-count="{{ count }}" class="rule-action-holder">
+<tr data-count="{{ $count }}" class="rule-action-holder">
<td class="forty-px">
<a href="#" class="btn btn-danger btn-sm remove-action"><span class="bi bi-trash"></span></a>
</td>
<td class="thirty">
{{-- TODO error when invalid name --}}
- <select name="actions[{{ count }}][type]" class="form-control">
- {% for key,type in allRuleActions() %}
- <option value="{{ key }}" label="{{ type }}" {% if key == oldAction %} selected@endif>{{ type }}</option>
+ <select name="actions[{{ $count }}][type]" class="form-control">
+ @foreach(all_rule_actions() as $key => $type)
+ <option value="{{ $key }}" label="{{ $type }}" @if($key === $oldAction) selected @endif>{{ $type }}</option>
@endforeach
</select>
</td>
<td class="position-relative">
- <input autocomplete="off" type="text" value="{{ oldValue }}" name="actions[{{ count }}][value]"
+ <input autocomplete="off" type="text" value="{{ $oldValue }}" name="actions[{{ $count }}][value]"
class="form-control">
- {% if errors.has('actions.'~count~'.value') %}
+ @if($errors->has('actions.' . $count . '.value'))
<p class="text-danger">
- {{ errors.first('actions.'~count~'.value') }}
+ {{ $errors->first('actions.' . $count . '.value') }}
</p>
@endif
</td>
<td class="twenty">
<div class="checkbox">
<label>
- <input type="checkbox" name="actions[{{ count }}][stop_processing]" value="1"
- {% if oldChecked %}checked@endif
+ <input type="checkbox" name="actions[{{ $count }}][stop_processing]" value="1"
+ @if($oldChecked) checked @endif
/>
</label>
</div>
diff --git a/resources/views/rules/partials/test-trigger-modal.blade.php b/resources/views/rules/partials/test-trigger-modal.blade.php
index f56aca1391..74b4a0755a 100644
--- a/resources/views/rules/partials/test-trigger-modal.blade.php
+++ b/resources/views/rules/partials/test-trigger-modal.blade.php
@@ -2,12 +2,12 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
- <h5 class="modal-title" id="testTriggerLabel">{{ 'test_rule_triggers'|_ }}</h5>
+ <h5 class="modal-title" id="testTriggerLabel">{{ __('firefly.test_rule_triggers') }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ __('firefly.close') }}"></button>
</div>
<div class="modal-body">
<div class="transaction-warning alert alert-warning">
- <h4><span class="icon bi bi-exclamation-triangle"></span> {{ 'flash_warning'|_ }}</h4>
+ <h4><span class="icon bi bi-exclamation-triangle"></span> {{ __('firefly.flash_warning') }}</h4>
<span class="warning-contents"></span>
</div>
<div class="transactions-list">
diff --git a/resources/views/rules/partials/trigger.blade.php b/resources/views/rules/partials/trigger.blade.php
index b503dfd8a0..54d8922655 100644
--- a/resources/views/rules/partials/trigger.blade.php
+++ b/resources/views/rules/partials/trigger.blade.php
@@ -1,41 +1,41 @@
-<tr data-count="{{ count }}" class="rule-trigger-holder">
+<tr data-count="{{ $count }}" class="rule-trigger-holder">
<td class="forty-px">
<a href="#" class="btn btn-danger btn-sm remove-trigger"><span class="bi bi-trash"></span></a>
</td>
<td class="thirty">
- <select name="triggers[{{ count }}][type]" class="form-control">
- {% for key,type in triggers %}
- <option value="{{ key }}" label="{{ type }}"
- {% if key == oldTrigger %}
+ <select name="triggers[{{ $count }}][type]" class="form-control">
+ @foreach($triggers as $key => $type)
+ <option value="{{ $key }}" label="{{ $type }}"
+ @if($oldTrigger === $key)
selected
@endif
- >{{ type }}</option>
+ >{{ $type }}</option>
@endforeach
</select>
</td>
<td class="forty-px">
<div class="checkbox">
<label>
- <input type="checkbox" name="triggers[{{ count }}][prohibited]" value="1"
- {% if oldProhibited %}checked@endif
+ <input type="checkbox" name="triggers[{{ $count }}][prohibited]" value="1"
+ @if($oldProhibited) checked @endif
/>
</label>
</div>
</td>
<td>
- <input autocomplete="off" type="text" value="{{ oldValue }}" name="triggers[{{ count }}][value]"
+ <input autocomplete="off" type="text" value="{{ $oldValue }}" name="triggers[{{ $count }}][value]"
class="form-control">
- {% if errors.has('triggers.'~count~'.value') %}
+ @if($errors->has('triggers.' . $count . '.value'))
<p class="text-danger">
- {{ errors.first('triggers.'~count~'.value') }}
+ {{ $errors->first('triggers.' . $count . '.value') }}
</p>
@endif
</td>
<td class="twenty">
<div class="checkbox">
<label>
- <input type="checkbox" class="trigger-stop-processing" name="triggers[{{ count }}][stop_processing]" value="1"
- {% if oldChecked %}checked@endif
+ <input type="checkbox" class="trigger-stop-processing" name="triggers[{{ $count }}][stop_processing]" value="1"
+ @if($oldChecked) checked @endif
/>
</label>
</div>
diff --git a/resources/views/rules/rule-group/create.blade.php b/resources/views/rules/rule-group/create.blade.php
index 8d48c0e005..f291849f3e 100644
--- a/resources/views/rules/rule-group/create.blade.php
+++ b/resources/views/rules/rule-group/create.blade.php
@@ -1,32 +1,27 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<form method="POST" action="{{ route('rule-groups.store') }}" accept-charset="UTF-8" class="form-horizontal" id="store">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.mandatoryFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::text('title') }}
+ {!! ExpandedForm::text('title') !!}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{{-- optional fields --}}
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.optionalFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::textarea('description') }}
+ {!! ExpandedForm::textarea('description') !!}
</div>
</div>
</div>
@@ -34,15 +29,15 @@
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{{-- panel for options --}}
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::optionsList('create','rule-group') }}
+ {!! ExpandedForm::optionsList('create','rule-group') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ 'store_new_rule_group'|_ }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">{{ __('firefly.store_new_rule_group') }}</button>
</div>
</div>
@@ -52,5 +47,6 @@
</form>
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/ff/rule-groups/create.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
@endsection
diff --git a/resources/views/rules/rule-group/delete.blade.php b/resources/views/rules/rule-group/delete.blade.php
index 4332049121..68a1209934 100644
--- a/resources/views/rules/rule-group/delete.blade.php
+++ b/resources/views/rules/rule-group/delete.blade.php
@@ -1,18 +1,12 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
-@endsection
-
@section('content')
-
- <form method="POST" action="{{ route('rule-groups.destroy',ruleGroup.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
+ <form method="POST" action="{{ route('rule-groups.destroy',$ruleGroup->id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12">
<div class="card card-danger card-outline">
<div class="card-header">
- <h3 class="card-title">{{ trans('form.delete_rule_group', {'title': ruleGroup.title}) }}</h3>
+ <h3 class="card-title">{{ trans('form.delete_rule_group', ['title'=> $ruleGroup->title]) }}</h3>
</div>
<div class="card-body">
<p class="text-danger">
@@ -20,21 +14,21 @@
</p>
<p>
- {{ trans('form.ruleGroup_areYouSure', {'title': ruleGroup.title}) }}
+ {{ trans('form.ruleGroup_areYouSure', ['title' => $ruleGroup->title]) }}
</p>
- {% if ruleGroup.rules|length > 0 %}
+ @if(count($ruleGroup->rules) > 0)
<p class="text-danger">
- {{ trans_choice('form.also_delete_rules', ruleGroup.rules|length) }}
+ {{ trans_choice('form.also_delete_rules', count($ruleGroup->rules)) }}
</p>
<p class="text-success">
- {{ trans_choice('firefly.save_rules_by_moving', ruleGroup.rules|length) }}
+ {{ trans_choice('firefly.save_rules_by_moving', count($ruleGroup->rules)) }}
</p>
<p>
- {{ RuleForm.ruleGroupListWithEmpty('move_rules_before_delete',null, {'hidden': ruleGroup.id}) }}
+ {!! RuleForm::ruleGroupListWithEmpty('move_rules_before_delete',null, ['hidden' => $ruleGroup->id]) !!}
</p>
@else
<input type="hidden" name="move_rules_before_delete" value="0"/>
diff --git a/resources/views/rules/rule-group/edit.blade.php b/resources/views/rules/rule-group/edit.blade.php
index a69454b0a4..d377478003 100644
--- a/resources/views/rules/rule-group/edit.blade.php
+++ b/resources/views/rules/rule-group/edit.blade.php
@@ -1,16 +1,11 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
-@endsection
-
@section('content')
- <form method="post" action="{{ route('rule-groups.update',ruleGroup.id) }}" class="form-horizontal"
+ <form method="post" action="{{ route('rule-groups.update',$ruleGroup->id) }}" class="form-horizontal"
accept-charset="UTF-8"
enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
- <input type="hidden" name="id" value="{{ ruleGroup.id }}"/>
+ <input type="hidden" name="id" value="{{ $ruleGroup->id }}"/>
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-6">
<div class="card">
@@ -19,9 +14,9 @@
</div>
<div class="card-body">
{{-- only correct way to do active checkbox --}}
- {!! ExpandedForm::checkbox('active', 1) }}
+ {!! ExpandedForm::checkbox('active', 1) !!}
- {!! ExpandedForm::text('title', ruleGroup.title) }}
+ {!! ExpandedForm::text('title', $ruleGroup->title) !!}
</div>
</div>
@@ -34,7 +29,7 @@
<h3 class="card-title">{{ __('firefly.optionalFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::textarea('description', ruleGroup.description) }}
+ {!! ExpandedForm::textarea('description', $ruleGroup->description) !!}
</div>
</div>
</div>
@@ -47,10 +42,10 @@
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::optionsList('update','rule-group') }}
+ {!! ExpandedForm::optionsList('update','rule-group') !!}
</div>
<div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ 'update_rule_group'|_ }}</button>
+ <button type="submit" class="btn text-end btn-success">{{ __('firefly.update_rule_group') }}</button>
</div>
</div>
</div>
diff --git a/resources/views/rules/rule-group/select-transactions.blade.php b/resources/views/rules/rule-group/select-transactions.blade.php
index 0ad5090268..70f57f8b74 100644
--- a/resources/views/rules/rule-group/select-transactions.blade.php
+++ b/resources/views/rules/rule-group/select-transactions.blade.php
@@ -1,12 +1,7 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
-@endsection
-
@section('content')
- <form method="POST" action="{{ route('rule-groups.execute', ruleGroup.id) }}" accept-charset="UTF-8"
+ <form method="POST" action="{{ route('rule-groups.execute', $ruleGroup->id) }}" accept-charset="UTF-8"
class="form-horizontal" id="execute-rule-group">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
@@ -20,19 +15,19 @@
<div class="card-body">
<div id="form-body">
<p>
- {{ trans('firefly.apply_rule_group_selection_intro', {title: ruleGroup.title}) }}
+ {{ trans('firefly.apply_rule_group_selection_intro', ['title' => $ruleGroup->title]) }}
</p>
<div class="row">
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
- {!! ExpandedForm::date('start') }}
- {!! ExpandedForm::date('end') }}
- {{ AccountForm.assetAccountCheckList('accounts', {'select_all': true,'class': 'account-checkbox', 'label': trans('firefly.include_transactions_from_accounts') }) }}
+ {!! ExpandedForm::date('start') !!}
+ {!! ExpandedForm::date('end') !!}
+ {!! AccountForm::assetAccountCheckList('accounts', ['select_all' => true,'class' => 'account-checkbox', 'label' => trans('firefly.include_transactions_from_accounts') ]) !!}
</div>
</div>
</div>
</div>
<div class="card-footer">
- <input type="submit" name="submit" value="{{ 'execute'|_ }}" id="do-execute-button"
+ <input type="submit" name="submit" value="{{ __('firefly.execute') }}" id="do-execute-button"
class="btn btn-success text-end"/>
</div>
</div>
diff --git a/resources/views/rules/rule/create.blade.php b/resources/views/rules/rule/create.blade.php
index b23a9a0eff..eca4617520 100644
--- a/resources/views/rules/rule/create.blade.php
+++ b/resources/views/rules/rule/create.blade.php
@@ -1,28 +1,23 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
-@endsection
-
@section('content')
<form method="POST" action="{{ route('rules.store') }}" accept-charset="UTF-8" class="form-horizontal" id="store">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
- <input type="hidden" name="rule_group_id" value="{{ ruleGroup.id }}"/>
- <input type="hidden" name="return_to_bill" value="{% if returnToBill %}true@elsefalse@endif"/>
- <input type="hidden" name="bill_id" value="{% if bill %}{{ bill.id }}@else0@endif"/>
+ <input type="hidden" name="rule_group_id" value="{{ $ruleGroup->id }}"/>
+ <input type="hidden" name="return_to_bill" value="@if($returnToBill??false)true @else false @endif"/>
+ <input type="hidden" name="bill_id" value="@if(null !== ($bill??null)){{ $bill->id }} @else 0 @endif"/>
<input type="hidden" name="active" value="1"/>
- {% if bill %}
+ @if(null !== ($bill??null))
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box box-success" id="mandatory">
<div class="card-header">
- <h3 class="card-title">{{ trans('firefly.create_rule_for_bill', {name: bill.name}) }}</h3>
+ <h3 class="card-title">{{ trans('firefly.create_rule_for_bill', ['name' => $bill->name]) }}</h3>
</div>
<div class="card-body">
<p class="text-info">
- {{ trans('firefly.create_rule_for_bill_txt', {name: bill.name}) }}
+ {{ trans('firefly.create_rule_for_bill_txt', ['name' => $bill->name]) }}
</p>
</div>
</div>
@@ -36,23 +31,23 @@
<h3 class="card-title">{{ __('firefly.mandatoryFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::text('title') }}
- {!! ExpandedForm::select('trigger',allJournalTriggers()) }}
- {{ RuleForm.ruleGroupList('rule_group_id', ruleGroup.id) }}
- {!! ExpandedForm::checkbox('stop_processing',1,null, {helpText: trans('firefly.rule_help_stop_processing')}) }}
- {!! ExpandedForm::checkbox('strict',1, null,{helpText: trans('firefly.rule_help_strict')}) }}
+ {!! ExpandedForm::text('title') !!}
+ {!! ExpandedForm::select('trigger', all_journal_triggers()) !!}
+ {!! RuleForm::ruleGroupList('rule_group_id', $ruleGroup->id) !!}
+ {!! ExpandedForm::checkbox('stop_processing',1, null, ['helpText' => trans('firefly.rule_help_stop_processing')]) !!}
+ {!! ExpandedForm::checkbox('strict',1, null,['helpText' => trans('firefly.rule_help_strict')]) !!}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{{-- optional fields --}}
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.optionalFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::textarea('description', null, {helpText: trans('firefly.field_supports_markdown')}) }}
+ {!! ExpandedForm::textarea('description', null, ['helpText' => trans('firefly.field_supports_markdown')]) !!}
</div>
</div>
</div>
@@ -60,64 +55,64 @@
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'rule_triggers'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.rule_triggers') }}</h3>
</div>
<div class="box-body rule-trigger-box">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
- <th colspan="2">{{ 'trigger'|_ }}</th>
- <th>{{ 'is_not_rule_trigger'|_ }}</th>
- <th>{{ 'trigger_value'|_ }}</th>
- <th>{{ 'stop_processing_other_triggers'|_ }}</th>
+ <th colspan="2">{{ __('firefly.trigger') }}</th>
+ <th>{{ __('firefly.is_not_rule_trigger') }}</th>
+ <th>{{ __('firefly.trigger_value') }}</th>
+ <th>{{ __('firefly.stop_processing_other_triggers') }}</th>
</tr>
</thead>
<tbody class="rule-trigger-tbody">
- {% for trigger in oldTriggers %}
- {{ trigger|raw }}
+ @foreach($oldTriggers as $trigger)
+ {!! $trigger !!}
@endforeach
</tbody>
</table>
<p>
<br/>
- <button type="button" class="btn btn-outline-secondary add_rule_trigger">{{ 'add_rule_trigger'|_ }}</button>
- <a href="#" class="btn btn-outline-secondary test_rule_triggers"><span class="fa fa-flask"></span> {{ 'test_rule_triggers'|_ }}</a>
+ <button type="button" class="btn btn-outline-secondary add_rule_trigger">{{ __('firefly.add_rule_trigger') }}</button>
+ <a href="#" class="btn btn-outline-secondary test_rule_triggers"><span class="fa fa-flask"></span> {{ __('firefly.test_rule_triggers') }}</a>
</p>
</div>
</div>
</div>
</div>
- {% include 'rules.partials.test-trigger-modal' %}
+ @include('rules.partials.test-trigger-modal')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'rule_actions'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.rule_actions') }}</h3>
</div>
<div class="box-body rule-action-box">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
- <th colspan="2">{{ 'action'|_ }}</th>
- <th>{{ 'action_value'|_ }}</th>
- <th>{{ 'stop_executing_other_actions'|_ }}</th>
+ <th colspan="2">{{ __('firefly.action') }}</th>
+ <th>{{ __('firefly.action_value') }}</th>
+ <th>{{ __('firefly.stop_executing_other_actions') }}</th>
</tr>
</thead>
<tbody class="rule-action-tbody">
- {% for action in oldActions %}
- {{ action|raw }}
+ @foreach($oldActions as $action)
+ {!! $action !!}
@endforeach
</tbody>
</table>
<p>
<br/>
- <a href="#" class="btn btn-outline-secondary add_rule_action">{{ 'add_rule_action'|_ }}</a>
+ <a href="#" class="btn btn-outline-secondary add_rule_action">{{ __('firefly.add_rule_action') }}</a>
</p>
</div>
</div>
@@ -127,16 +122,16 @@
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{{-- panel for options --}}
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::checkbox('run_after_form',1,null, {helpText: trans('firefly.rule_run_after_creation')}) }}
- {!! ExpandedForm::optionsList('create','rule') }}
+ {!! ExpandedForm::checkbox('run_after_form',1,null, ['helpText' => trans('firefly.rule_run_after_creation')]) !!}
+ {!! ExpandedForm::optionsList('create','rule') !!}
</div>
<div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ 'store_new_rule'|_ }}</button>
+ <button type="submit" class="btn text-end btn-success">{{ __('firefly.store_new_rule') }}</button>
</div>
</div>
@@ -147,11 +142,12 @@
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
- var triggerCount = {{ triggerCount }};
- var actionCount = {{ actionCount }};
- var testRuleTriggersText = '{{ 'test_rule_triggers'|_|escape('js') }}';
+ var triggerCount = {{ $triggerCount }};
+ var actionCount = {{ $actionCount }};
+ var testRuleTriggersText = '{{ __('firefly.test_rule_triggers') }}';
</script>
<script type="text/javascript" src="v1/js/ff/rules/create-edit.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
diff --git a/resources/views/rules/rule/delete.blade.php b/resources/views/rules/rule/delete.blade.php
index dfb7d07fc7..3826a5bbe5 100644
--- a/resources/views/rules/rule/delete.blade.php
+++ b/resources/views/rules/rule/delete.blade.php
@@ -1,18 +1,12 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, rule) }}
-@endsection
-
@section('content')
-
- <form method="POST" action="{{ route('rules.destroy',rule.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
+ <form method="POST" action="{{ route('rules.destroy',[$rule->id]) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12">
<div class="card card-danger card-outline">
<div class="card-header">
- <h3 class="card-title">{{ trans('form.delete_rule', {'title': rule.title}) }}</h3>
+ <h3 class="card-title">{{ trans('form.delete_rule', ['title' => $rule->title]) }}</h3>
</div>
<div class="card-body">
<p class="text-danger">
@@ -20,7 +14,7 @@
</p>
<p>
- {{ trans('form.rule_areYouSure', {'title': rule.title}) }}
+ {{ trans('form.rule_areYouSure', ['title' => $rule->title]) }}
</p>
</div>
<div class="card-footer">
@@ -32,3 +26,6 @@
</div>
</form>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/rules/rule/edit.blade.php b/resources/views/rules/rule/edit.blade.php
index dc09c36b88..8dcf272e57 100644
--- a/resources/views/rules/rule/edit.blade.php
+++ b/resources/views/rules/rule/edit.blade.php
@@ -1,15 +1,10 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, rule) }}
-@endsection
-
@section('content')
- <form method="post" action="{{ route('rules.update', rule.id) }}" class="form-horizontal" accept-charset="UTF-8"
+ <form method="post" action="{{ route('rules.update', $rule->id) }}" class="form-horizontal" accept-charset="UTF-8"
enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
- <input type="hidden" name="id" value="{{ rule.id }}"/>
+ <input type="hidden" name="id" value="{{ $rule->id }}"/>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="card">
@@ -17,15 +12,13 @@
<h3 class="card-title">{{ __('firefly.mandatoryFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::text('title', rule.title) }}
- {{ RuleForm.ruleGroupList('rule_group_id', rule.rule_group_id) }}
- {!! ExpandedForm::select('trigger',allJournalTriggers(), primaryTrigger) }}
-
- {{-- only correct way to do active checkbox --}}
- {!! ExpandedForm::checkbox('active', 1, null, {helpText: trans('firefly.rule_help_active')}) }}
+ {!! ExpandedForm::text('title', $rule->title) !!}
+ {!! RuleForm::ruleGroupList('rule_group_id', $rule->rule_group_id) !!}
+ {!! ExpandedForm::select('trigger',all_journal_triggers(), $primaryTrigger) !!}
+ {!! ExpandedForm::checkbox('active', 1, null, ['helpText' => trans('firefly.rule_help_active')]) !!}
- {!! ExpandedForm::checkbox('stop_processing',1,rule.stop_processing, {helpText: trans('firefly.rule_help_stop_processing')}) }}
- {!! ExpandedForm::checkbox('strict',1,rule.strict, {helpText: trans('firefly.rule_help_strict')}) }}
+ {!! ExpandedForm::checkbox('stop_processing',1,$rule->stop_processing, ['helpText' => trans('firefly.rule_help_stop_processing')]) !!}
+ {!! ExpandedForm::checkbox('strict',1,$rule->strict, ['helpText' => trans('firefly.rule_help_strict')]) !!}
</div>
</div>
</div>
@@ -37,7 +30,7 @@
<h3 class="card-title">{{ __('firefly.optionalFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::textarea('description', rule.description, {helpText: trans('firefly.field_supports_markdown')}) }}
+ {!! ExpandedForm::textarea('description', $rule->description, ['helpText' => trans('firefly.field_supports_markdown')]) !!}
</div>
</div>
</div>
@@ -47,63 +40,63 @@
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card">
<div class="card-header">
- <h3 class="card-title">{{ 'rule_triggers'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.rule_triggers') }}</h3>
</div>
<div class="box-body rule-trigger-box">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
- <th colspan="2">{{ 'trigger'|_ }}</th>
- <th>{{ 'is_not_rule_trigger'|_ }}</th>
- <th>{{ 'trigger_value'|_ }}</th>
- <th>{{ 'stop_processing_other_triggers'|_ }}</th>
+ <th colspan="2">{{ __('firefly.trigger') }}</th>
+ <th>{{ __('firefly.is_not_rule_trigger') }}</th>
+ <th>{{ __('firefly.trigger_value') }}</th>
+ <th>{{ __('firefly.stop_processing_other_triggers') }}</th>
</tr>
</thead>
<tbody class="rule-trigger-tbody">
- {% for trigger in oldTriggers %}
- {{ trigger|raw }}
+ @foreach($oldTriggers as $trigger)
+ {!! $trigger !!}
@endforeach
</tbody>
</table>
<p>
<br/>
- <a href="#" class="btn btn-outline-secondary add_rule_trigger">{{ 'add_rule_trigger'|_ }}</a>
+ <a href="#" class="btn btn-outline-secondary add_rule_trigger">{{ __('firefly.add_rule_trigger') }}</a>
<a href="#" class="btn btn-outline-secondary test_rule_triggers"><span
- class="fa fa-flask"></span> {{ 'test_rule_triggers'|_ }}</a>
+ class="fa fa-flask"></span> {{ __('firefly.test_rule_triggers') }}</a>
</p>
</div>
</div>
</div>
</div>
- {% include 'rules.partials.test-trigger-modal' %}
+ @include('rules.partials.test-trigger-modal')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card">
<div class="card-header">
- <h3 class="card-title">{{ 'rule_actions'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.rule_actions') }}</h3>
</div>
<div class="card-body">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
- <th colspan="2">{{ 'action'|_ }}</th>
- <th>{{ 'action_value'|_ }}</th>
- <th>{{ 'stop_executing_other_actions'|_ }}</th>
+ <th colspan="2">{{ __('firefly.action') }}</th>
+ <th>{{ __('firefly.action_value') }}</th>
+ <th>{{ __('firefly.stop_executing_other_actions') }}</th>
</tr>
</thead>
<tbody class="rule-action-tbody">
- {% for action in oldActions %}
- {{ action|raw }}
+ @foreach($oldActions as $action)
+ {!! $action !!}
@endforeach
</tbody>
</table>
<p>
<br/>
- <a href="#" class="btn btn-outline-secondary add_rule_action">{{ 'add_rule_action'|_ }}</a>
+ <a href="#" class="btn btn-outline-secondary add_rule_action">{{ __('firefly.add_rule_action') }}</a>
</p>
</div>
</div>
@@ -118,11 +111,11 @@
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::checkbox('run_after_form',1,null, {helpText: trans('firefly.rule_run_after_edit')}) }}
- {!! ExpandedForm::optionsList('update','rule') }}
+ {!! ExpandedForm::checkbox('run_after_form',1,null, ['helpText' => trans('firefly.rule_run_after_edit')]) !!}
+ {!! ExpandedForm::optionsList('update','rule') !!}
</div>
<div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ 'update_rule'|_ }}</button>
+ <button type="submit" class="btn text-end btn-success">{{ __('firefly.update_rule') }}</button>
</div>
</div>
@@ -134,12 +127,13 @@
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
- var triggerCount = {{ triggerCount }};
- var actionCount = {{ actionCount }};
- var testRuleTriggersText = '{{ 'test_rule_triggers'|_|escape('js') }}';
+ var triggerCount = {{ $triggerCount }};
+ var actionCount = {{ $actionCount }};
+ var testRuleTriggersText = '{{ __('firefly.test_rule_triggers') }}';
</script>
<script type="text/javascript" src="v1/js/ff/rules/create-edit.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
diff --git a/resources/views/rules/rule/select-transactions.blade.php b/resources/views/rules/rule/select-transactions.blade.php
index 4b130bc08d..0d463234f7 100644
--- a/resources/views/rules/rule/select-transactions.blade.php
+++ b/resources/views/rules/rule/select-transactions.blade.php
@@ -1,12 +1,7 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, rule) }}
-@endsection
-
@section('content')
- <form method="POST" action="{{ route('rules.execute', rule.id) }}" accept-charset="UTF-8" class="form-horizontal" id="execute-rule">
+ <form method="POST" action="{{ route('rules.execute', $rule->id) }}" accept-charset="UTF-8" class="form-horizontal" id="execute-rule">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
@@ -19,19 +14,19 @@
<div class="card-body">
<div id="form-body">
<p>
- {{ trans('firefly.apply_rule_selection_intro', {title: rule.title}) }}
+ {{ trans('firefly.apply_rule_selection_intro', ['title' => $rule->title]) }}
</p>
<div class="row">
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
- {!! ExpandedForm::date('start') }}
- {!! ExpandedForm::date('end') }}
- {{ AccountForm.assetAccountCheckList('accounts', {'select_all': true, 'class': 'account-checkbox', 'label': trans('firefly.include_transactions_from_accounts') }) }}
+ {!! ExpandedForm::date('start') !!}
+ {!! ExpandedForm::date('end') !!}
+ {!! AccountForm::assetAccountCheckList('accounts', ['select_all' => true, 'class' => 'account-checkbox', 'label' => trans('firefly.include_transactions_from_accounts') ]) !!}
</div>
</div>
</div>
</div>
- <div class="card-footer">
- <input type="submit" name="submit" value="{{ 'execute'|_ }}" id="do-execute-button" class="btn btn-success text-end"/>
+ <div class="card-footer text-end">
+ <input type="submit" name="submit" value="{{ __('firefly.execute') }}" id="do-execute-button" class="btn btn-success"/>
</div>
</div>
</div>
@@ -39,6 +34,7 @@
</form>
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/rules/select-transactions.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
diff --git a/resources/views/search/index.blade.php b/resources/views/search/index.blade.php
index d443e1add0..792227b68d 100644
--- a/resources/views/search/index.blade.php
+++ b/resources/views/search/index.blade.php
@@ -1,81 +1,77 @@
@extends('layout.v3.session')
+@section('breadcrumbs')
+{{ Breadcrumbs::render(Route::getCurrentRoute()->getName(), $fullQuery) }}
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, fullQuery) }}
@endsection
-
@section('content')
<div class="row">
<div class="col-lg-12">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'search_box'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.search_box') }}</h3>
</div>
<div class="card-body">
<p>
- {{ 'search_box_intro'|_ }}
+ {{ __('firefly.search_box_intro') }}
</p>
{{-- search form --}}
<form class="form-horizontal" action="{{ route('search.index') }}" method="get">
<div class="form-group">
- <label for="query" class="col-sm-1 control-label">{{ 'search_query'|_ }}</label>
+ <label for="query" class="col-sm-1 control-label">{{ __('firefly.search_query') }}</label>
<div class="col-sm-10">
- <input autocomplete="off" type="text" name="search" id="query" value="{{ fullQuery }}" class="form-control" spellcheck="false"
- placeholder="{{ fullQuery }}">
+ <input autocomplete="off" type="text" name="search" id="query" value="{{ $fullQuery }}" class="form-control" spellcheck="false"
+ placeholder="{{ $fullQuery }}">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-1 col-sm-10">
- <button type="submit" class="btn btn-info"><span class="fa fa-search"></span> {{ 'search'|_ }}</button>
- {% if ruleId > 0 and ruleChanged %}
- <a href="{{ route('rules.edit', [ruleId]) }}?from_query={{ fullQuery }}"
- class="btn btn-outline-secondary">{{ trans('firefly.update_rule_from_query', {rule: rule.title}) }}</a>
+ <button type="submit" class="btn btn-info"><span class="fa fa-search"></span> {{ __('firefly.search') }}</button>
+ @if($ruleId > 0 && $ruleChanged)
+ <a href="{{ route('rules.edit', [$ruleId]) }}?from_query={{ $fullQuery }}"
+ class="btn btn-outline-secondary">{{ trans('firefly.update_rule_from_query', ['rule' => $rule->title]) }}</a>
@endif
- <a href="{{ route('rules.create') }}?from_query={{ fullQuery }}" class="btn btn-outline-secondary">{{ 'create_rule_from_query'|_ }}</a>
+ <a href="{{ route('rules.create') }}?from_query={{ $fullQuery }}" class="btn btn-outline-secondary">{{ __('firefly.create_rule_from_query') }}</a>
</div>
</div>
- {% if 0 != ruleId %}
- <input type="hidden" name="rule" value="{{ ruleId }}"/>
+ @if(0 !== $ruleId)
+ <input type="hidden" name="rule" value="{{ $ruleId }}"/>
@endif
</form>
<p>
- {{ trans('firefly.search_for_overview') |raw }}
+ {!! trans('firefly.search_for_overview') !!}
</p>
<ul>
- {% if words|length > 0 %}
+ @if(count($words) > 0)
<li>
- {{- trans('firefly.search_for_query', {
- query: words
- |map(word => '<span class="search-word">' ~ word|escape ~ '</span>')
- |join(' ')
- })|raw -}}
+ {!! trans('firefly.search_for_query',
+ [
+ 'query' => join(' ',array_map(function(string $value): string {return sprintf('<span class="search-word">%s</span>', $value);}, $words))])
+ !!}
</li>
@endif
- {% if excludedWords|length > 0 %}
+ @if(count($excludedWords) > 0)
<li>
- {{- trans('firefly.search_for_excluded_words', {
- excluded_words: excludedWords
- |map(word => '<span class="search-word">' ~ word|escape ~ '</span>')
- |join(' ')
- })|raw -}}
+ {!! trans('firefly.search_for_excluded_words',
+ [
+ 'excluded_words' => join(' ',array_map(function(string $value): string {return sprintf('<span class="search-word">%s</span>', $value);}, $excludedWords))])
+ !!}
</li>
@endif
-
- {% for operator in operators %}
- {% if operator.prohibited %}
- <li>{{- trans('firefly.search_modifier_not_'~operator.type, {value: operator.value}) -}}</li>
- @endif
- {% if not operator.prohibited %}
- <li>{{- trans('firefly.search_modifier_'~operator.type, {value: operator.value}) -}}</li>
- @endif
+ @foreach($operators as $operator)
+ @if($operator['prohibited'])
+ <li>{{ trans('firefly.search_modifier_not_' . $operator['type'], ['value' => $operator['value']]) }}</li>
+ @endif
+ @if(!$operator['prohibited'])
+ <li>{{ trans('firefly.search_modifier_' . $operator['type'], ['value' => $operator['value']]) }}</li>
+ @endif
@endforeach
</ul>
- {% if invalidOperators|length > 0 %}
+ @if(count($invalidOperators) > 0)
<p>{{ trans('firefly.invalid_operators_list') }}</p>
<ul>
- {% for operator in invalidOperators %}
- <li class="text-danger">{{ operator.type }}:{{ operator.value }}</li>
+ @foreach($invalidOperators as $operator)
+ <li class="text-danger">{{ $operator['type'] }}:{{ $operator['value'] }}</li>
@endforeach
</ul>
@endif
@@ -83,7 +79,7 @@
</div>
</div>
</div>
- {% if query|length > 0 or words|length > 0 or excludedWords|length > 0 or operators|length > 0 %}
+ @if(strlen($fullQuery) > 0 || count($words) > 0 || count($excludedWords) > 0 || count($operators) > 0)
<div class="row result_row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box search_box">
@@ -92,7 +88,7 @@
</div>
<div class="card-body">
<p class="search_ongoing text-center">
- {{ 'search_searching'|_ }}
+ {{ __('firefly.search_searching') }}
</p>
<div class="search_results hidden"></div>
{{-- loading indicator --}}
@@ -105,19 +101,19 @@
<div class="row mass_edit_all hidden-xs hidden">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
<div class="mass_button_options btn-group btn-group hidden">
- <a href="#" class="btn btn-outline-secondary mass_edit"><span class="bi bi-pencil"></span> <span>{{ 'edit_selected'|_ }}</span></a>
- <a href="#" class="btn btn-outline-secondary bulk_edit"><span>{{ 'bulk_edit'|_ }}</span></a>
+ <a href="#" class="btn btn-outline-secondary mass_edit"><span class="bi bi-pencil"></span> <span>{{ __('firefly.edit_selected') }}</span></a>
+ <a href="#" class="btn btn-outline-secondary bulk_edit"><span>{{ __('firefly.bulk_edit') }}</span></a>
<a href="#" class="btn btn-danger mass_delete"><span class="bi bi-trash"></span>
- <span>{{ 'delete_selected'|_ }}</span></a>
+ <span>{{ __('firefly.delete_selected') }}</span></a>
</div>
</div>
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 hidden-xs">
<div class="mass_buttons btn-group btn-group text-end">
<a href="#" class="btn btn-outline-secondary mass_select"><span
- class="bi bi-check-square-o"></span> {{ 'select_transactions'|_ }}</a>
+ class="bi bi-check-square-o"></span> {{ __('firefly.select_transactions') }}</a>
<a href="#" class="btn btn-outline-secondary mass_stop_select hidden"><span class="fa faw-fw fa-square-o"
- ></span> {{ 'stop_selection'|_ }}</a>
+ ></span> {{ __('firefly.stop_selection') }}</a>
</div>
</div>
</div>
@@ -129,42 +125,42 @@
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card card-danger card-outline">
<div class="card-header">
- <h3 class="card-title">{{ 'search_error'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.search_error') }}</h3>
</div>
<div class="card-body">
<p class="search_ongoing">
- {{ 'general_search_error'|_ }}
+ {{ __('firefly.general_search_error') }}
</p>
</div>
</div>
</div>
</div>
@endif
- {% if query|length == 0 and excludedWords|length == 0 and words|length == 0 and operators|length == 0 %}
+ @if(strlen($fullQuery) === 0 && count($words) === 0 && count($excludedWords) === 0 && count($operators) === 0)
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'search_results'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.search_results') }}</h3>
</div>
<div class="card-body">
- <p>{{ 'no_results_for_empty_search'|_ }}</p>
+ <p>{{ __('firefly.no_results_for_empty_search') }}</p>
</div>
</div>
</div>
-
</div>
@endif
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
- var edit_selected_txt = "{{ trans('firefly.edit')|escape('js') }}";
- var delete_selected_txt = "{{ trans('firefly.delete')|escape('js') }}";
- var edit_bulk_selected_txt = "{{ trans('firefly.bulk_edit')|escape('js') }}";
+ var edit_selected_txt = "{{ trans('firefly.edit') }}";
+ var delete_selected_txt = "{{ trans('firefly.delete') }}";
+ var edit_bulk_selected_txt = "{{ trans('firefly.bulk_edit') }}";
- var searchQuery = "{{ fullQuery|escape('js') }}";
- var searchUrl = "{{ route('search.search') }}?page={{ page }}";
- var searchPage = {{ page }};
+ var searchQuery = "{{ $fullQuery }}";
+ var searchUrl = "{{ route('search.search') }}?page={{ $page }}";
+ var searchPage = {{ $page }};
var cloneGroupUrl = '{{ route('transactions.clone') }}';
var cloneAndEditUrl = '{{ route('transactions.clone') }}?redirect=edit';
</script>
diff --git a/resources/views/search/search.blade.php b/resources/views/search/search.blade.php
index 97b5048210..2729fedd8c 100644
--- a/resources/views/search/search.blade.php
+++ b/resources/views/search/search.blade.php
@@ -1,10 +1,10 @@
<p class="search_count">
- {% if true == hasPages %}
- {{ trans('firefly.search_found_more_transactions', {count: groups.count(), time: searchTime}) }}
- {% elseif 0 == groups.count() %}
- {{ trans_choice('firefly.search_found_transactions', 0, {time: searchTime}) }}
+ @if(true === $hasPages)
+ {{ trans('firefly.search_found_more_transactions', ['count' => $groups->count(), 'time' => $searchTime]) }}
+ @elseif(0 === $groups->count())
+ {{ trans_choice('firefly.search_found_transactions', 0, ['time' => $searchTime]) }}
@else
- {{ trans_choice('firefly.search_found_transactions', groups.count(), {time: searchTime}) }}
+ {{ trans_choice('firefly.search_found_transactions', $groups->count(), ['time' => $searchTime]) }}
@endif
</p>
diff --git a/resources/views/settings/configuration/index.blade.php b/resources/views/settings/configuration/index.blade.php
index 6ebd705082..4bd854298f 100644
--- a/resources/views/settings/configuration/index.blade.php
+++ b/resources/views/settings/configuration/index.blade.php
@@ -148,3 +148,6 @@ Technical stuff
</form>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php
index 759cb46668..0b57d242cc 100644
--- a/resources/views/settings/index.blade.php
+++ b/resources/views/settings/index.blade.php
@@ -46,4 +46,6 @@
</div>
</div>
@endsection
-
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/settings/link/create.blade.php b/resources/views/settings/link/create.blade.php
index 64a47edd98..169c96ddf4 100644
--- a/resources/views/settings/link/create.blade.php
+++ b/resources/views/settings/link/create.blade.php
@@ -1,11 +1,5 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
-
<form method="POST" action="{{ route('settings.links.store') }}" accept-charset="UTF-8" class="form-horizontal">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
@@ -15,9 +9,9 @@
<h3 class="card-title">{{ __('firefly.mandatoryFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::text('name', null, {helpText: trans('firefly.link_type_help_name')}) }}
- {!! ExpandedForm::text('inward', null, {helpText: trans('firefly.link_type_help_inward')}) }}
- {!! ExpandedForm::text('outward', null, {helpText: trans('firefly.link_type_help_outward')}) }}
+ {!! ExpandedForm::text('name', null, ['helpText' => trans('firefly.link_type_help_name')]) !!}
+ {!! ExpandedForm::text('inward', null, ['helpText' => trans('firefly.link_type_help_inward')]) !!}
+ {!! ExpandedForm::text('outward', null, ['helpText' => trans('firefly.link_type_help_outward')]) !!}
</div>
</div>
</div>
@@ -30,10 +24,10 @@
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::optionsList('create','link_type') }}
+ {!! ExpandedForm::optionsList('create','link_type') !!}
</div>
<div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ 'store_new_link_type'|_ }}</button>
+ <button type="submit" class="btn text-end btn-success">{{ __('firefly.store_new_link_type') }}</button>
</div>
</div>
@@ -44,3 +38,6 @@
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/settings/link/delete.blade.php b/resources/views/settings/link/delete.blade.php
index f2f6ee8982..4d59dceab5 100644
--- a/resources/views/settings/link/delete.blade.php
+++ b/resources/views/settings/link/delete.blade.php
@@ -1,19 +1,14 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, linkType) }}
-@endsection
-
@section('content')
- <form method="POST" action="{{ route('settings.links.destroy',linkType.id) }}" accept-charset="UTF-8"
+ <form method="POST" action="{{ route('settings.links.destroy',$linkType->id) }}" accept-charset="UTF-8"
class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12">
<div class="card card-danger card-outline">
<div class="card-header">
- <h3 class="card-title">{{ trans('form.delete_link_type', {'name': linkType.name}) }}</h3>
+ <h3 class="card-title">{{ trans('form.delete_link_type', ['name' => $linkType->name]) }}</h3>
</div>
<div class="card-body">
<p class="text-danger">
@@ -21,21 +16,21 @@
</p>
<p>
- {{ trans('form.linkType_areYouSure', {'name': linkType.name,'inward': linkType.inward,'outward': linkType.outward}) }}
+ {{ trans('form.linkType_areYouSure', ['name' => $linkType->name, 'inward' => $linkType->inward, 'outward' => $linkType->outward]) }}
</p>
- {% if count > 0 %}
+ @if($count > 0)
<p>
- {{ Lang::choice('form.also_delete_connections', count, {count: count}) }}
+ {{ trans_choice('form.also_delete_connections', $count, ['count' => $count]) }}
</p>
@endif
- {% if count > 0 %}
+ @if($count > 0)
<p class="text-success">
- {{ 'save_connections_by_moving'|_ }}
+ {{ __('firefly.save_connections_by_moving') }}
</p>
<p>
- {{ Html::select('move_link_type_before_delete', moveTo).class('form-control') }}
+ {!! Html::select('move_link_type_before_delete', $moveTo)->class('form-control') !!}
</p>
@else
<input type="hidden" name="move_link_type_before_delete" value="0"/>
@@ -53,3 +48,6 @@
</form>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/settings/link/edit.blade.php b/resources/views/settings/link/edit.blade.php
index eabe633d45..9afc45d3be 100644
--- a/resources/views/settings/link/edit.blade.php
+++ b/resources/views/settings/link/edit.blade.php
@@ -1,15 +1,9 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, linkType) }}
-@endsection
-
@section('content')
-
- <form method="post" action="{{ route('settings.links.update', linkType.id) }}" class="form-horizontal"
+ <form method="post" action="{{ route('settings.links.update', $linkType->id) }}" class="form-horizontal"
accept-charset="UTF-8"
enctype="multipart/form-data">
- <input type="hidden" name="id" value="{{ linkType.id }}"/>
+ <input type="hidden" name="id" value="{{ $linkType->id }}"/>
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
@@ -18,9 +12,9 @@
<h3 class="card-title">{{ __('firefly.mandatoryFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::text('name', linkType.name, {helpText: trans('firefly.link_type_help_name')}) }}
- {!! ExpandedForm::text('inward', linkType.inward, {helpText: trans('firefly.link_type_help_inward')}) }}
- {!! ExpandedForm::text('outward', linkType.outward, {helpText: trans('firefly.link_type_help_outward')}) }}
+ {!! ExpandedForm::text('name', $linkType->name, ['helpText' => trans('firefly.link_type_help_name')]) !!}
+ {!! ExpandedForm::text('inward', $linkType->inward, ['helpText' => trans('firefly.link_type_help_inward')]) !!}
+ {!! ExpandedForm::text('outward', $linkType->outward, ['helpText' => trans('firefly.link_type_help_outward')]) !!}
</div>
</div>
</div>
@@ -34,11 +28,11 @@
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::optionsList('update','link_type') }}
+ {!! ExpandedForm::optionsList('update','link_type') !!}
</div>
<div class="card-footer">
<button type="submit" class="btn text-end btn-success">
- {{ ('update_link_type')|_ }}
+ {{ __('firefly.update_link_type') }}
</button>
</div>
</div>
@@ -50,3 +44,6 @@
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/settings/link/index.blade.php b/resources/views/settings/link/index.blade.php
index ea469e262f..72b7bf6539 100644
--- a/resources/views/settings/link/index.blade.php
+++ b/resources/views/settings/link/index.blade.php
@@ -1,14 +1,10 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render }}
-@endsection
@section('content')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="card-header">
- <h3 class="card-title">{{ 'journal_link_configuration'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.journal_link_configuration') }}</h3>
</div>
<div class="card-body p-0">
<table class="table table-hover sortable">
@@ -22,29 +18,29 @@
</tr>
</thead>
<tbody>
- {% for linkType in linkTypes %}
+ @foreach($linkTypes as $linkType)
<tr>
<td>
- {% if linkType.editable %}
+ @if($linkType->editable)
<div class="btn-group btn-group-sm">
- <a class="btn btn-outline-secondary btn-xs" href="{{ route('settings.links.edit',linkType.id) }}"><span
+ <a class="btn btn-outline-secondary btn-xs" href="{{ route('settings.links.edit',$linkType->id) }}"><span
class="bi bi-pencil"></span></a>
- <a class="btn btn-danger btn-xs" href="{{ route('settings.links.delete',linkType.id) }}"><span
+ <a class="btn btn-danger btn-xs" href="{{ route('settings.links.delete',$linkType->id) }}"><span
class="bi bi-trash"></span></a>
</div>
@endif
</td>
<td>
- <strong>{{ journalLinkTranslation('name', linkType.name) }}</strong>
+ <strong>{{ journal_link_translation('name', $linkType->name) }}</strong>
</td>
<td>
- {{ journalLinkTranslation('inward', linkType.inward) }}
+ {{ journal_link_translation('inward', $linkType->inward) }}
</td>
<td>
- {{ journalLinkTranslation('outward', linkType.outward) }}
+ {{ journal_link_translation('outward', $linkType->outward) }}
</td>
- <td data-value="{{ linkType.journalCount }}">
- <a href="{{ route('settings.links.show', [linkType.id]) }}">{{ linkType.journalCount }}</a>
+ <td data-value="{{ $linkType->journalCount }}">
+ <a href="{{ route('settings.links.show', [$linkType->id]) }}">{{ $linkType->journalCount }}</a>
</td>
</tr>
@endforeach
@@ -52,7 +48,7 @@
</table>
</div>
<div class="card-footer">
- <a href="{{ route('settings.links.create') }}" class="btn btn-success">{{ 'create_new_link_type'|_ }}</a>
+ <a href="{{ route('settings.links.create') }}" class="btn btn-success">{{ __('firefly.create_new_link_type') }}</a>
</div>
</div>
</div>
@@ -60,6 +56,7 @@
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
@endsection
diff --git a/resources/views/settings/link/show.blade.php b/resources/views/settings/link/show.blade.php
index d212491820..9a80909c7f 100644
--- a/resources/views/settings/link/show.blade.php
+++ b/resources/views/settings/link/show.blade.php
@@ -1,14 +1,10 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, linkType) }}
-@endsection
@section('content')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="card-header">
- <h3 class="card-title">{{ trans('firefly.overview_for_link', {name: journalLinkTranslation('name', linkType.name)}) }}</h3>
+ <h3 class="card-title">{{ trans('firefly.overview_for_link', ['name' => journal_link_translation('name', $linkType->name)]) }}</h3>
</div>
<div class="card-body p-0">
<table class="table table-hover sortable">
@@ -23,27 +19,27 @@
</tr>
</thead>
<tbody>
- {% for link in links %}
+ @foreach($links as $link)
<tr>
<td>
<div class="btn-group btn-group-sm">
- <a href="{{ route('transactions.link.delete', [link.id]) }}" class="btn btn-danger delete-link" data-id="{{ link.id }}"><span class="bi bi-trash"></span></a>
- <a href="#" class="btn btn-outline-secondary switch-link" data-id="{{ link.id }}"><span
- class="fa fa-arrows-h"></span></a>
+ <a href="{{ route('transactions.link.delete', [$link->id]) }}" class="btn btn-danger delete-link" data-id="{{ $link->id }}"><span class="bi bi-trash"></span></a>
+ <a href="#" class="btn btn-outline-secondary switch-link" data-id="{{ $link->id }}"><span
+ class="bi bi-arrow-left-right"></span></a>
</div>
</td>
- <td data-value="{{ link.source.description }}">
- <a href="{{ route('transactions.show', [link.source.transaction_group_id]) }}">{{ link.source.description }}</a>
+ <td data-value="{{ $link->source->description }}">
+ <a href="{{ route('transactions.show', [$link->source->transaction_group_id]) }}">{{ $link->source->description }}</a>
</td>
<td>
- {{ journalObjectAmount(link.source) }}
+ {!! journal_object_amount($link->source) !!}
</td>
- <td>{{ journalLinkTranslation('outward', linkType.outward) }}</td>
- <td data-value="{{ link.destination.description }}">
- <a href="{{ route('transactions.show', [link.destination.transaction_group_id]) }}">{{ link.destination.description }}</a>
+ <td>{{ journal_link_translation('outward', $linkType->outward) }}</td>
+ <td data-value="{{ $link->destination->description }}">
+ <a href="{{ route('transactions.show', [$link->destination->transaction_group_id]) }}">{{ $link->destination->description }}</a>
</td>
<td>
- {{ journalObjectAmount(link.destination) }}
+ {!! journal_object_amount($link->destination) !!}
</td>
</tr>
@endforeach
@@ -57,6 +53,7 @@
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
<script nonce="{{ $JS_NONCE }}">
$('.switch-link').on('click', switchLink);
@@ -82,6 +79,9 @@
</script>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
@section('styles')
<link rel="stylesheet" href="v1/css/bootstrap-sortable.css?v={{ $FF_BUILD_TIME }}" type="text/css" media="all" nonce="{{ $JS_NONCE }}">
diff --git a/resources/views/settings/notifications/index.blade.php b/resources/views/settings/notifications/index.blade.php
index 6beeec9abc..baebdb2a19 100644
--- a/resources/views/settings/notifications/index.blade.php
+++ b/resources/views/settings/notifications/index.blade.php
@@ -1,68 +1,64 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render }}
-@endsection
@section('content')
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
<form action="{{ route('settings.notification.post') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'notification_settings'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.notification_settings') }}</h3>
</div>
<div class="card-body">
<p>
{{ trans('firefly.owner_notifications_expl') }}
</p>
- {% for notification, value in notifications %}
+ @foreach($notifications as $notification => $value)
<div class="checkbox">
<label>
- <input value="1" {% if true == value %}checked@endif type="checkbox" name="notification_{{ notification }}"> {{ trans('firefly.owner_notification_check_'~notification) }}
+ <input value="1" @if(true === $value) checked @endif type="checkbox" name="notification_{{ $notification }}"> {{ trans('firefly.owner_notification_check_' . $notification) }}
</label>
</div>
@endforeach
- <p class="mt-5">{{ 'channel_settings'|_ }}</p>
- {!! ExpandedForm::text('slack_webhook_url', slackUrl, {'label' : 'slack_url_label'|_, helpText: trans('firefly.slack_discord_double')}) }}
+ <p class="mt-5">{{ __('firefly.channel_settings') }}</p>
+ {!! ExpandedForm::text('slack_webhook_url', $slackUrl, ['label' => __('firefly.slack_url_label'), 'helpText' => trans('firefly.slack_discord_double')]) !!}
- {!! ExpandedForm::text('pushover_app_token', pushoverAppToken, {}) }}
- {!! ExpandedForm::text('pushover_user_token', pushoverUserToken, {}) }}
+ {!! ExpandedForm::text('pushover_app_token', $pushoverAppToken) !!}
+ {!! ExpandedForm::text('pushover_user_token', $pushoverUserToken) !!}
- {!! ExpandedForm::text('ntfy_server', ntfyServer, {}) }}
- {!! ExpandedForm::text('ntfy_topic', ntfyTopic, {}) }}
- {!! ExpandedForm::checkbox('ntfy_auth','1', ntfyAuth, {}) }}
- {!! ExpandedForm::text('ntfy_user', ntfyUser, {}) }}
- {!! ExpandedForm.passwordWithValue('ntfy_pass', ntfyPass, {}) }}
+ {!! ExpandedForm::text('ntfy_server', $ntfyServer) !!}
+ {!! ExpandedForm::text('ntfy_topic', $ntfyTopic) !!}
+ {!! ExpandedForm::checkbox('ntfy_auth','1', $ntfyAuth) !!}
+ {!! ExpandedForm::text('ntfy_user', $ntfyUser) !!}
+ {!! ExpandedForm::passwordWithValue('ntfy_pass', $ntfyPass) !!}
</div>
<div class="card-footer">
<button type="submit" class="btn btn-success">
- <span class="bi bi-check-circle"></span> {{ ('save_notification_settings')|_ }}
+ <span class="bi bi-check-circle"></span> {{ __('firefly.save_notification_settings') }}
</button>
</div>
</div>
</form>
</div>
- <form action="{{ route('settings.notification.test') }}" method="post">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
+ <form action="{{ route('settings.notification.test') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'available_channels_title'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.available_channels_title') }}</h3>
</div>
<div class="card-body">
<p>
- {{ 'available_channels_expl'|_ }}
+ {{ __('firefly.available_channels_expl') }}
</p>
<ul>
- {% for name,info in channels %}
+ @foreach($channels as $name => $info)
<li>
- {% if true == info.enabled and true == forcedAvailability[name] %}
- ☑️ {{ trans('firefly.notification_channel_name_'~name) }}
- {% if 0 == info.ui_configurable %}({{ 'configure_channel_in_env'|_ }}) @endif
+ @if(true === $info['enabled'] && true === $forcedAvailability[$name])
+ ☑️ {{ trans('firefly.notification_channel_name_' . $name) }}
+ @if(0 === $info['ui_configurable'])({{ __('firefly.configure_channel_in_env') }}) @endif
@endif
- {% if false == info.enabled or false == forcedAvailability[name] %}
- ⚠️ {{ trans('firefly.notification_channel_name_'~name) }} ({{ 'channel_not_available'|_ }})
+ @if(false === $info['enabled'] or false === $forcedAvailability[$name])
+ ⚠️ {{ trans('firefly.notification_channel_name_' . $name) }} ({{ __('firefly.channel_not_available') }})
@endif
</li>
@endforeach
@@ -70,18 +66,21 @@
</div>
<div class="card-footer">
<div class="btn-group">
- {% for name,info in channels %}
- {% if true == info.enabled and true == forcedAvailability[name] %}
- <button type="submit" name="test_submit" value="{{ name }}" class="btn btn-outline-secondary">
- {{ trans('firefly.test_notification_channel_name_'~name) }}
+ @foreach($channels as $name => $info)
+ @if(true === $info['enabled'] && true === $forcedAvailability[$name])
+ <button type="submit" name="test_submit" value="{{ $name }}" class="btn btn-outline-secondary">
+ {{ trans('firefly.test_notification_channel_name_'.$name) }}
</button>
@endif
@endforeach
</div>
</div>
</div>
+ </form>
</div>
- </form>
</div>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/settings/update/index.blade.php b/resources/views/settings/update/index.blade.php
index b15b54d4c4..df87804f8f 100644
--- a/resources/views/settings/update/index.blade.php
+++ b/resources/views/settings/update/index.blade.php
@@ -1,8 +1,4 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render }}
-@endsection
@section('content')
<form action="{{ route('settings.update-check.post') }}" method="post" id="store" class="form-horizontal">
@@ -11,46 +7,46 @@
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'admin_update_channel_title'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.admin_update_channel_title') }}</h3>
</div>
<div class="card-body">
<p class="text-info">
- {{ 'admin_update_channel_explain'|_ }}
+ {{ __('firefly.admin_update_channel_explain') }}
</p>
- {!! ExpandedForm::select('update_channel', channelOptions, channelSelected) }}
+ {!! ExpandedForm::select('update_channel', $channelOptions, $channelSelected) !!}
</div>
</div>
</div>
{{-- do update check. --}}
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'admin_update_check_title'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.admin_update_check_title') }}</h3>
</div>
<div class="card-body">
<p class="text-info">
- {{ 'admin_update_check_explain'|_ }}
+ {{ __('firefly.admin_update_check_explain') }}
</p>
- {!! ExpandedForm::select('check_for_updates',options, selected) }}
+ {!! ExpandedForm::select('check_for_updates',$options, $selected) !!}
</div>
</div>
</div>
{{-- check now button --}}
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
- <div class="card">
+ <div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'admin_update_check_now_title'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.admin_update_check_now_title') }}</h3>
</div>
<div class="card-body">
<p class="text-info">
- {{ 'admin_update_check_now_explain'|_ }}
+ {{ __('firefly.admin_update_check_now_explain') }}
</p>
<p>
- <a href="{{ route('settings.update-check.manual') }}" class="btn btn-info">{{ 'check_for_updates_button'|_ }}</a>
+ <a href="{{ route('settings.update-check.manual') }}" class="btn btn-info">{{ _('firefly.check_for_updates_button') }}</a>
</p>
</div>
</div>
@@ -59,7 +55,7 @@
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-success">
- {{ ('store_configuration')|_ }}
+ {{ __('firefly.store_configuration') }}
</button>
</div>
</div>
@@ -68,6 +64,7 @@
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
var updateCheckUrl = '{{ route('settings.update-check.manual') }}';
</script>