Skip to content

Commit

Permalink
Merge branch 'next' into temp-file-configuration-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
krestenlaust authored Dec 3, 2023
2 parents 5e035a2 + b4e5479 commit 691beb9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Binary file added media/stregsystem/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions stregsystem/purchase_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion stregsystem/static/stregsystem/snow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
3 changes: 2 additions & 1 deletion treo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
[logging]
HANDLERS = [
"console"
"console",
"file"
]
FILE = stregsystem.log
LEVEL = DEBUG
Expand Down

0 comments on commit 691beb9

Please sign in to comment.