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

@ -3,7 +3,7 @@
{% block main_content %}
{% if torrents %}
{% for torrent in torrents %}
<div class="padding-24-px margin-y-8-px border-radius-3-px background-color-night">
<div class="padding-24-px margin-y-8-px border-radius-3-px background-color-night{% if torrent.sensitive == true or torrent.approved == false %} opacity-06{% endif %}">
<a name="{{ torrent.id }}"></a>
<div class="margin-b-16-px">
<h2>
@ -12,11 +12,25 @@
</a>
</h2>
{% if torrent.scrape.leechers == 0 and torrent.scrape.leechers == 0 %}
<span class="label label-green margin-x-4-px font-size-10-px position-relative top--2 cursor-default"
<span class="label label-green margin-l-4-px font-size-10-px position-relative top--2 cursor-default"
title="{{ 'Active leechers waiting for seeders' | trans }}">
{{ 'wanted' | trans }}
</span>
{% endif %}
{% if torrent.approved == false %}
<sub class="margin-l-8-px float-right" title="{{ 'Waiting for approve' | trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
<path d="M2 1.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-1v1a4.5 4.5 0 0 1-2.557 4.06c-.29.139-.443.377-.443.59v.7c0 .213.154.451.443.59A4.5 4.5 0 0 1 12.5 13v1h1a.5.5 0 0 1 0 1h-11a.5.5 0 1 1 0-1h1v-1a4.5 4.5 0 0 1 2.557-4.06c.29-.139.443-.377.443-.59v-.7c0-.213-.154-.451-.443-.59A4.5 4.5 0 0 1 3.5 3V2h-1a.5.5 0 0 1-.5-.5zm2.5.5v1a3.5 3.5 0 0 0 1.989 3.158c.533.256 1.011.791 1.011 1.491v.702c0 .7-.478 1.235-1.011 1.491A3.5 3.5 0 0 0 4.5 13v1h7v-1a3.5 3.5 0 0 0-1.989-3.158C8.978 9.586 8.5 9.052 8.5 8.351v-.702c0-.7.478-1.235 1.011-1.491A3.5 3.5 0 0 0 11.5 3V2h-7z"/>
</svg>
</sub>
{% endif %}
{% if torrent.sensitive == true %}
<sub class="margin-l-8-px float-right" title="{{ 'Content visible for non sensitive users only' | trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
<path d="m9.97 4.88.953 3.811C10.159 8.878 9.14 9 8 9c-1.14 0-2.158-.122-2.923-.309L6.03 4.88C6.635 4.957 7.3 5 8 5s1.365-.043 1.97-.12zm-.245-.978L8.97.88C8.718-.13 7.282-.13 7.03.88L6.275 3.9C6.8 3.965 7.382 4 8 4c.618 0 1.2-.036 1.725-.098zm4.396 8.613a.5.5 0 0 1 .037.96l-6 2a.5.5 0 0 1-.316 0l-6-2a.5.5 0 0 1 .037-.96l2.391-.598.565-2.257c.862.212 1.964.339 3.165.339s2.303-.127 3.165-.339l.565 2.257 2.391.598z"/>
</svg>
</sub>
{% endif %}
</div>
{% if torrent.keywords %}
<div class="margin-b-16-px">