-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.html
115 lines (80 loc) · 3.22 KB
/
main.html
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{% extends 'template.html' %}
{% block main %}
{% if user %}
<h2 id="welcome">Hello {{ user.email() }}!</h2>
<p><b>Current working directory:</b></p>
<p id="cwd">
{% for dir in path %}
<a class="path" href="/dir{{dir['url']}}">{{dir['name']}}</a>
{% if not loop.index == path|length %}
<strong>►</strong>
{% endif %}
{% endfor %}
</p>
{% if error %}
<p class="error">{{error}}</p>
{% elif success %}
<p class="success">Directory created successfully</p>
{% endif %}
<form style="padding: 0; margin: 0; background: none" method="post" action= "/dir{{ cur_dir }}">
<p id="menu">
{% if not cwd.is_root_dir() %}
<a href="/dir{{ path[path|length - 2].url }}" title="go up one level">../</a>
{% endif %}
<a href="/properties{{cur_dir}}">Properties</a>
<input type="submit" value="Delete Selected Items" name="button" />
<span style="float: right;">
<select name="destination">
<option value="r">Select destination folder</option>
{% for d in all_dirs %}
<option value="{{d}}">{{d}}</option>
{% endfor %}
</select><input type="submit" value="Move Selected Items" name="button" />
</span>
</p>
<ul id="content">
{% for dir in cwd.folders %}
<li class="list">
<input class="check" name="folders" value="{{dir}}" type="checkbox" id="{{loop.index}}-folder" />
<label class="label" for="{{loop.index}}-folder"></label>
<div class="file">
<a href="/dir{{ cur_dir }}{{ dir }}/" title="go into folder">
<img alt="" src="/css/folder.png">
<span>{{ dir }}</span>
</a>
</div>
</li>
{% endfor %}
{% for file in files %}
<li class="list">
<input class="check" name="files" value="{{loop.index-1}}" type="checkbox" id="{{loop.index}}-file" />
<label class="label" for="{{loop.index}}-file"></label>
<div class="file">
<a href="/download/{{ cwd.key.id() }}{{ cwd.files.index(file) }}" title="download">
<img alt="" src="/css/file.png">
<span>{{ file.name }}</span>
</a>
</div>
</li>
{% endfor %}
</ul>
</form>
{% else %}
<h3>The secure file storage solution that employees and IT admins trust.</h3>
<p id="smallBig">Login to access the application.</p>
{% endif %}
{% endblock %}
{% block left %}
{% if user %}
<h2>Content</h2>
<form method="post" action= "/dir{{ cur_dir }}">
<p>New folder</p>
<input required id="name" placeholder="folder name" type="text" name="name" /><input type="submit" value="Create" name="button" />
</form>
<form method="post" action="{{ upload_url }}" enctype="multipart/form-data">
<p>Upload file(s)</p>
<input type="hidden" name="dir" value="{{ cwd.key.id() }}"/>
<input required id="files" type="file" name="file" multiple /><input type="submit" value="Upload" name="button" />
</form>
{% endif %}
{% endblock %}