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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
40f32fa4
authored
Jul 07, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: cooler file upload form
parent
7fe4e4d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
9 deletions
+44
-9
circle/dashboard/templates/dashboard/store/list.html
+44
-9
No files found.
circle/dashboard/templates/dashboard/store/list.html
View file @
40f32fa4
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</div>
</div>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
</a>
</a>
<div
class=
"infos"
style=
"position: relative;"
>
<div
class=
"
store-list-file-
infos"
style=
"position: relative;"
>
<a
href=
"{% url "
dashboard
.
views
.
store-download
"
%}?
path=
{{
f
.
path
}}"
<a
href=
"{% url "
dashboard
.
views
.
store-download
"
%}?
path=
{{
f
.
path
}}"
class=
"btn btn-primary"
style=
"position: absolute; right: 15px; top: 32px;"
>
class=
"btn btn-primary"
style=
"position: absolute; right: 15px; top: 32px;"
>
<i
class=
"icon-download"
></i>
<i
class=
"icon-download"
></i>
...
@@ -53,14 +53,50 @@
...
@@ -53,14 +53,50 @@
{% trans "This folder is empty." %}
{% trans "This folder is empty." %}
</a>
</a>
{% endfor %}
{% endfor %}
<div
class=
"list-group-item"
>
<div
class=
"list-group-item"
style=
"height: 50px;"
>
Upload file to this folder
Upload file to this folder
<form
action=
""
data-action=
"{% url "
dashboard
.
views
.
store-upload
"
%}"
<form
action=
""
data-action=
"{% url "
dashboard
.
views
.
store-upload
"
%}"
method=
"POST"
enctype=
"multipart/form-data"
class=
"pull-right"
>
method=
"POST"
enctype=
"multipart/form-data"
class=
"pull-right"
id=
"store-upload-form"
>
{% csrf_token %}
{% csrf_token %}
<input
type=
"hidden"
name=
"current_dir"
value=
"{{ current }}"
></a>
<input
type=
"hidden"
name=
"current_dir"
value=
"{{ current }}"
/>
<input
type=
"file"
name=
"data"
/>
<div
class=
"input-group"
style=
"max-width: 400px;"
>
<input
type=
"submit"
/>
<span
class=
"input-group-btn"
id=
"store-upload-browse"
>
<span
class=
"btn btn-primary btn-sm"
>
{% trans "Browse..." %}
</span>
</span>
<input
type=
"text"
class=
"input-sm form-control"
id=
"store-upload-filename"
/>
<span
class=
"input-group-btn"
>
<input
type=
"submit"
class=
"btn btn-primary btn-sm"
value=
"{% trans "
Upload
"
%}"
/>
</span>
</div>
<input
id=
"store-upload-file"
name=
"data"
type=
"file"
style=
"display:none"
multiple
>
<script
type=
"text/javascript"
>
$
(
'#store-upload-browse'
).
click
(
function
()
{
$
(
'#store-upload-form input[type="file"]'
).
click
();
});
$
(
"#store-upload-file"
).
change
(
function
()
{
var
input
=
$
(
this
);
var
numFiles
=
input
.
get
(
0
).
files
?
input
.
get
(
0
).
files
.
length
:
1
;
var
label
=
input
.
val
().
replace
(
/
\\
/g
,
'/'
).
replace
(
/.*
\/
/
,
''
);
input
.
trigger
(
'fileselect'
,
[
numFiles
,
label
]);
});
$
(
"#store-upload-file"
).
on
(
"fileselect"
,
function
(
event
,
numFiles
,
label
)
{
var
input
=
$
(
"#store-upload-filename"
);
var
log
=
numFiles
>
1
?
numFiles
+
' files selected'
:
label
;
if
(
input
.
length
)
{
input
.
val
(
log
);
}
});
</script>
</form>
</form>
</div>
</div>
</div>
</div>
...
@@ -93,19 +129,18 @@
...
@@ -93,19 +129,18 @@
float
:
right
;
float
:
right
;
}
}
.infos
{
.
store-list-file-
infos
{
padding
:
20px
;
padding
:
20px
;
display
:
none
;
display
:
none
;
border-left
:
1px
solid
#ddd
;
border-left
:
1px
solid
#ddd
;
border-right
:
1px
solid
#ddd
;
border-right
:
1px
solid
#ddd
;
}
}
</style>
</style>
<script>
<script>
$
(
function
()
{
$
(
function
()
{
$
(
".store-list-item"
).
click
(
function
()
{
$
(
".store-list-item"
).
click
(
function
()
{
if
(
$
(
this
).
data
(
"item-type"
)
==
"D"
)
return
true
;
if
(
$
(
this
).
data
(
"item-type"
)
==
"D"
)
return
true
;
$
(
this
).
next
(
".infos"
).
stop
().
slideToggle
();
$
(
this
).
next
(
".
store-list-file-
infos"
).
stop
().
slideToggle
();
return
false
;
return
false
;
});
});
...
...
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