Skip to content

Firefly III: a personal finances manager

DRYed out

David Meiselesa1896a63368b
diff --git a/app/Http/Controllers/Transaction/SingleController.php b/app/Http/Controllers/Transaction/SingleController.php
index 53d8214769..71f4a1df21 100644
--- a/app/Http/Controllers/Transaction/SingleController.php
+++ b/app/Http/Controllers/Transaction/SingleController.php
@@ -369,7 +369,8 @@ class SingleController extends Controller
event(new StoredTransactionJournal($journal, $data['piggy_bank_id']));
- session()->flash('success_uri', (string)trans('firefly.stored_journal', ['description' => "<a href='/transactions/show/{$journal->id}'>{$journal->description}</a>"]));
+ session()->flash('success_uri', route('transactions.show', [$journal->id]));
+ session()->flash('success', (string)trans('firefly.stored_journal', ['description' => $journal->description]));
app('preferences')->mark();
// @codeCoverageIgnoreStart
diff --git a/resources/views/partials/flashes.twig b/resources/views/partials/flashes.twig
index 332e469850..4436d6baf6 100644
--- a/resources/views/partials/flashes.twig
+++ b/resources/views/partials/flashes.twig
@@ -14,17 +14,17 @@
<button type="button" class="close" data-dismiss="alert">
<span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
+
+ {% if session_has('success_uri') %}
+ <a href="{{ session('success_uri') }}">
+ {% endif %}
+
<strong>{{ 'flash_success'|_ }}</strong> {{ session('success') }}
- </div>
-{% endif %}
-{# SUCCESS MESSAGE WITH URL (ALWAYS SINGULAR) #}
-{% if session_has('success_uri') %}
- <div class="alert alert-success alert-dismissible" role="alert">
- <button type="button" class="close" data-dismiss="alert">
- <span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
- </button>
- <strong>{{ 'flash_success'|_ }}</strong> {{ session('success_uri') | striptags('<a>') | raw }}
+ {% if session_has('success_uri') %}
+ </a>
+ {% endif %}
+
</div>
{% endif %}