Merge branch 'dev' of https://github.com/jh8579/fileshell_cloudcomputing into dev
# Conflicts: # fileshell/models.py # fileshell/settings.py # fileshell/urls.py # fileshell/views.py # templates/base.html
Showing
7 changed files
with
445 additions
and
20 deletions
fileshell/static/css/dropzone.css
0 → 100644
1 | +/* The MIT License */ | ||
2 | +.dropzone, | ||
3 | +.dropzone *, | ||
4 | +.dropzone-previews, | ||
5 | +.dropzone-previews * { | ||
6 | + -webkit-box-sizing: border-box; | ||
7 | + -moz-box-sizing: border-box; | ||
8 | + box-sizing: border-box; | ||
9 | +} | ||
10 | +.dropzone { | ||
11 | + position: relative; | ||
12 | + border: 1px solid rgba(0,0,0,0.08); | ||
13 | + background: rgba(0,0,0,0.02); | ||
14 | + padding: 1em; | ||
15 | +} | ||
16 | +.dropzone.dz-clickable { | ||
17 | + cursor: pointer; | ||
18 | +} | ||
19 | +.dropzone.dz-clickable .dz-message, | ||
20 | +.dropzone.dz-clickable .dz-message span { | ||
21 | + cursor: pointer; | ||
22 | +} | ||
23 | +.dropzone.dz-clickable * { | ||
24 | + cursor: default; | ||
25 | +} | ||
26 | +.dropzone .dz-message { | ||
27 | + opacity: 1; | ||
28 | + -ms-filter: none; | ||
29 | + filter: none; | ||
30 | +} | ||
31 | +.dropzone.dz-drag-hover { | ||
32 | + border-color: rgba(0,0,0,0.15); | ||
33 | + background: rgba(0,0,0,0.04); | ||
34 | +} | ||
35 | +.dropzone.dz-started .dz-message { | ||
36 | + display: none; | ||
37 | +} | ||
38 | +.dropzone .dz-preview, | ||
39 | +.dropzone-previews .dz-preview { | ||
40 | + background: rgba(255,255,255,0.8); | ||
41 | + position: relative; | ||
42 | + display: inline-block; | ||
43 | + margin: 17px; | ||
44 | + vertical-align: top; | ||
45 | + border: 1px solid #acacac; | ||
46 | + padding: 6px 6px 6px 6px; | ||
47 | +} | ||
48 | +.dropzone .dz-preview.dz-file-preview [data-dz-thumbnail], | ||
49 | +.dropzone-previews .dz-preview.dz-file-preview [data-dz-thumbnail] { | ||
50 | + display: none; | ||
51 | +} | ||
52 | +.dropzone .dz-preview .dz-details, | ||
53 | +.dropzone-previews .dz-preview .dz-details { | ||
54 | + width: 100px; | ||
55 | + height: 100px; | ||
56 | + position: relative; | ||
57 | + background: #ebebeb; | ||
58 | + padding: 5px; | ||
59 | + margin-bottom: 22px; | ||
60 | +} | ||
61 | +.dropzone .dz-preview .dz-details .dz-filename, | ||
62 | +.dropzone-previews .dz-preview .dz-details .dz-filename { | ||
63 | + overflow: hidden; | ||
64 | + height: 100%; | ||
65 | +} | ||
66 | +.dropzone .dz-preview .dz-details img, | ||
67 | +.dropzone-previews .dz-preview .dz-details img { | ||
68 | + position: absolute; | ||
69 | + top: 0; | ||
70 | + left: 0; | ||
71 | + width: 100px; | ||
72 | + height: 100px; | ||
73 | +} | ||
74 | +.dropzone .dz-preview .dz-details .dz-size, | ||
75 | +.dropzone-previews .dz-preview .dz-details .dz-size { | ||
76 | + position: absolute; | ||
77 | + bottom: -28px; | ||
78 | + left: 3px; | ||
79 | + height: 28px; | ||
80 | + line-height: 28px; | ||
81 | +} | ||
82 | +.dropzone .dz-preview.dz-error .dz-error-mark, | ||
83 | +.dropzone-previews .dz-preview.dz-error .dz-error-mark { | ||
84 | + display: block; | ||
85 | +} | ||
86 | +.dropzone .dz-preview.dz-success .dz-success-mark, | ||
87 | +.dropzone-previews .dz-preview.dz-success .dz-success-mark { | ||
88 | + display: block; | ||
89 | +} | ||
90 | +.dropzone .dz-preview:hover .dz-details img, | ||
91 | +.dropzone-previews .dz-preview:hover .dz-details img { | ||
92 | + display: none; | ||
93 | +} | ||
94 | +.dropzone .dz-preview .dz-success-mark, | ||
95 | +.dropzone-previews .dz-preview .dz-success-mark, | ||
96 | +.dropzone .dz-preview .dz-error-mark, | ||
97 | +.dropzone-previews .dz-preview .dz-error-mark { | ||
98 | + display: none; | ||
99 | + position: absolute; | ||
100 | + width: 40px; | ||
101 | + height: 40px; | ||
102 | + font-size: 30px; | ||
103 | + text-align: center; | ||
104 | + right: -10px; | ||
105 | + top: -10px; | ||
106 | +} | ||
107 | +.dropzone .dz-preview .dz-success-mark, | ||
108 | +.dropzone-previews .dz-preview .dz-success-mark { | ||
109 | + color: #8cc657; | ||
110 | +} | ||
111 | +.dropzone .dz-preview .dz-error-mark, | ||
112 | +.dropzone-previews .dz-preview .dz-error-mark { | ||
113 | + color: #ee162d; | ||
114 | +} | ||
115 | +.dropzone .dz-preview .dz-progress, | ||
116 | +.dropzone-previews .dz-preview .dz-progress { | ||
117 | + position: absolute; | ||
118 | + top: 100px; | ||
119 | + left: 6px; | ||
120 | + right: 6px; | ||
121 | + height: 6px; | ||
122 | + background: #d7d7d7; | ||
123 | + display: none; | ||
124 | +} | ||
125 | +.dropzone .dz-preview .dz-progress .dz-upload, | ||
126 | +.dropzone-previews .dz-preview .dz-progress .dz-upload { | ||
127 | + display: block; | ||
128 | + position: absolute; | ||
129 | + top: 0; | ||
130 | + bottom: 0; | ||
131 | + left: 0; | ||
132 | + width: 0%; | ||
133 | + background-color: #8cc657; | ||
134 | +} | ||
135 | +.dropzone .dz-preview.dz-processing .dz-progress, | ||
136 | +.dropzone-previews .dz-preview.dz-processing .dz-progress { | ||
137 | + display: block; | ||
138 | +} | ||
139 | +.dropzone .dz-preview .dz-error-message, | ||
140 | +.dropzone-previews .dz-preview .dz-error-message { | ||
141 | + display: none; | ||
142 | + position: absolute; | ||
143 | + top: -5px; | ||
144 | + left: -20px; | ||
145 | + background: rgba(245,245,245,0.8); | ||
146 | + padding: 8px 10px; | ||
147 | + color: #800; | ||
148 | + min-width: 140px; | ||
149 | + max-width: 500px; | ||
150 | + z-index: 500; | ||
151 | +} | ||
152 | +.dropzone .dz-preview:hover.dz-error .dz-error-message, | ||
153 | +.dropzone-previews .dz-preview:hover.dz-error .dz-error-message { | ||
154 | + display: block; | ||
155 | +} | ||
156 | +.dropzone { | ||
157 | + border: 1px solid rgba(0,0,0,0.03); | ||
158 | + min-height: 360px; | ||
159 | + -webkit-border-radius: 3px; | ||
160 | + border-radius: 3px; | ||
161 | + background: rgba(0,0,0,0.03); | ||
162 | + padding: 23px; | ||
163 | +} | ||
164 | +.dropzone .dz-default.dz-message { | ||
165 | + opacity: 1; | ||
166 | + -ms-filter: none; | ||
167 | + filter: none; | ||
168 | + -webkit-transition: opacity 0.3s ease-in-out; | ||
169 | + -moz-transition: opacity 0.3s ease-in-out; | ||
170 | + -o-transition: opacity 0.3s ease-in-out; | ||
171 | + -ms-transition: opacity 0.3s ease-in-out; | ||
172 | + transition: opacity 0.3s ease-in-out; | ||
173 | + background-image: url("../resources/spritemap.png"); | ||
174 | + background-repeat: no-repeat; | ||
175 | + background-position: 0 0; | ||
176 | + position: absolute; | ||
177 | + width: 428px; | ||
178 | + height: 123px; | ||
179 | + margin-left: -214px; | ||
180 | + margin-top: -61.5px; | ||
181 | + top: 50%; | ||
182 | + left: 50%; | ||
183 | +} | ||
184 | +@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) { | ||
185 | + .dropzone .dz-default.dz-message { | ||
186 | + background-image: url("../resources/spritemap@2x.png"); | ||
187 | + -webkit-background-size: 428px 406px; | ||
188 | + -moz-background-size: 428px 406px; | ||
189 | + background-size: 428px 406px; | ||
190 | + } | ||
191 | +} | ||
192 | +.dropzone .dz-default.dz-message span { | ||
193 | + display: none; | ||
194 | +} | ||
195 | +.dropzone.dz-square .dz-default.dz-message { | ||
196 | + background-position: 0 -123px; | ||
197 | + width: 268px; | ||
198 | + margin-left: -134px; | ||
199 | + height: 174px; | ||
200 | + margin-top: -87px; | ||
201 | +} | ||
202 | +.dropzone.dz-drag-hover .dz-message { | ||
203 | + opacity: 0.15; | ||
204 | + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=15)"; | ||
205 | + filter: alpha(opacity=15); | ||
206 | +} | ||
207 | +.dropzone.dz-started .dz-message { | ||
208 | + display: block; | ||
209 | + opacity: 0; | ||
210 | + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; | ||
211 | + filter: alpha(opacity=0); | ||
212 | +} | ||
213 | +.dropzone .dz-preview, | ||
214 | +.dropzone-previews .dz-preview { | ||
215 | + -webkit-box-shadow: 1px 1px 4px rgba(0,0,0,0.16); | ||
216 | + box-shadow: 1px 1px 4px rgba(0,0,0,0.16); | ||
217 | + font-size: 14px; | ||
218 | +} | ||
219 | +.dropzone .dz-preview.dz-image-preview:hover .dz-details img, | ||
220 | +.dropzone-previews .dz-preview.dz-image-preview:hover .dz-details img { | ||
221 | + display: block; | ||
222 | + opacity: 0.1; | ||
223 | + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)"; | ||
224 | + filter: alpha(opacity=10); | ||
225 | +} | ||
226 | +.dropzone .dz-preview.dz-success .dz-success-mark, | ||
227 | +.dropzone-previews .dz-preview.dz-success .dz-success-mark { | ||
228 | + opacity: 1; | ||
229 | + -ms-filter: none; | ||
230 | + filter: none; | ||
231 | +} | ||
232 | +.dropzone .dz-preview.dz-error .dz-error-mark, | ||
233 | +.dropzone-previews .dz-preview.dz-error .dz-error-mark { | ||
234 | + opacity: 1; | ||
235 | + -ms-filter: none; | ||
236 | + filter: none; | ||
237 | +} | ||
238 | +.dropzone .dz-preview.dz-error .dz-progress .dz-upload, | ||
239 | +.dropzone-previews .dz-preview.dz-error .dz-progress .dz-upload { | ||
240 | + background: #ee1e2d; | ||
241 | +} | ||
242 | +.dropzone .dz-preview .dz-error-mark, | ||
243 | +.dropzone-previews .dz-preview .dz-error-mark, | ||
244 | +.dropzone .dz-preview .dz-success-mark, | ||
245 | +.dropzone-previews .dz-preview .dz-success-mark { | ||
246 | + display: block; | ||
247 | + opacity: 0; | ||
248 | + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; | ||
249 | + filter: alpha(opacity=0); | ||
250 | + -webkit-transition: opacity 0.4s ease-in-out; | ||
251 | + -moz-transition: opacity 0.4s ease-in-out; | ||
252 | + -o-transition: opacity 0.4s ease-in-out; | ||
253 | + -ms-transition: opacity 0.4s ease-in-out; | ||
254 | + transition: opacity 0.4s ease-in-out; | ||
255 | + background-image: url("../images/spritemap.png"); | ||
256 | + background-repeat: no-repeat; | ||
257 | +} | ||
258 | +@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) { | ||
259 | + .dropzone .dz-preview .dz-error-mark, | ||
260 | + .dropzone-previews .dz-preview .dz-error-mark, | ||
261 | + .dropzone .dz-preview .dz-success-mark, | ||
262 | + .dropzone-previews .dz-preview .dz-success-mark { | ||
263 | + background-image: url("../images/spritemap@2x.png"); | ||
264 | + -webkit-background-size: 428px 406px; | ||
265 | + -moz-background-size: 428px 406px; | ||
266 | + background-size: 428px 406px; | ||
267 | + } | ||
268 | +} | ||
269 | +.dropzone .dz-preview .dz-error-mark span, | ||
270 | +.dropzone-previews .dz-preview .dz-error-mark span, | ||
271 | +.dropzone .dz-preview .dz-success-mark span, | ||
272 | +.dropzone-previews .dz-preview .dz-success-mark span { | ||
273 | + display: none; | ||
274 | +} | ||
275 | +.dropzone .dz-preview .dz-error-mark, | ||
276 | +.dropzone-previews .dz-preview .dz-error-mark { | ||
277 | + background-position: -268px -123px; | ||
278 | +} | ||
279 | +.dropzone .dz-preview .dz-success-mark, | ||
280 | +.dropzone-previews .dz-preview .dz-success-mark { | ||
281 | + background-position: -268px -163px; | ||
282 | +} | ||
283 | +.dropzone .dz-preview .dz-progress .dz-upload, | ||
284 | +.dropzone-previews .dz-preview .dz-progress .dz-upload { | ||
285 | + -webkit-animation: loading 0.4s linear infinite; | ||
286 | + -moz-animation: loading 0.4s linear infinite; | ||
287 | + -o-animation: loading 0.4s linear infinite; | ||
288 | + -ms-animation: loading 0.4s linear infinite; | ||
289 | + animation: loading 0.4s linear infinite; | ||
290 | + -webkit-transition: width 0.3s ease-in-out; | ||
291 | + -moz-transition: width 0.3s ease-in-out; | ||
292 | + -o-transition: width 0.3s ease-in-out; | ||
293 | + -ms-transition: width 0.3s ease-in-out; | ||
294 | + transition: width 0.3s ease-in-out; | ||
295 | + -webkit-border-radius: 2px; | ||
296 | + border-radius: 2px; | ||
297 | + position: absolute; | ||
298 | + top: 0; | ||
299 | + left: 0; | ||
300 | + width: 0%; | ||
301 | + height: 100%; | ||
302 | + background-image: url("../images/spritemap.png"); | ||
303 | + background-repeat: repeat-x; | ||
304 | + background-position: 0px -400px; | ||
305 | +} | ||
306 | +@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) { | ||
307 | + .dropzone .dz-preview .dz-progress .dz-upload, | ||
308 | + .dropzone-previews .dz-preview .dz-progress .dz-upload { | ||
309 | + background-image: url("../images/spritemap@2x.png"); | ||
310 | + -webkit-background-size: 428px 406px; | ||
311 | + -moz-background-size: 428px 406px; | ||
312 | + background-size: 428px 406px; | ||
313 | + } | ||
314 | +} | ||
315 | +.dropzone .dz-preview.dz-success .dz-progress, | ||
316 | +.dropzone-previews .dz-preview.dz-success .dz-progress { | ||
317 | + display: block; | ||
318 | + opacity: 0; | ||
319 | + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; | ||
320 | + filter: alpha(opacity=0); | ||
321 | + -webkit-transition: opacity 0.4s ease-in-out; | ||
322 | + -moz-transition: opacity 0.4s ease-in-out; | ||
323 | + -o-transition: opacity 0.4s ease-in-out; | ||
324 | + -ms-transition: opacity 0.4s ease-in-out; | ||
325 | + transition: opacity 0.4s ease-in-out; | ||
326 | +} | ||
327 | +.dropzone .dz-preview .dz-error-message, | ||
328 | +.dropzone-previews .dz-preview .dz-error-message { | ||
329 | + display: block; | ||
330 | + opacity: 0; | ||
331 | + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; | ||
332 | + filter: alpha(opacity=0); | ||
333 | + -webkit-transition: opacity 0.3s ease-in-out; | ||
334 | + -moz-transition: opacity 0.3s ease-in-out; | ||
335 | + -o-transition: opacity 0.3s ease-in-out; | ||
336 | + -ms-transition: opacity 0.3s ease-in-out; | ||
337 | + transition: opacity 0.3s ease-in-out; | ||
338 | +} | ||
339 | +.dropzone .dz-preview:hover.dz-error .dz-error-message, | ||
340 | +.dropzone-previews .dz-preview:hover.dz-error .dz-error-message { | ||
341 | + opacity: 1; | ||
342 | + -ms-filter: none; | ||
343 | + filter: none; | ||
344 | +} | ||
345 | +.dropzone a.dz-remove, | ||
346 | +.dropzone-previews a.dz-remove { | ||
347 | + background-image: -webkit-linear-gradient(top, #fafafa, #eee); | ||
348 | + background-image: -moz-linear-gradient(top, #fafafa, #eee); | ||
349 | + background-image: -o-linear-gradient(top, #fafafa, #eee); | ||
350 | + background-image: -ms-linear-gradient(top, #fafafa, #eee); | ||
351 | + background-image: linear-gradient(to bottom, #fafafa, #eee); | ||
352 | + -webkit-border-radius: 2px; | ||
353 | + border-radius: 2px; | ||
354 | + border: 1px solid #eee; | ||
355 | + text-decoration: none; | ||
356 | + display: block; | ||
357 | + padding: 4px 5px; | ||
358 | + text-align: center; | ||
359 | + color: #aaa; | ||
360 | + margin-top: 26px; | ||
361 | +} | ||
362 | +.dropzone a.dz-remove:hover, | ||
363 | +.dropzone-previews a.dz-remove:hover { | ||
364 | + color: #666; | ||
365 | +} | ||
366 | +@-moz-keyframes loading { | ||
367 | + 0% { | ||
368 | + background-position: 0 -400px; | ||
369 | + } | ||
370 | + | ||
371 | + 100% { | ||
372 | + background-position: -7px -400px; | ||
373 | + } | ||
374 | +} | ||
375 | +@-webkit-keyframes loading { | ||
376 | + 0% { | ||
377 | + background-position: 0 -400px; | ||
378 | + } | ||
379 | + | ||
380 | + 100% { | ||
381 | + background-position: -7px -400px; | ||
382 | + } | ||
383 | +} | ||
384 | +@-o-keyframes loading { | ||
385 | + 0% { | ||
386 | + background-position: 0 -400px; | ||
387 | + } | ||
388 | + | ||
389 | + 100% { | ||
390 | + background-position: -7px -400px; | ||
391 | + } | ||
392 | +} | ||
393 | +@-ms-keyframes loading { | ||
394 | + 0% { | ||
395 | + background-position: 0 -400px; | ||
396 | + } | ||
397 | + | ||
398 | + 100% { | ||
399 | + background-position: -7px -400px; | ||
400 | + } | ||
401 | +} | ||
402 | +@keyframes loading { | ||
403 | + 0% { | ||
404 | + background-position: 0 -400px; | ||
405 | + } | ||
406 | + | ||
407 | + 100% { | ||
408 | + background-position: -7px -400px; | ||
409 | + } | ||
410 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | body { | 1 | body { |
2 | font-family: "Roboto", sans-serif; | 2 | font-family: "Roboto", sans-serif; |
3 | } | 3 | } |
4 | + | ||
4 | .search_form{ | 5 | .search_form{ |
5 | float:right; | 6 | float:right; |
6 | } | 7 | } |
8 | +.drop{ | ||
9 | + width:200px; | ||
10 | + height:200px; | ||
11 | +} | ||
12 | +.drop_zone{ | ||
13 | + width:200px; | ||
14 | + height:200px; | ||
15 | +} | ||
7 | .left_bar { | 16 | .left_bar { |
8 | float:left; | 17 | float:left; |
9 | width:200px; | 18 | width:200px; | ... | ... |
... | @@ -26,11 +26,6 @@ class MediaStorage(S3Boto3Storage): | ... | @@ -26,11 +26,6 @@ class MediaStorage(S3Boto3Storage): |
26 | client.upload_fileobj(nf, AWS_STORAGE_BUCKET_NAME, user.username + '/' + dir + file.name) | 26 | client.upload_fileobj(nf, AWS_STORAGE_BUCKET_NAME, user.username + '/' + dir + file.name) |
27 | os.remove('tempfile') | 27 | os.remove('tempfile') |
28 | # putResponse = client.put_object(Bucket=AWS_STORAGE_BUCKET_NAME, Key= file_name) | 28 | # putResponse = client.put_object(Bucket=AWS_STORAGE_BUCKET_NAME, Key= file_name) |
29 | - """ | ||
30 | - def download_file(file_name, dir): | ||
31 | - client = boto3.resource('s3') | ||
32 | - client.Bucket(AWS_STORAGE_BUCKET_NAME).download_file(Key= dir, Filename=LOCAL_DOWNLOAD_PATH+file_name) | ||
33 | - """ | ||
34 | 29 | ||
35 | def down(filename, bucketPath): | 30 | def down(filename, bucketPath): |
36 | session = boto3.session.Session(region_name='us-west-2') | 31 | session = boto3.session.Session(region_name='us-west-2') | ... | ... |
... | @@ -42,7 +42,6 @@ def file(request): | ... | @@ -42,7 +42,6 @@ def file(request): |
42 | type = this_path.split('/') | 42 | type = this_path.split('/') |
43 | type.pop(0) | 43 | type.pop(0) |
44 | type = type.pop(0) | 44 | type = type.pop(0) |
45 | - print(type) | ||
46 | 45 | ||
47 | # user가 갖고 있는 폴더 중 현재 url을 parent로 갖는 폴더 필터링 | 46 | # user가 갖고 있는 폴더 중 현재 url을 parent로 갖는 폴더 필터링 |
48 | folderList = Folder.objects.filter(parent__dir_name=dir, user=request.user.username) | 47 | folderList = Folder.objects.filter(parent__dir_name=dir, user=request.user.username) |
... | @@ -142,10 +141,10 @@ def add_folder(request): | ... | @@ -142,10 +141,10 @@ def add_folder(request): |
142 | 141 | ||
143 | def upload(request): | 142 | def upload(request): |
144 | if request.method == 'POST': | 143 | if request.method == 'POST': |
145 | - | 144 | + print(request.FILES) |
146 | ## 파일 model 변수 초기화 | 145 | ## 파일 model 변수 초기화 |
147 | - filedata = request.FILES.get('source-file') | 146 | + filedata = request.FILES.get('file') # request.Files['file'] 함수 썻을 때 오류 발생할 수 있음!! |
148 | - title = request.FILES.get('source-file') | 147 | + title = request.FILES.get('file') |
149 | user = request.user | 148 | user = request.user |
150 | user_name = request.user.username | 149 | user_name = request.user.username |
151 | now = time.localtime() | 150 | now = time.localtime() |
... | @@ -163,7 +162,6 @@ def upload(request): | ... | @@ -163,7 +162,6 @@ def upload(request): |
163 | MediaStorage.upload_file(filedata, user, dir) | 162 | MediaStorage.upload_file(filedata, user, dir) |
164 | else: | 163 | else: |
165 | pass | 164 | pass |
166 | - | ||
167 | return HttpResponseRedirect(request.META.get('HTTP_REFERER', '/')) | 165 | return HttpResponseRedirect(request.META.get('HTTP_REFERER', '/')) |
168 | 166 | ||
169 | def download(request, bucketPath, filename, dir): | 167 | def download(request, bucketPath, filename, dir): | ... | ... |
... | @@ -5,6 +5,7 @@ | ... | @@ -5,6 +5,7 @@ |
5 | <meta charset="utf-8"> | 5 | <meta charset="utf-8"> |
6 | <title> FileShell</title> | 6 | <title> FileShell</title> |
7 | <link rel="stylesheet" href="{% static 'css/layout_base.css' %}"> | 7 | <link rel="stylesheet" href="{% static 'css/layout_base.css' %}"> |
8 | + <link rel="stylesheet" href="{% static 'css/dropzone.css' %}"> | ||
8 | </head> | 9 | </head> |
9 | <body> | 10 | <body> |
10 | 11 | ||
... | @@ -22,7 +23,7 @@ | ... | @@ -22,7 +23,7 @@ |
22 | <a href="{% url 'logout' %}"> <img class = 'logout_icon' src= "{% static 'resources/logout.png' %}" width="50" height="50" align="right"/></a> | 23 | <a href="{% url 'logout' %}"> <img class = 'logout_icon' src= "{% static 'resources/logout.png' %}" width="50" height="50" align="right"/></a> |
23 | <a href="{% url 'profile' %}"> <img class = 'profile_icon' src= "{% static 'resources/profile.png' %}" width="50" height="50" align="right"/></a> | 24 | <a href="{% url 'profile' %}"> <img class = 'profile_icon' src= "{% static 'resources/profile.png' %}" width="50" height="50" align="right"/></a> |
24 | <div class="search_form"> | 25 | <div class="search_form"> |
25 | - <form id='search' action="" onsubmit="yourFunction()" method="post" enctype="multipart/form-data">{% csrf_token %} | 26 | + <form id='search' action="" onsubmit="yourFunction()" method="post" enctype="multipart/form-data" >{% csrf_token %} |
26 | <input type="dir_name" name="dir_name" id="dir_name" required="required" placeholder="검색할 파일이나 폴더 이름"> | 27 | <input type="dir_name" name="dir_name" id="dir_name" required="required" placeholder="검색할 파일이나 폴더 이름"> |
27 | <input type = "submit"> | 28 | <input type = "submit"> |
28 | </form> | 29 | </form> | ... | ... |
... | @@ -4,10 +4,8 @@ | ... | @@ -4,10 +4,8 @@ |
4 | <div> | 4 | <div> |
5 | <div class="right_bar"> | 5 | <div class="right_bar"> |
6 | <li class="nav-item1"><a href="" class="nav-link-right"> <img class = 'add_folder_icon' src= "{% static 'resources/upload.png' %}" width="30" height="30"/> 파일 업로드</a></li> | 6 | <li class="nav-item1"><a href="" class="nav-link-right"> <img class = 'add_folder_icon' src= "{% static 'resources/upload.png' %}" width="30" height="30"/> 파일 업로드</a></li> |
7 | - <form action={% url 'upload' %} method="post" enctype="multipart/form-data" novalidate> | 7 | + <form action={% url 'upload' %} method="post" enctype="multipart/form-data" novalidate>{% csrf_token %} |
8 | - {% csrf_token %} | 8 | + <input type ="file" name = "file"> |
9 | - | ||
10 | - <input type ="file" name = "source-file"> | ||
11 | <input type = "submit"> | 9 | <input type = "submit"> |
12 | </form> | 10 | </form> |
13 | <li class="nav-item1"><a href="" class="nav-link-right"> <img class = 'add_folder_icon' src= "{% static 'resources/add_folder.png' %}" width="30" height="30"/> 새 폴더</a></li> | 11 | <li class="nav-item1"><a href="" class="nav-link-right"> <img class = 'add_folder_icon' src= "{% static 'resources/add_folder.png' %}" width="30" height="30"/> 새 폴더</a></li> |
... | @@ -63,12 +61,30 @@ | ... | @@ -63,12 +61,30 @@ |
63 | {% else %} | 61 | {% else %} |
64 | <p>No File.</p> | 62 | <p>No File.</p> |
65 | {% endif %} | 63 | {% endif %} |
66 | - | ||
67 | </table> | 64 | </table> |
65 | + <form action="{% url 'upload' %}" id="dropzone" class="dropzone" method="post" enctype="multipart/form-data">{% csrf_token %} | ||
66 | + <div class="fallback"> | ||
67 | + <input class="fall_back" name="source-file" type="file"/> | ||
68 | + </div> | ||
69 | + </form> | ||
68 | </div> | 70 | </div> |
69 | </div> | 71 | </div> |
70 | <!-- //container --> | 72 | <!-- //container --> |
71 | </div> | 73 | </div> |
72 | <!-- //frame --> | 74 | <!-- //frame --> |
73 | 75 | ||
76 | + <script src="{% static 'js/dropzone.js' %}"></script> | ||
77 | + <script type="text/javascript"> | ||
78 | + Dropzone.options.dropzone = { | ||
79 | + maxFilesize: 10, // Mb | ||
80 | + init: function() { | ||
81 | + this.on('success', function(){ | ||
82 | + if (this.getQueuedFiles().length == 0 && this.getUploadingFiles().length == 0) { | ||
83 | + location.reload(); | ||
84 | + } | ||
85 | + }); | ||
86 | + } | ||
87 | + }; | ||
88 | + </script> | ||
89 | + | ||
74 | {% endblock %} | 90 | {% endblock %} |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -6,10 +6,6 @@ | ... | @@ -6,10 +6,6 @@ |
6 | <div class="container"> | 6 | <div class="container"> |
7 | <!-- //nav --> | 7 | <!-- //nav --> |
8 | <div class="content"> | 8 | <div class="content"> |
9 | - <div class="well text-muted text-center" style="padding-top: 4rem; padding-bottom: 4rem;"> | ||
10 | - <span class="glyphicon glyphicon-arrow-down" style="font-size: 4rem;"></span> | ||
11 | - <h3>Drop Photos Here to Upload</h3> | ||
12 | - </div> | ||
13 | <h2>즐겨찾기</h2> | 9 | <h2>즐겨찾기</h2> |
14 | <table cellspacing=1 width=700 border=1> | 10 | <table cellspacing=1 width=700 border=1> |
15 | <tr> | 11 | <tr> | ... | ... |
-
Please register or login to post a comment