implement approved/sensitive access behavior

This commit is contained in:
ghost 2023-10-13 18:28:27 +03:00
parent 130add0904
commit 60a5593446
22 changed files with 681 additions and 122 deletions

View file

@ -14,9 +14,24 @@
#{{ torrent.locales.id }}
{% endif %}
{{ 'for torrent' | trans }}
<a href="{{ path('torrent_info', { torrentId : torrent.id }) }}">
{{ torrent.name }}
</a>
{% if session.user.moderator or session.user.owner %}
<a href="{{ path('torrent_info', { torrentId : torrent.id }) }}">
{{ torrent.name }}
</a>
{% if torrent.approved == false %}
#{{ torrent.id }} ({{ 'waiting for approve' | trans }})
{% endif %}
{% else %}
{% if torrent.approved == false %}
#{{ torrent.id }} ({{ 'waiting for approve' | trans }})
{% elseif torrent.sensitive == true %}
#{{ torrent.id }} ({{ 'sensitive' | trans }})
{% else %}
<a href="{{ path('torrent_info', { torrentId : torrent.id }) }}">
{{ torrent.name }}
</a>
{% endif %}
{% endif %}
</div>
<div class="column width-20 text-right">
{{ added | format_ago }}