-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared_main.html
154 lines (102 loc) · 3.93 KB
/
shared_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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{% 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="/shared/{{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 %}
{% if writable %}
<form style="padding: 0; margin: 0; background: none" method="post" action= "/shared{{ cur_dir }}">
<p id="menu">
{% if path|length > 1 %}
<a href="/shared/{{ path[path|length - 2].url }}" title="go up one level">../</a>
{% endif %}
<input type="submit" value="Delete Selected Items" name="button" />
<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" />
</p>
{% else %}
<p id="menu">
{% if path|length > 1 %}
<a href="/shared/{{ path[path|length - 2].url }}" title="go up one level">../</a>
{% endif %}
</p>
{% endif %}
<ul id="content">
{% for dir in cwd.folders %}
{% if not locks[loop.index-1] %}
<li class="list">
{% if writable %}
<input class="check" name="folders" value="{{dir}}" type="checkbox" id="{{loop.index}}-folder" />
<label class="label" for="{{loop.index}}-folder"></label>
{% endif %}
<div class="file">
<a href="{{ dir }}/" title="go into folder">
<img alt="" src="/css/folder.png">
<span>{{ dir }}</span>
</a>
</div>
</li>
{% endif %}
{% endfor %}
{% for file in files %}
<li class="list">
{% if writable %}
<input class="check" name="files" value="{{loop.index-1}}" type="checkbox" id="{{loop.index}}-file" />
<label class="label" for="{{loop.index}}-file"></label>
{% endif %}
<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>
{% if writable %}
</form>
{% endif %}
{% 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 %}
{% if writable %}
<h2>Content</h2>
<form method="post" action= "/shared{{ 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 %}
<h2>Folder properties</h2>
<p>Folder name: {{cwd.name}}</p>
<p>Contents: {{cwd.folders|length + cwd.files|length}} item(s)</p>
<p>Location: /shared{{ cur_dir }}</p>
<p>Created: {{cwd.created.strftime('%Y-%m-%d %H:%M:%S')}}</p>
<p>Owner: {{owner}}</p>
<p>Access: {{ 'Read and write files' if writable else 'Read files' }}</p>
{% endif %}
{% endblock %}