file_list.html
2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{% extends 'website/baseline.html' %}
{% block content %}
<style type="text/css">
</style>
<center>
<div>
<form method="post", enctype="multipart/form-data", action="{% url 'file_upload' path=path %}" >
{% csrf_token %}
<div style="border: solid; display:inline-block; padding: 5px; border-color: skyblue" >
<input type="file" name="file">
</div>
<button style="margin-top: 10px" class="ui primary button" type="submit"><i class="upload icon"></i>업로드</button>
</form>
</div>
</center>
<button class="ui primary button" style="margin-left: 28%" type="submit" onclick="make_folder()"><i class="plus icon"></i>폴더 만들기</button>
<br>
<center>
<table style="margin-top: 7px" class="ui celled striped collapsing table">
<thead>
<tr><th class="twelve wide">/{{ path }}</th>
<th>복사</th>
<th >이동</th>
<th>삭제</th>
<th >다운로드</th>
</tr></thead>
<tbody>
{% for file in files %}
<tr>
<td class="collapsing">
{% if file.type == "directory" %}
{% with new_path=path|add:file.name|add:'/' %}
<a href="{% url 'file_list' path=new_path %}"><i class="folder icon"></i> {{file.name}}</a>
{% endwith %}
{% else %}
<i class="file outline icon"></i> {{file.name}}
{% endif %}
</td>
<td class="center aligned collapsing"><i onclick="make_folder()" style="cursor: pointer;" class="copy outline icon"></i></td>
<td class="center aligned collapsing"><i onclick="make_folder()" style="cursor: pointer;" class="sign out alternate icon"></i></td>
<td class="center aligned collapsing"><i onclick="make_folder()" style="cursor: pointer;" class="trash alternate outline icon"></i></td>
<td class="center aligned collapsing"><i onclick="make_folder()" style="cursor: pointer;" class="download icon"></i></td>
</tr>
{% endfor %}
</tbody>
</table>
</center>
<script type="text/javascript">
function uploadChange(file) {
var el = file.parentNode.parentNode.getElementsByTagName("*");
for (var i = 0; i < el.length; i++) {
var node = el[i];
if (node.className == "file-text") {
node.innerHTML = file.value;
break;
}
}
}
function make_folder(){
location.href = "/make_folder/";
}
function copy(){
}
function move(){
}
function delete(){
}
function download(){
}
</script>
{% endblock %}