mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-27 11:31:05 +00:00
parent
9b57bac8b9
commit
12c697562e
3 changed files with 14 additions and 2 deletions
|
@ -117,4 +117,16 @@ class Tag
|
|||
{
|
||||
return $this->entries;
|
||||
}
|
||||
|
||||
public function getEntriesByUser($userId)
|
||||
{
|
||||
$filteredEntries = new ArrayCollection();
|
||||
foreach ($this->entries as $entry) {
|
||||
if ($entry->getUser()->getId() === $userId) {
|
||||
$filteredEntries->add($entry);
|
||||
}
|
||||
}
|
||||
|
||||
return $filteredEntries;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<ul>
|
||||
{% for tag in tags %}
|
||||
<li id="tag-{{ tag.id|e }}">{{tag.label}} ({{ tag.entries.getValues | length }})</li>
|
||||
<li id="tag-{{ tag.id|e }}">{{tag.label}} ({{ tag.getEntriesByUser(app.user.id) | length }})</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<br />
|
||||
<ul class="row data">
|
||||
{% for tag in tags %}
|
||||
<li id="tag-{{ tag.id|e }}" class="col l4 m6 s12">{{tag.label}} ({{ tag.entries.getValues | length }})</li>
|
||||
<li id="tag-{{ tag.id|e }}" class="col l4 m6 s12">{{tag.label}} ({{ tag.getEntriesByUser(app.user.id) | length }})</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue