Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
ee5677f3
Commit
ee5677f3
authored
Mar 26, 2018
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'multiload/master'
parents
3aa692df
0afa7cba
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
115 deletions
+136
-115
layout.html
cps/templates/layout.html
+28
-6
web.py
cps/web.py
+108
-109
No files found.
cps/templates/layout.html
View file @
ee5677f3
...
...
@@ -55,11 +55,20 @@
<ul
class=
"nav navbar-nav navbar-right"
id=
"main-nav"
>
{% if g.user.is_authenticated or g.user.is_anonymous %}
{% if g.user.role_upload() or g.user.role_admin()%}
{% if g.allow_upload %}
<li>
<form
id=
"form-upload-multi"
class=
"navbar-form"
action=
"{{ url_for('upload') }}"
method=
"post"
enctype=
"multipart/form-data"
>
<div
class=
"form-group"
>
<span
class=
"btn btn-default btn-file"
>
{{_('Upload')}} multiple books
<input
id=
"btn-upload-multi"
name=
"btn-upload"
type=
"file"
multiple
></span>
</div>
</form>
</li>
{% endif %}
{% if g.allow_upload %}
<li>
<form
id=
"form-upload"
class=
"navbar-form"
action=
"{{ url_for('upload') }}"
method=
"post"
enctype=
"multipart/form-data"
>
<div
class=
"form-group"
>
<span
class=
"btn btn-default btn-file"
>
{{_('Upload')}}
<input
id=
"btn-upload"
name=
"btn-upload"
type=
"file"
></span>
<span
class=
"btn btn-default btn-file"
>
{{_('Upload')}}
a single book
<input
id=
"btn-upload"
name=
"btn-upload"
type=
"file"
></span>
</div>
</form>
</li>
...
...
@@ -98,6 +107,14 @@
</div>
{%endif%}
{% endfor %}
<div
id=
"loader"
hidden=
"true"
>
<center>
<h3>
Uploading...
</h3>
<span>
please don't refresh the page
</span>
.
<br
/>
<img
src=
"{{ url_for('static', filename='img/loader.gif') }}"
>
</center>
</div>
<div
class=
"container-fluid"
>
<div
class=
"row-fluid"
>
{% if g.user.is_authenticated or g.user.is_anonymous %}
...
...
@@ -224,11 +241,16 @@
<script
src=
"{{ url_for('static', filename='js/libs/jquery.form.js') }}"
></script>
<script
src=
"{{ url_for('static', filename='js/main.js') }}"
></script>
<script
type=
"text/javascript"
>
$
(
function
()
{
$
(
"#btn-upload"
).
change
(
function
()
{
$
(
"#form-upload"
).
submit
();
});
});
$
(
function
()
{
$
(
"#btn-upload"
).
change
(
function
()
{
$
(
"#loader"
).
show
();
$
(
"#form-upload"
).
submit
();
});
$
(
"#btn-upload-multi"
).
change
(
function
()
{
$
(
"#loader"
).
show
();
$
(
"#form-upload-multi"
).
submit
();
});
});
</script>
{% block js %}{% endblock %}
...
...
cps/web.py
View file @
ee5677f3
This diff is collapsed.
Click to expand it.
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