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 { .torrent-file-list ul {
padding: 5px 20px 0px 20px; padding: 5px 20px 0px 20px;
list-style: none; list-style: none;
display: none;
} }
.torrent-file-list > ul { .torrent-file-list > ul {
display: block; /* First level always visible */
padding: 0; padding: 0;
margin: 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) { .torrent-file-list li:not(:last-of-type) {
margin-bottom: 5px; margin-bottom: 5px;
} }

View File

@ -98,7 +98,7 @@
{% if value is iterable %} {% if value is iterable %}
<li> <li>
<a href="" class="folder"><i class="fa fa-folder-open"></i>{{ key }}</a> <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> </ul>
</li> </li>
{% else %} {% else %}