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
1a83bddf
Commit
1a83bddf
authored
Dec 27, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Plain Diff
Merge bubble read status
parents
2a63c357
4d81d361
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
76 additions
and
16 deletions
+76
-16
helper.py
cps/helper.py
+0
-1
render_template.py
cps/render_template.py
+19
-2
caliBlur_override.css
cps/static/css/caliBlur_override.css
+6
-1
style.css
cps/static/css/style.css
+24
-5
author.html
cps/templates/author.html
+4
-1
discover.html
cps/templates/discover.html
+4
-1
grid.html
cps/templates/grid.html
+4
-2
index.html
cps/templates/index.html
+7
-1
search.html
cps/templates/search.html
+4
-1
shelf.html
cps/templates/shelf.html
+4
-1
No files found.
cps/helper.py
View file @
1a83bddf
...
...
@@ -824,4 +824,3 @@ def get_download_link(book_id, book_format, client):
return
do_download_file
(
book
,
book_format
,
client
,
data1
,
headers
)
else
:
abort
(
404
)
cps/render_template.py
View file @
1a83bddf
...
...
@@ -20,11 +20,14 @@ from flask import render_template
from
flask_babel
import
gettext
as
_
from
flask
import
g
from
werkzeug.local
import
LocalProxy
from
flask_login
import
current_user
from
.
import
config
,
constants
from
.
import
config
,
constants
,
ub
,
logger
,
db
,
calibre_db
from
.ub
import
User
log
=
logger
.
create
()
def
get_sidebar_config
(
kwargs
=
None
):
kwargs
=
kwargs
or
[]
if
'content'
in
kwargs
:
...
...
@@ -91,9 +94,23 @@ def get_sidebar_config(kwargs=None):
return
sidebar
def
get_readbooks_ids
():
if
not
config
.
config_read_column
:
readBooks
=
ub
.
session
.
query
(
ub
.
ReadBook
)
.
filter
(
ub
.
ReadBook
.
user_id
==
int
(
current_user
.
id
))
\
.
filter
(
ub
.
ReadBook
.
read_status
==
ub
.
ReadBook
.
STATUS_FINISHED
)
.
all
()
return
frozenset
([
x
.
book_id
for
x
in
readBooks
])
else
:
try
:
readBooks
=
calibre_db
.
session
.
query
(
db
.
cc_classes
[
config
.
config_read_column
])
\
.
filter
(
db
.
cc_classes
[
config
.
config_read_column
]
.
value
==
True
)
.
all
()
return
frozenset
([
x
.
book
for
x
in
readBooks
])
except
KeyError
:
log
.
error
(
"Custom Column No.
%
d is not existing in calibre database"
,
config
.
config_read_column
)
return
[]
# Returns the template for rendering and includes the instance name
def
render_title_template
(
*
args
,
**
kwargs
):
sidebar
=
get_sidebar_config
(
kwargs
)
return
render_template
(
instance
=
config
.
config_calibre_web_title
,
sidebar
=
sidebar
,
accept
=
constants
.
EXTENSIONS_UPLOAD
,
accept
=
constants
.
EXTENSIONS_UPLOAD
,
read_book_ids
=
get_readbooks_ids
(),
*
args
,
**
kwargs
)
cps/static/css/caliBlur_override.css
View file @
1a83bddf
body
.serieslist.grid-view
div
.container-fluid
>
div
>
div
.col-sm-10
:before
{
display
:
none
;
}
.cover
.badge
{
position
:
absolute
;
top
:
0
;
left
:
0
;
color
:
#fff
;
background-color
:
#cc7b19
;
border-radius
:
0
;
padding
:
0
8px
;
...
...
@@ -15,3 +15,8 @@ body.serieslist.grid-view div.container-fluid>div>div.col-sm-10:before{
.cover
{
box-shadow
:
0
0
4px
rgba
(
0
,
0
,
0
,
.6
);
}
.cover
.read
{
padding
:
0
0px
;
line-height
:
15px
;
}
cps/static/css/style.css
View file @
1a83bddf
...
...
@@ -116,6 +116,7 @@ a, .danger,.book-remove, .editable-empty, .editable-empty:hover { color: #45b29d
display
:
block
;
max-width
:
100%
;
height
:
auto
;
max-height
:
100%
;
}
.container-fluid
.discover
{
margin-bottom
:
50px
;
}
...
...
@@ -132,12 +133,19 @@ a, .danger,.book-remove, .editable-empty, .editable-empty:hover { color: #45b29d
position
:
relative
;
}
.container-fluid
.book
.cover
img
{
border
:
1px
solid
#fff
;
box-sizing
:
border-box
;
height
:
100%
;
.container-fluid
.book
.cover
span
.img
{
bottom
:
0
;
height
:
100%
;
position
:
absolute
;
}
.container-fluid
.book
.cover
span
img
{
position
:
relative
;
top
:
0
;
left
:
0
;
height
:
100%
;
border
:
1px
solid
#fff
;
box-sizing
:
border-box
;
-webkit-box-shadow
:
0
5px
8px
-6px
#777
;
-moz-box-shadow
:
0
5px
8px
-6px
#777
;
box-shadow
:
0
5px
8px
-6px
#777
;
...
...
@@ -206,11 +214,22 @@ span.glyphicon.glyphicon-tags {
.navbar-default
.navbar-toggle
.icon-bar
{
background-color
:
#000
;
}
.navbar-default
.navbar-toggle
{
border-color
:
#000
;
}
.cover
{
margin-bottom
:
10px
;
}
.cover
.badge
{
position
:
absolute
;
top
:
2px
;
left
:
2px
;
background-color
:
#777
;
color
:
#000
;
border-radius
:
10px
;
background-color
:
#fff
;
}
.cover
.read
{
left
:
auto
;
right
:
2px
;
width
:
17px
;
height
:
17px
;
display
:
inline-block
;
padding
:
2px
;
}
.cover-height
{
max-height
:
100px
;}
...
...
cps/templates/author.html
View file @
1a83bddf
...
...
@@ -36,7 +36,10 @@
<div
id=
"books"
class=
"col-sm-3 col-lg-2 col-xs-6 book"
>
<div
class=
"cover"
>
<a
href=
"{{ url_for('web.show_book', book_id=entry.id) }}"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
/>
<span
class=
"img"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
/>
{% if entry.id in read_book_ids %}
<span
class=
"badge read glyphicon glyphicon-ok"
></span>
{% endif %}
</span>
</a>
</div>
<div
class=
"meta"
>
...
...
cps/templates/discover.html
View file @
1a83bddf
...
...
@@ -8,7 +8,10 @@
<div
class=
"cover"
>
{% if entry.has_cover is defined %}
<a
href=
"{{ url_for('web.show_book', book_id=entry.id) }}"
data-toggle=
"modal"
data-target=
"#bookDetailsModal"
data-remote=
"false"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
<span
class=
"img"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
{% if entry.id in read_book_ids %}
<span
class=
"badge read glyphicon glyphicon-ok"
></span>
{% endif %}
</span>
</a>
{% endif %}
</div>
...
...
cps/templates/grid.html
View file @
1a83bddf
...
...
@@ -28,8 +28,10 @@
<div
class=
"col-sm-3 col-lg-2 col-xs-6 book sortable"
{%
if
entry
[
0
].
sort
%}
data-name=
"{{entry[0].series[0].name}}"
{%
endif
%}
data-id=
"{% if entry[0].series[0].name %}{{entry[0].series[0].name}}{% endif %}"
>
<div
class=
"cover"
>
<a
href=
"{{url_for('web.books_list', data=data, sort_param='new', book_id=entry[0].series[0].id )}}"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry[0].id) }}"
alt=
"{{ entry[0].name }}"
/>
<span
class=
"badge"
>
{{entry.count}}
</span>
<span
class=
"img"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry[0].id) }}"
alt=
"{{ entry[0].name }}"
/>
<span
class=
"badge"
>
{{entry.count}}
</span>
</span>
</a>
</div>
<div
class=
"meta"
>
...
...
cps/templates/index.html
View file @
1a83bddf
...
...
@@ -8,7 +8,10 @@
<div
class=
"col-sm-3 col-lg-2 col-xs-6 book"
id=
"books_rand"
>
<div
class=
"cover"
>
<a
href=
"{{ url_for('web.show_book', book_id=entry.id) }}"
data-toggle=
"modal"
data-target=
"#bookDetailsModal"
data-remote=
"false"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
<span
class=
"img"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
{% if entry.id in read_book_ids %}
<span
class=
"badge read glyphicon glyphicon-ok"
></span>
{% endif %}
</span>
</a>
</div>
<div
class=
"meta"
>
...
...
@@ -82,7 +85,10 @@
<div
class=
"col-sm-3 col-lg-2 col-xs-6 book"
id=
"books"
>
<div
class=
"cover"
>
<a
href=
"{{ url_for('web.show_book', book_id=entry.id) }}"
data-toggle=
"modal"
data-target=
"#bookDetailsModal"
data-remote=
"false"
>
<span
class=
"img"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
{% if entry.id in read_book_ids %}
<span
class=
"badge read glyphicon glyphicon-ok"
></span>
{% endif %}
</span>
</a>
</div>
<div
class=
"meta"
>
...
...
cps/templates/search.html
View file @
1a83bddf
...
...
@@ -43,7 +43,10 @@
<div
class=
"cover"
>
{% if entry.has_cover is defined %}
<a
href=
"{{ url_for('web.show_book', book_id=entry.id) }}"
data-toggle=
"modal"
data-target=
"#bookDetailsModal"
data-remote=
"false"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
<span
class=
"img"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
{% if entry.id in read_book_ids %}
<span
class=
"badge read glyphicon glyphicon-ok"
></span>
{% endif %}
</span>
</a>
{% endif %}
</div>
...
...
cps/templates/shelf.html
View file @
1a83bddf
...
...
@@ -30,7 +30,10 @@
<div
class=
"col-sm-3 col-lg-2 col-xs-6 book"
>
<div
class=
"cover"
>
<a
href=
"{{ url_for('web.show_book', book_id=entry.id) }}"
data-toggle=
"modal"
data-target=
"#bookDetailsModal"
data-remote=
"false"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
<span
class=
"img"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
{% if entry.id in read_book_ids %}
<span
class=
"badge read glyphicon glyphicon-ok"
></span>
{% endif %}
</span>
</a>
</div>
<div
class=
"meta"
>
...
...
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