1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-28 12:30:00 +00:00

Integrated #454 (css is loaded remote)

This commit is contained in:
OzzieIsaacs 2018-04-02 10:09:19 +02:00
parent e24f837007
commit 671bf5cf8d
7 changed files with 30 additions and 7 deletions

View File

@ -12,7 +12,9 @@
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"> <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/libs/bootstrap.min.css') }}" rel="stylesheet" media="screen">
<link href="{{ url_for('static', filename='css/style.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 --> <!-- 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:// --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]> <!--[if lt IE 9]>

View File

@ -31,6 +31,14 @@
{% endfor %} {% endfor %}
</select> </select>
</div> </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"> <div class="form-group">
<label for="default_language">{{_('Show books with language')}}</label> <label for="default_language">{{_('Show books with language')}}</label>
<select name="default_language" id="default_language" class="form-control"> <select name="default_language" id="default_language" class="form-control">

View File

@ -21,7 +21,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-web\n" "Project-Id-Version: Calibre-web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/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" "PO-Revision-Date: 2016-07-12 19:54+0200\n"
"Last-Translator: Ozzie Isaacs\n" "Last-Translator: Ozzie Isaacs\n"
"Language: de\n" "Language: de\n"
@ -1166,11 +1166,11 @@ msgstr "Registrieren"
#: cps/templates/layout.html:103 #: cps/templates/layout.html:103
msgid "Uploading..." msgid "Uploading..."
msgstr "" msgstr "Hochladen..."
#: cps/templates/layout.html:104 #: cps/templates/layout.html:104
msgid "please don't refresh the page" msgid "please don't refresh the page"
msgstr "" msgstr "Bitte die Seite nicht neu laden"
#: cps/templates/layout.html:115 #: cps/templates/layout.html:115
msgid "Browse" msgid "Browse"
@ -1317,11 +1317,11 @@ msgstr "Ergebnisse für:"
#: cps/templates/search_form.html:20 #: cps/templates/search_form.html:20
msgid "Publishing date from" msgid "Publishing date from"
msgstr "" msgstr "Herausgabedatum von"
#: cps/templates/search_form.html:27 #: cps/templates/search_form.html:27
msgid "Publishing date to" msgid "Publishing date to"
msgstr "" msgstr "Herausgabedatum bis"
#: cps/templates/search_form.html:44 #: cps/templates/search_form.html:44
msgid "Exclude Tags" msgid "Exclude Tags"

View File

@ -105,6 +105,10 @@ class UserBase:
def is_anonymous(self): def is_anonymous(self):
return False return False
@property
def get_theme(self):
return self.theme
def get_id(self): def get_id(self):
return str(self.id) return str(self.id)
@ -165,6 +169,7 @@ class User(UserBase, Base):
sidebar_view = Column(Integer, default=1) sidebar_view = Column(Integer, default=1)
default_language = Column(String(3), default="all") default_language = Column(String(3), default="all")
mature_content = Column(Boolean, default=True) 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 # 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: except exc.OperationalError:
conn = engine.connect() conn = engine.connect()
conn.execute("ALTER TABLE user ADD column `mature_content` INTEGER DEFAULT 1") 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: if session.query(User).filter(User.role.op('&')(ROLE_ANONYMOUS) == ROLE_ANONYMOUS).first() is None:
create_anonymous_user() create_anonymous_user()
try: try:

View File

@ -2446,6 +2446,7 @@ def profile():
content.sidebar_view += ub.DETAIL_RANDOM content.sidebar_view += ub.DETAIL_RANDOM
content.mature_content = "show_mature_content" in to_save content.mature_content = "show_mature_content" in to_save
content.theme = int(to_save["theme"])
try: try:
ub.session.commit() ub.session.commit()
@ -2723,6 +2724,7 @@ def new_user():
content.email = to_save["email"] content.email = to_save["email"]
content.default_language = to_save["default_language"] content.default_language = to_save["default_language"]
content.mature_content = "show_mature_content" in to_save content.mature_content = "show_mature_content" in to_save
content.theme = int(to_save["theme"])
if "locale" in to_save: if "locale" in to_save:
content.locale = to_save["locale"] content.locale = to_save["locale"]
content.sidebar_view = 0 content.sidebar_view = 0
@ -2931,6 +2933,7 @@ def edit_user(user_id):
content.sidebar_view -= ub.DETAIL_RANDOM content.sidebar_view -= ub.DETAIL_RANDOM
content.mature_content = "show_mature_content" in to_save content.mature_content = "show_mature_content" in to_save
content.theme = int(to_save["theme"])
if "default_language" in to_save: if "default_language" in to_save:
content.default_language = to_save["default_language"] content.default_language = to_save["default_language"]

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"