1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-07 10:43:55 +00:00

Start refactor sidebar and view settings sidebar

This commit is contained in:
Ozzieisaacs
2019-03-03 19:42:17 +01:00
parent fb23db57b4
commit f0de822ce7
6 changed files with 58 additions and 40 deletions

View File

@@ -156,6 +156,9 @@ class UserBase:
def filter_language(self):
return self.default_language
def check_visibility(self, value):
return bool((self.sidebar_view is not None) and (self.sidebar_view & value == value))
def show_random_books(self):
return bool((self.sidebar_view is not None)and(self.sidebar_view & SIDEBAR_RANDOM == SIDEBAR_RANDOM))
@@ -548,6 +551,10 @@ class Config:
return bool((self.config_default_show is not None) and
(self.config_default_show & DETAIL_RANDOM == DETAIL_RANDOM))
def show_element(self, value):
return bool((self.config_default_show is not None) and
(self.config_default_show & value == value))
def show_language(self):
return bool((self.config_default_show is not None) and
(self.config_default_show & SIDEBAR_LANGUAGE == SIDEBAR_LANGUAGE))