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
671bf5cf
Commit
671bf5cf
authored
Apr 02, 2018
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrated #454 (css is loaded remote)
parent
e24f8370
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
7 deletions
+30
-7
layout.html
cps/templates/layout.html
+3
-1
user_edit.html
cps/templates/user_edit.html
+8
-0
messages.mo
cps/translations/de/LC_MESSAGES/messages.mo
+0
-0
messages.po
cps/translations/de/LC_MESSAGES/messages.po
+5
-5
ub.py
cps/ub.py
+10
-0
web.py
cps/web.py
+3
-0
messages.pot
messages.pot
+1
-1
No files found.
cps/templates/layout.html
View file @
671bf5cf
...
...
@@ -12,7 +12,9 @@
<link
rel=
"shortcut icon"
href=
"{{ url_for('static', filename='favicon.ico') }}"
>
<link
href=
"{{ url_for('static', filename='css/libs/bootstrap.min.css') }}"
rel=
"stylesheet"
media=
"screen"
>
<link
href=
"{{ url_for('static', filename='css/style.css') }}"
rel=
"stylesheet"
media=
"screen"
>
{% if g.user.get_theme == 1 %}
<link
href=
"https://rawgit.com/leram84/layer.Cake/dev/CSS/caliBlur-Demo.css"
rel=
"stylesheet"
media=
"screen"
>
{% endif %}
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
...
...
cps/templates/user_edit.html
View file @
671bf5cf
...
...
@@ -31,6 +31,14 @@
{% endfor %}
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"theme"
>
{{_('Theme')}}
</label>
<select
name=
"theme"
id=
"theme"
class=
"form-control"
>
<option
value=
"0"
{%
if
content
.
get_theme =
=
0
%}
selected
{%
endif
%}
>
{{ _("Standard Theme") }}
</option>
<option
value=
"1"
{%
if
content
.
get_theme =
=
1
%}
selected
{%
endif
%}
>
{{ _("caliBlur! Dark Theme (Beta)") }}
</option>
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"default_language"
>
{{_('Show books with language')}}
</label>
<select
name=
"default_language"
id=
"default_language"
class=
"form-control"
>
...
...
cps/translations/de/LC_MESSAGES/messages.mo
View file @
671bf5cf
No preview for this file type
cps/translations/de/LC_MESSAGES/messages.po
View file @
671bf5cf
...
...
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/calibre-web\n"
"POT-Creation-Date: 2018-04-0
1 19:27
+0200\n"
"POT-Creation-Date: 2018-04-0
2 09:35
+0200\n"
"PO-Revision-Date: 2016-07-12 19:54+0200\n"
"Last-Translator: Ozzie Isaacs\n"
"Language: de\n"
...
...
@@ -1166,11 +1166,11 @@ msgstr "Registrieren"
#: cps/templates/layout.html:103
msgid "Uploading..."
msgstr ""
msgstr "
Hochladen...
"
#: cps/templates/layout.html:104
msgid "please don't refresh the page"
msgstr ""
msgstr "
Bitte die Seite nicht neu laden
"
#: cps/templates/layout.html:115
msgid "Browse"
...
...
@@ -1317,11 +1317,11 @@ msgstr "Ergebnisse für:"
#: cps/templates/search_form.html:20
msgid "Publishing date from"
msgstr ""
msgstr "
Herausgabedatum von
"
#: cps/templates/search_form.html:27
msgid "Publishing date to"
msgstr ""
msgstr "
Herausgabedatum bis
"
#: cps/templates/search_form.html:44
msgid "Exclude Tags"
...
...
cps/ub.py
View file @
671bf5cf
...
...
@@ -105,6 +105,10 @@ class UserBase:
def
is_anonymous
(
self
):
return
False
@
property
def
get_theme
(
self
):
return
self
.
theme
def
get_id
(
self
):
return
str
(
self
.
id
)
...
...
@@ -165,6 +169,7 @@ class User(UserBase, Base):
sidebar_view
=
Column
(
Integer
,
default
=
1
)
default_language
=
Column
(
String
(
3
),
default
=
"all"
)
mature_content
=
Column
(
Boolean
,
default
=
True
)
theme
=
Column
(
Integer
,
default
=
0
)
# Class for anonymous user is derived from User base and complets overrides methods and properties for the
...
...
@@ -598,6 +603,11 @@ def migrate_Database():
except
exc
.
OperationalError
:
conn
=
engine
.
connect
()
conn
.
execute
(
"ALTER TABLE user ADD column `mature_content` INTEGER DEFAULT 1"
)
try
:
session
.
query
(
exists
()
.
where
(
User
.
theme
))
.
scalar
()
except
exc
.
OperationalError
:
conn
=
engine
.
connect
()
conn
.
execute
(
"ALTER TABLE user ADD column `theme` INTEGER DEFAULT 0"
)
if
session
.
query
(
User
)
.
filter
(
User
.
role
.
op
(
'&'
)(
ROLE_ANONYMOUS
)
==
ROLE_ANONYMOUS
)
.
first
()
is
None
:
create_anonymous_user
()
try
:
...
...
cps/web.py
View file @
671bf5cf
...
...
@@ -2446,6 +2446,7 @@ def profile():
content
.
sidebar_view
+=
ub
.
DETAIL_RANDOM
content
.
mature_content
=
"show_mature_content"
in
to_save
content
.
theme
=
int
(
to_save
[
"theme"
])
try
:
ub
.
session
.
commit
()
...
...
@@ -2723,6 +2724,7 @@ def new_user():
content
.
email
=
to_save
[
"email"
]
content
.
default_language
=
to_save
[
"default_language"
]
content
.
mature_content
=
"show_mature_content"
in
to_save
content
.
theme
=
int
(
to_save
[
"theme"
])
if
"locale"
in
to_save
:
content
.
locale
=
to_save
[
"locale"
]
content
.
sidebar_view
=
0
...
...
@@ -2931,6 +2933,7 @@ def edit_user(user_id):
content
.
sidebar_view
-=
ub
.
DETAIL_RANDOM
content
.
mature_content
=
"show_mature_content"
in
to_save
content
.
theme
=
int
(
to_save
[
"theme"
])
if
"default_language"
in
to_save
:
content
.
default_language
=
to_save
[
"default_language"
]
...
...
messages.pot
View file @
671bf5cf
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2018-04-0
1 19:27
+0200\n"
"POT-Creation-Date: 2018-04-0
2 09:35
+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
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