Add download button for each file
- This commit also introduces some CSS to place the buttons/forms next to each other
This commit is contained in:
parent
f3813777b7
commit
de96175c18
@ -0,0 +1,23 @@
|
||||
/* necessary to place both forms/buttons next to each other */
|
||||
li.file {
|
||||
clear: both;
|
||||
list-style-position: outside;
|
||||
}
|
||||
|
||||
/* necessary to place both forms/buttons next to each other */
|
||||
form.file {
|
||||
/* Float both forms to the left */
|
||||
float: left;
|
||||
}
|
||||
|
||||
form.file.file_add {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
/* necessary to place both forms/buttons next to each other */
|
||||
form.file.file_download {
|
||||
clear: right;
|
||||
/* with some space to the left of the second form */
|
||||
margin-right: 20px;
|
||||
}
|
@ -14,8 +14,17 @@
|
||||
{%- set files = music_library.get_files(subdirpath) %}
|
||||
{%- if files %}
|
||||
{% for file in files %}
|
||||
<!--<li>{{ file }}</li>-->
|
||||
<li><form method="post"><input type="text" value="{{ subdirpath }}/{{ file }}" name="add_file" hidden><input type="submit" value="Add"> {{ file }}</form></li>
|
||||
<li class="file">
|
||||
<form method="post" class="file file_add">
|
||||
<input type="text" value="{{ subdirpath }}/{{ file }}" name="add_file" hidden>
|
||||
<input type="submit" value="Add">
|
||||
</form>
|
||||
<form action="./download" method="get" class="file file_download">
|
||||
<input type="text" value="{{ subdirpath }}/{{ file }}" name="file" hidden>
|
||||
<input type="submit" value="Download">
|
||||
{{ file }}
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{%- endif %}
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user