1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 13:49:59 +00:00

Show first level's items based on amount

Currently set to show when list has 20 items or less
This commit is contained in:
Kfir Hadas 2017-05-25 15:16:29 +03:00
parent e0ffadb08c
commit ae4d75ecde
2 changed files with 8 additions and 1 deletions

View file

@ -295,13 +295,20 @@ a.text-purple:hover, a.text-purple:active, a.text-purple:focus { color: #a760e0;
.torrent-file-list ul {
padding: 5px 20px 0px 20px;
list-style: none;
display: none;
}
.torrent-file-list > ul {
display: block; /* First level always visible */
padding: 0;
margin: 0;
}
.torrent-file-list ul[data-show] {
/* Used to show first level's items based on amount */
display: block;
}
.torrent-file-list li:not(:last-of-type) {
margin-bottom: 5px;
}

View file

@ -98,7 +98,7 @@
{% if value is iterable %}
<li>
<a href="" class="folder"><i class="fa fa-folder-open"></i>{{ key }}</a>
<ul>{{ '\n' + loop(value.items()) }}
<ul{% if not loop.depth0 and value.items()|length <= 20 %} data-show="yes"{% endif %}>{{ '\n' + loop(value.items()) }}
</ul>
</li>
{% else %}