diff --git a/media/stregsystem/background.png b/media/stregsystem/background.png new file mode 100644 index 00000000..6511a316 Binary files /dev/null and b/media/stregsystem/background.png differ diff --git a/stregsystem/purchase_heatmap.py b/stregsystem/purchase_heatmap.py index 975bc2b5..dcfbf65e 100644 --- a/stregsystem/purchase_heatmap.py +++ b/stregsystem/purchase_heatmap.py @@ -79,7 +79,7 @@ def __init__(self, max_items_day: int): super().__init__(mode_name="ItemCount", mode_description="Antal") def get_day_color(self, products: List[Product]) -> Tuple[int, int, int]: - if len(products) == 0: + if len(products) == 0 or self.max_items_day == 0: return 235, 237, 240 # Grey lerp_value = len(products) / self.max_items_day @@ -107,7 +107,7 @@ def __init__(self, max_money_day_oere: int): super().__init__(mode_name="MoneySum", mode_description="Penge brugt") def get_day_color(self, products: List[Product]) -> Tuple[int, int, int]: - if len(products) == 0: + if len(products) == 0 or self.max_money_day_oere == 0: return 235, 237, 240 # Grey day_sum = sum(p.price for p in products) @@ -116,7 +116,7 @@ def get_day_color(self, products: List[Product]) -> Tuple[int, int, int]: return lerp_color((255, 255, 200), (255, 255, 0), lerp_value) # Lightyellow - Yellow def get_day_summary(self, products: List[Product]) -> str: - return f"{money(sum(p.price for p in products))} F$ brugt" + return f"{money(sum(p.price for p in products))} 𝓕$ brugt" @staticmethod def get_products_money_sum(day_list: List[Tuple[date, List[Product]]]) -> int: diff --git a/stregsystem/static/stregsystem/snow.js b/stregsystem/static/stregsystem/snow.js index 1c563652..cc2d9f44 100644 --- a/stregsystem/static/stregsystem/snow.js +++ b/stregsystem/static/stregsystem/snow.js @@ -24,7 +24,7 @@ function SpawnSnowflake () { function SetBodyChristmasStyle() { const bodyStyle = document.body.style; bodyStyle.color = "white"; - bodyStyle.backgroundImage = "url(\"" + media_url + "stregsystem/background.jpg\")"; + bodyStyle.backgroundImage = "url(\"" + media_url + "stregsystem/background.png\")"; bodyStyle.backgroundRepeat = "repeat-x"; bodyStyle.backgroundSize = "auto 100%"; bodyStyle.padding = "0"; diff --git a/treo/settings.py b/treo/settings.py index dd578014..a0f5af18 100644 --- a/treo/settings.py +++ b/treo/settings.py @@ -49,7 +49,8 @@ [logging] HANDLERS = [ - "console" + "console", + "file" ] FILE = stregsystem.log LEVEL = DEBUG