Add download buttons to subdirectory entries
This commit is contained in:
		@@ -21,3 +21,33 @@ form.file.file_download {
 | 
				
			|||||||
    /* with some space to the left of the second form */
 | 
					    /* with some space to the left of the second form */
 | 
				
			||||||
    margin-right: 20px;
 | 
					    margin-right: 20px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* necessary to place all forms/buttons of the directory entries next to each other */
 | 
				
			||||||
 | 
					li.directory {
 | 
				
			||||||
 | 
					    clear: both;
 | 
				
			||||||
 | 
					    list-style-position: outside;
 | 
				
			||||||
 | 
					    margin-top: 15px;
 | 
				
			||||||
 | 
					    margin-bottom: 15px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					li.directory span {
 | 
				
			||||||
 | 
					    float: left;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					form.directory {
 | 
				
			||||||
 | 
					    float: left;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					form.directory.form1 {
 | 
				
			||||||
 | 
					    margin-left: 5px;
 | 
				
			||||||
 | 
					    margin-right: 5px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					form.directory.form2 {
 | 
				
			||||||
 | 
					    margin-right: 5px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					form.directory.form3 {
 | 
				
			||||||
 | 
					    clear: right;
 | 
				
			||||||
 | 
					    margin-right: 5px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,8 +2,21 @@
 | 
				
			|||||||
    <ul>
 | 
					    <ul>
 | 
				
			||||||
    {% for subdirname in music_library.get_subdirs(path) %}
 | 
					    {% for subdirname in music_library.get_subdirs(path) %}
 | 
				
			||||||
        {%- set subdirpath = path + subdirname + '/' %}
 | 
					        {%- set subdirpath = path + subdirname + '/' %}
 | 
				
			||||||
        <li>{{ subdirname }}/ <form method="post"><input type="text" value="{{ subdirpath }}" name="add_folder" hidden><input type="submit" value="Add all tracks from this folder"></form>
 | 
					        <li class="directory">
 | 
				
			||||||
            <form method="post"><input type="text" value="{{ subdirpath }}" name="add_folder_recursively" hidden><input type="submit" value="Add all tracks from this folder (recursively)"></form></li>
 | 
					            <span>{{ subdirname }}/ </span>
 | 
				
			||||||
 | 
					            <form method="post" class="directory form1">
 | 
				
			||||||
 | 
					                <input type="text" value="{{ subdirpath }}" name="add_folder" hidden>
 | 
				
			||||||
 | 
					                <input type="submit" value="Add all tracks from this folder">
 | 
				
			||||||
 | 
					            </form>
 | 
				
			||||||
 | 
					            <form method="post" class="directory form2">
 | 
				
			||||||
 | 
					                <input type="text" value="{{ subdirpath }}" name="add_folder_recursively" hidden>
 | 
				
			||||||
 | 
					                <input type="submit" value="Add all tracks from this folder (recursively)">
 | 
				
			||||||
 | 
					            </form>
 | 
				
			||||||
 | 
					            <form action="./download" method="get" class="directory form3">
 | 
				
			||||||
 | 
					                <input type="text" value="{{ subdirpath }}" name="directory" hidden>
 | 
				
			||||||
 | 
					                <input type="submit" value="Download entire directory">
 | 
				
			||||||
 | 
					            </form>
 | 
				
			||||||
 | 
					        </li>
 | 
				
			||||||
        {%- set subdirs = music_library.get_subdirs(subdirpath) %}
 | 
					        {%- set subdirs = music_library.get_subdirs(subdirpath) %}
 | 
				
			||||||
        {%- if subdirs %}
 | 
					        {%- if subdirs %}
 | 
				
			||||||
            {%- for subdir in subdirs %}
 | 
					            {%- for subdir in subdirs %}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user