Skip to content

Firefly III: a personal finances manager

Can have link in success message to the transaction it refers to

David Meiselesd30da7bf5d97
diff --git a/app/Http/Controllers/Transaction/SingleController.php b/app/Http/Controllers/Transaction/SingleController.php
index 6b2f5f934e..53d8214769 100644
--- a/app/Http/Controllers/Transaction/SingleController.php
+++ b/app/Http/Controllers/Transaction/SingleController.php
@@ -369,7 +369,7 @@ class SingleController extends Controller
event(new StoredTransactionJournal($journal, $data['piggy_bank_id']));
- session()->flash('success', (string)trans('firefly.stored_journal', ['description' => $journal->description]));
+ session()->flash('success_uri', (string)trans('firefly.stored_journal', ['description' => "<a href='/transactions/show/{$journal->id}'>{$journal->description}</a>"]));
app('preferences')->mark();
// @codeCoverageIgnoreStart
diff --git a/resources/views/partials/flashes.twig b/resources/views/partials/flashes.twig
index 77c03557fe..332e469850 100644
--- a/resources/views/partials/flashes.twig
+++ b/resources/views/partials/flashes.twig
@@ -18,6 +18,16 @@
</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 }}
+ </div>
+{% endif %}
+
{# INFO MESSAGE (CAN BE MULTIPLE) #}
{% if session_has('info') %}
<div class="alert alert-info alert-dismissible" role="alert">