Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ff6b5c36
authored
Feb 04, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store: upload gui
parent
e561056e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
cloud/urls.py
+1
-0
one/static/cloud.js
+16
-0
store/views.py
+11
-0
No files found.
cloud/urls.py
View file @
ff6b5c36
...
...
@@ -30,5 +30,6 @@ urlpatterns = patterns('',
url
(
r'^ajax/templateWizard$'
,
'one.views.ajax_template_wizard'
,
name
=
'ajax_template_wizard'
),
url
(
r'^ajax/store/list$'
,
'store.views.ajax_listfolder'
,
name
=
'store_ajax_listfolder'
),
url
(
r'^ajax/store/download$'
,
'store.views.ajax_download'
,
name
=
'store_ajax_download'
),
url
(
r'^ajax/store/upload$'
,
'store.views.ajax_upload'
,
name
=
'store_ajax_upload'
),
url
(
r'^ajax/store/delete$'
,
'store.views.ajax_delete'
,
name
=
'store_ajax_delete'
),
)
one/static/cloud.js
View file @
ff6b5c36
...
...
@@ -193,6 +193,20 @@ $(function() {
}
})
}
self
.
uploadURL
=
ko
.
observable
(
'/'
);
self
.
getUploadURL
=
function
(){
console
.
log
(
'sad'
)
$
.
ajax
({
type
:
'POST'
,
data
:
'ul='
+
self
.
currentPath
(),
url
:
'/ajax/store/upload'
,
dataType
:
'json'
,
success
:
function
(
data
){
console
.
log
(
'asdasd'
,
data
);
self
.
uploadURL
(
data
.
url
);
}
}).
error
(
function
(){
console
.
log
(
'asd'
,
arguments
)})
}
loadFolder
(
self
.
currentPath
());
}
var
model
=
new
Model
();
...
...
@@ -213,6 +227,8 @@ $(function() {
console
.
log
(
e
);
e
.
stopPropagation
();
e
.
preventDefault
();
console
.
log
(
e
.
dataTransfer
.
files
)
return
false
;
});
})
store/views.py
View file @
ff6b5c36
...
...
@@ -106,6 +106,17 @@ def ajax_download(request):
return
HttpResponse
(
'File not found!'
,
status_code
=
404
)
@login_required
def
ajax_upload
(
request
):
user
=
request
.
user
.
username
try
:
ul
=
request
.
POST
[
'ul'
]
url
=
StoreApi
.
requestupload
(
user
,
ul
)
return
HttpResponse
(
json
.
dumps
({
'url'
:
url
}))
except
:
pass
return
HttpResponse
(
'Error!'
,
status_code
=
404
)
@login_required
def
ajax_delete
(
request
):
user
=
request
.
user
.
username
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment