Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chiefs
ChiefSend
Commits
31d9a00d
Commit
31d9a00d
authored
Oct 01, 2020
by
Lukas Böhm
Browse files
design
parent
65ff9e3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/forms.py
View file @
31d9a00d
...
...
@@ -6,7 +6,7 @@ from flask_wtf import FlaskForm
class
UploadForm
(
FlaskForm
):
files
=
MultipleFileField
(
'Dateien hochladen'
,
validators
=
[
DataRequired
()])
name
=
StringField
(
validators
=
[
DataRequired
()])
name
=
StringField
(
validators
=
[
Optional
()])
timer
=
SelectField
(
choices
=
[(
2
,
'2 Minuten'
),
(
5
,
'5 Minuten'
),
(
15
,
'15 Minuten'
),
(
30
,
'30 Minuten'
),
(
120
,
'2 Stunden'
),
(
360
,
'6 Stunden'
),
(
1440
,
'1 Tag'
),
(
10080
,
'7 Tage'
),
(
43200
,
'1 Monat'
),
(
990000000
,
'Für immer'
)],
...
...
app/templates/Upload.html
View file @
31d9a00d
...
...
@@ -24,17 +24,19 @@
</div>
<div
class=
"card-body"
>
<div
class=
"custom-file"
>
{{ form.files() }}
{
#
form.files.label(class='custom-file-label')
#
}
<div
class=
"custom-file
mb-3
"
>
{{ form.files(
class='custom-file-input'
) }}
{
{
form.files.label(class='custom-file-label')
}
}
</div>
<div
class=
"row"
>
{{ form.timer(class='
form-control
col') }}
{{ form.download_limit(class='
form-control
col') }}
<div
class=
"row
form-group
"
>
{{ form.timer(class='
selectpicker
col') }}
{{ form.download_limit(class='
selectpicker
col') }}
</div>
{{ form.submit(class='btn btn-lg btn-block btn-primary') }}
<div
class=
"form-group"
>
{{ form.submit(class='btn btn-lg btn-block btn-primary') }}
</div>
</div>
</form>
...
...
@@ -47,4 +49,17 @@
</footer>
</div>
<script>
// to let the name of the file appear on select
$
(
"
.custom-file-input
"
).
on
(
"
change
"
,
function
()
{
let
fns
=
$
(
this
)[
0
].
files
;
let
label
=
""
;
for
(
var
i
=
0
;
i
<
fns
.
length
;
i
++
){
label
=
label
.
concat
(
fns
[
i
].
name
);
if
(
i
<
fns
.
length
-
1
)
label
=
label
.
concat
(
"
,
"
);
}
$
(
this
).
siblings
(
"
.custom-file-label
"
).
addClass
(
"
selected
"
).
html
(
label
);
});
</script>
{% endblock page %}
\ No newline at end of file
Write
Preview
Supports
Markdown
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