mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Better link for tags.
This commit is contained in:
@@ -108,6 +108,7 @@ class ShowController extends Controller
|
||||
if (!Str::contains($transaction['notes'], $search)) {
|
||||
$groupArray['transactions'][$index]['notes'] = e($transaction['notes']);
|
||||
}
|
||||
$groupArray['transactions'][$index]['tags'] = $this->repository->getTagObjects($groupArray['transactions'][$index]['transaction_journal_id']);
|
||||
}
|
||||
|
||||
$events = $this->repository->getPiggyEvents($transactionGroup);
|
||||
|
@@ -45,6 +45,7 @@ use FireflyIII\Services\Internal\Update\GroupUpdateService;
|
||||
use FireflyIII\Support\NullArrayObject;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
@@ -468,4 +469,15 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getTagObjects(int $journalId): Collection
|
||||
{
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->user->transactionJournals()->find($journalId);
|
||||
|
||||
return $journal->tags()->get();
|
||||
}
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Support\NullArrayObject;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Interface TransactionGroupRepositoryInterface
|
||||
@@ -122,6 +123,15 @@ interface TransactionGroupRepositoryInterface
|
||||
*/
|
||||
public function getTags(int $journalId): array;
|
||||
|
||||
/**
|
||||
* Get the tags for a journal (by ID) as Tag objects.
|
||||
*
|
||||
* @param int $journalId
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getTagObjects(int $journalId): Collection;
|
||||
|
||||
/**
|
||||
* Set the user.
|
||||
*
|
||||
|
@@ -260,8 +260,8 @@
|
||||
<td>{{ 'tags'|_ }}</td>
|
||||
<td>
|
||||
{% for tag in journal.tags %}
|
||||
<h4 style="display: inline;"><a class="label label-success" href="{{ route('tags.show', tag) }}">
|
||||
<i class="fa fa-fw fa-tag"></i>{{ tag }}</a>
|
||||
<h4 style="display: inline;"><a class="label label-success" href="{{ route('tags.show', tag.id) }}">
|
||||
<i class="fa fa-fw fa-tag"></i>{{ tag.tag }}</a>
|
||||
</h4>
|
||||
{% endfor %}
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user