mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-24 18:47:23 +00:00
Integrated #454 (css is loaded remote)
This commit is contained in:
parent
e24f837007
commit
671bf5cf8d
@ -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]>
|
||||
|
@ -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">
|
||||
|
Binary file not shown.
@ -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-01 19:27+0200\n"
|
||||
"POT-Creation-Date: 2018-04-02 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"
|
||||
|
10
cps/ub.py
10
cps/ub.py
@ -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:
|
||||
|
@ -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"]
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2018-04-01 19:27+0200\n"
|
||||
"POT-Creation-Date: 2018-04-02 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"
|
||||
|
Loading…
Reference in New Issue
Block a user