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
a1cca00b
Commit
a1cca00b
authored
Feb 06, 2017
by
idalin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:janeczku/calibre-web into janeczku-master
parents
9ef8aa79
63379fe5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
204 additions
and
201 deletions
+204
-201
edit_books.js
cps/static/js/edit_books.js
+168
-147
main.js
cps/static/js/main.js
+33
-0
admin.html
cps/templates/admin.html
+0
-37
book_edit.html
cps/templates/book_edit.html
+1
-1
search_form.html
cps/templates/search_form.html
+1
-16
web.py
cps/web.py
+1
-0
No files found.
cps/static/js/edit_books.js
View file @
a1cca00b
This diff is collapsed.
Click to expand it.
cps/static/js/main.js
View file @
a1cca00b
...
...
@@ -25,6 +25,39 @@ $(function() {
$this
.
text
(
'Please wait...'
);
$this
.
addClass
(
'disabled'
);
});
$
(
"#restart"
).
click
(
function
()
{
$
.
ajax
({
dataType
:
'json'
,
url
:
window
.
location
.
pathname
+
"/../../shutdown"
,
data
:
{
"parameter"
:
0
},
success
:
function
(
data
)
{
return
alert
(
data
.
text
);}
});
});
$
(
"#shutdown"
).
click
(
function
()
{
$
.
ajax
({
dataType
:
'json'
,
url
:
window
.
location
.
pathname
+
"/../../shutdown"
,
data
:
{
"parameter"
:
1
},
success
:
function
(
data
)
{
return
alert
(
data
.
text
);}
});
});
$
(
"#check_for_update"
).
click
(
function
()
{
var
button_text
=
$
(
"#check_for_update"
).
html
();
$
(
"#check_for_update"
).
html
(
'Checking...'
);
$
.
ajax
({
dataType
:
'json'
,
url
:
window
.
location
.
pathname
+
"/../../get_update_status"
,
success
:
function
(
data
)
{
if
(
data
.
status
==
true
)
{
$
(
"#check_for_update"
).
addClass
(
'hidden'
);
$
(
"#perform_update"
).
removeClass
(
'hidden'
);
}
else
{
$
(
"#check_for_update"
).
html
(
button_text
);
};}
});
});
});
...
...
cps/templates/admin.html
View file @
a1cca00b
...
...
@@ -115,40 +115,3 @@
</div>
{% endblock %}
{% block js %}
<script
type=
"text/javascript"
>
$
(
"#restart"
).
click
(
function
()
{
$
.
ajax
({
dataType
:
'json'
,
url
:
"{{url_for('shutdown')}}"
,
data
:
{
"parameter"
:
0
},
//data: data,
success
:
function
(
data
)
{
return
alert
(
data
.
text
);}
});
});
$
(
"#shutdown"
).
click
(
function
()
{
$
.
ajax
({
dataType
:
'json'
,
url
:
"{{url_for('shutdown')}}"
,
data
:
{
"parameter"
:
1
},
success
:
function
(
data
)
{
return
alert
(
data
.
text
);}
});
});
$
(
"#check_for_update"
).
click
(
function
()
{
$
(
"#check_for_update"
).
html
(
'Checking...'
);
$
.
ajax
({
dataType
:
'json'
,
url
:
"{{url_for('get_update_status')}}"
,
success
:
function
(
data
)
{
if
(
data
.
status
==
true
)
{
$
(
"#check_for_update"
).
addClass
(
'hidden'
);
$
(
"#perform_update"
).
removeClass
(
'hidden'
);
}
else
{
$
(
"#check_for_update"
).
html
(
'{{_('
Check
for
update
')}}'
);
};}
});
});
</script>
{% endblock %}
cps/templates/book_edit.html
View file @
a1cca00b
...
...
@@ -4,7 +4,7 @@
<div
class=
"col-sm-3 col-lg-3 col-xs-12"
>
<div
class=
"cover"
>
{% if book.has_cover %}
<img
src=
"{{ url_for('get_cover', cover_path=book.path) }}"
/>
<img
src=
"{{ url_for('get_cover', cover_path=book.path
.replace('\\','/')
) }}"
/>
{% else %}
<img
src=
"{{ url_for('static', filename='generic_cover.jpg') }}"
/>
{% endif %}
...
...
cps/templates/search_form.html
View file @
a1cca00b
...
...
@@ -40,7 +40,7 @@
{% endfor %}
</div>
</div>
<label
for=
"
Tag
s"
>
{{_('Exclude Series')}}
</label>
<label
for=
"
Serie
s"
>
{{_('Exclude Series')}}
</label>
<div
class=
"form-group"
>
<div
class=
"btn-toolbar btn-toolbar-lg"
data-toggle=
"buttons"
>
{% for serie in series %}
...
...
@@ -81,21 +81,6 @@
<script
src=
"{{ url_for('static', filename='js/typeahead.bundle.js') }}"
></script>
<script
src=
"{{ url_for('static', filename='js/edit_books.js') }}"
></script>
<script>
$
(
'form'
)}}.
on
(
'change input typeahead:selected'
,
function
()
{
form
=
$
(
'form'
)}}.
serialize
();
$
.
getJSON
(
"{{ url_for('get_matching_tags') }}"
,
form
,
function
(
data
)
{
$
(
'.tags_click'
).
each
(
function
()
{
if
(
$
.
inArray
(
parseInt
(
$
(
this
).
children
(
'input'
).
first
().
val
(),
10
),
data
.
tags
)
==
-
1
)
{
if
(
!
(
$
(
this
).
hasClass
(
'active'
)))
{
$
(
this
).
addClass
(
'disabled'
);
}
}
else
{
$
(
this
).
removeClass
(
'disabled'
);
}
});
});
});
</script>
{% endblock %}
{% block header %}
...
...
cps/web.py
View file @
a1cca00b
...
...
@@ -421,6 +421,7 @@ def before_request():
g
.
user
=
current_user
g
.
allow_registration
=
config
.
config_public_reg
g
.
allow_upload
=
config
.
config_uploading
g
.
public_shelfes
=
ub
.
session
.
query
(
ub
.
Shelf
)
.
filter
(
ub
.
Shelf
.
is_public
==
1
)
.
all
()
if
not
config
.
db_configured
and
request
.
endpoint
not
in
(
'basic_configuration'
,
'login'
)
and
'/static/'
not
in
request
.
path
:
return
redirect
(
url_for
(
'basic_configuration'
))
...
...
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