diff --git a/nyaa/static/css/main.css b/nyaa/static/css/main.css index 58226d2..7be8108 100755 --- a/nyaa/static/css/main.css +++ b/nyaa/static/css/main.css @@ -286,3 +286,46 @@ a.text-purple:hover, a.text-purple:active, a.text-purple:focus { color: #a760e0; margin: 0 auto; text-align: center; } + +/* Torrent file list */ +.torrent-file-list { + padding: 15px; +} + +.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; +} + +.torrent-file-list i.fa { + padding-right: 5px; +} + +.torrent-file-list i.fa-folder-open { + padding-right: 3px; +} + +.torrent-file-list a.folder { + font-weight: bold; + text-decoration: none; +} + +.torrent-file-list .file-size { + font-weight: bold; +} diff --git a/nyaa/static/js/main.js b/nyaa/static/js/main.js index 01e7067..f57110c 100644 --- a/nyaa/static/js/main.js +++ b/nyaa/static/js/main.js @@ -43,6 +43,7 @@ $(document).ready(function() { } }); + // Drag & Drop zone for upload page $('body').on('dragenter', function(event) { event.preventDefault(); dropZone.css({ 'visibility': 'visible', 'opacity': 1 }); @@ -63,6 +64,13 @@ $(document).ready(function() { $('#torrent_file')[0].files = files; $(this).css({ 'visibility': 'hidden', 'opacity': 0 }); }); + + // Collapsible file lists + $('.torrent-file-list a.folder').click(function(e) { + e.preventDefault(); + $(this).blur().children('i').toggleClass('fa-folder-open fa-folder'); + $(this).next().stop().slideToggle(250); + }); }); function _format_time_difference(seconds) { diff --git a/nyaa/templates/layout.html b/nyaa/templates/layout.html index 6abf32b..659bb46 100755 --- a/nyaa/templates/layout.html +++ b/nyaa/templates/layout.html @@ -28,7 +28,7 @@ - + @@ -36,7 +36,7 @@ - +