mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-10 23:17:53 +00:00
add torrent contributors info #11
This commit is contained in:
parent
3a7a87a89e
commit
997d9db562
@ -51,13 +51,41 @@ class TorrentController extends AbstractController
|
|||||||
throw $this->createNotFoundException();
|
throw $this->createNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get contributors
|
||||||
|
$contributors = [];
|
||||||
|
|
||||||
|
$contributors[$torrent->getUserId()] = $userService->identicon(
|
||||||
|
$userService->get(
|
||||||
|
$torrent->getUserId()
|
||||||
|
)->getAddress()
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($torrentLocales = $torrentService->findLastTorrentLocalesByTorrentId($torrent->getId()))
|
||||||
|
{
|
||||||
|
$contributors[$torrentLocales->getUserId()] = $userService->identicon(
|
||||||
|
$userService->get(
|
||||||
|
$torrentLocales->getUserId()
|
||||||
|
)->getAddress()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($torrentSensitive = $torrentService->findLastTorrentSensitiveByTorrentId($torrent->getId()))
|
||||||
|
{
|
||||||
|
$contributors[$torrentSensitive->getUserId()] = $userService->identicon(
|
||||||
|
$userService->get(
|
||||||
|
$torrentSensitive->getUserId()
|
||||||
|
)->getAddress()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Render template
|
// Render template
|
||||||
return $this->render('default/torrent/info.html.twig', [
|
return $this->render('default/torrent/info.html.twig', [
|
||||||
'torrent' =>
|
'torrent' =>
|
||||||
[
|
[
|
||||||
'id' => $torrent->getId(),
|
'id' => $torrent->getId(),
|
||||||
'added' => $torrent->getAdded(),
|
'added' => $torrent->getAdded(),
|
||||||
'user' =>
|
/*
|
||||||
|
'user' =>
|
||||||
[
|
[
|
||||||
'id' => $torrent->getUserId(),
|
'id' => $torrent->getUserId(),
|
||||||
'identicon' => $userService->identicon(
|
'identicon' => $userService->identicon(
|
||||||
@ -66,6 +94,7 @@ class TorrentController extends AbstractController
|
|||||||
)->getAddress()
|
)->getAddress()
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
*/
|
||||||
'scrape' =>
|
'scrape' =>
|
||||||
[
|
[
|
||||||
'seeders' => (int) $torrent->getSeeders(),
|
'seeders' => (int) $torrent->getSeeders(),
|
||||||
@ -107,7 +136,8 @@ class TorrentController extends AbstractController
|
|||||||
$torrent->getId()
|
$torrent->getId()
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
'pages' => []
|
'pages' => [],
|
||||||
|
'contributors' => $contributors
|
||||||
],
|
],
|
||||||
'file' =>
|
'file' =>
|
||||||
[
|
[
|
||||||
|
@ -179,12 +179,14 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{ 'Publisher'|trans }}
|
{{ 'Contributors'|trans }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('user_info', { id : torrent.user.id }) }}">
|
{% for id, identicon in torrent.contributors %}
|
||||||
<img class="border-radius-50 border-color-default vertical-align-middle" src="{{ torrent.user.identicon }}" alt="{{'identicon'|trans }}" />
|
<a href="{{ path('user_info', { id : id }) }}">
|
||||||
</a>
|
<img class="border-radius-50 border-color-default vertical-align-middle" src="{{ identicon }}" alt="{{'identicon'|trans }}" />
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -236,7 +238,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-y-8-px border-bottom-default text-right">
|
<div class="padding-y-8-px border-bottom-default text-right">
|
||||||
|
Loading…
Reference in New Issue
Block a user