Skip to content

Commit

Permalink
Add download buttons to subdirectory entries
Browse files Browse the repository at this point in the history
  • Loading branch information
BafDyce committed May 20, 2018
1 parent de96175 commit 74ae51f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
30 changes: 30 additions & 0 deletions static/index.css
Expand Up @@ -21,3 +21,33 @@ form.file.file_download {
/* with some space to the left of the second form */
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;
}
17 changes: 15 additions & 2 deletions templates/index.html
Expand Up @@ -2,8 +2,21 @@
<ul>
{% for subdirname in music_library.get_subdirs(path) %}
{%- 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>
<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>
<li class="directory">
<span>{{ subdirname }}/&nbsp;</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) %}
{%- if subdirs %}
{%- for subdir in subdirs %}
Expand Down

0 comments on commit 74ae51f

Please sign in to comment.