From b805c3e65529c9c7e2c28afabdc6d111b756470c Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 20 Nov 2023 11:51:44 +1100 Subject: [PATCH] feat: Add new templates with donate footer --- PLACEHOLDERS.md | 2 +- main.py | 10 +++- sites/parts/footer.html | 2 +- sites/website.py | 8 ++- template.py | 7 ++- templates/city_donate_footer.html | 66 +++++++++++++++++++++ templates/city_no_card_donate_footer.html | 70 +++++++++++++++++++++++ 7 files changed, 157 insertions(+), 8 deletions(-) create mode 100644 templates/city_donate_footer.html create mode 100644 templates/city_no_card_donate_footer.html diff --git a/PLACEHOLDERS.md b/PLACEHOLDERS.md index 036a865..beb90b1 100644 --- a/PLACEHOLDERS.md +++ b/PLACEHOLDERS.md @@ -87,7 +87,7 @@ This is the main body ## Crypto Address Placeholders ### Icons These are the icons for the crypto addresses. -There are 2 versions of each icon. One with a contrast to the foreground colour and one without. +There are 2 versions of each icon. One with a contrast to the background colour and one without. These return the path to the image of the icon (eg. `assets/img/HNS.png`) diff --git a/main.py b/main.py index af10f2f..2f1654a 100644 --- a/main.py +++ b/main.py @@ -34,7 +34,15 @@ if IMAGE_LOCATION == None: random_sites = "" # Templates available for user -templates = ['Standard', 'Original', 'No card around data', 'No card around data (2)','Blank'] +templates = [ + 'Standard', + 'Original', + 'No card around data', + 'No card around data (2)', + 'Blank', + 'Standard with donate footer' + 'No card with donate footer' + ] #Assets routes @app.route('/assets/') diff --git a/sites/parts/footer.html b/sites/parts/footer.html index 8ec9b95..100b9ba 100644 --- a/sites/parts/footer.html +++ b/sites/parts/footer.html @@ -1,4 +1,4 @@ -
+
diff --git a/sites/website.py b/sites/website.py index 030b798..03c0b9e 100644 --- a/sites/website.py +++ b/sites/website.py @@ -52,7 +52,7 @@ def render(data,db_object): bg_colour = db_object['bg_colour'] fg_colour = db_object['fg_colour'] text_colour = db_object['text_colour'] - if (rgb_to_hex(generate_foreground_color(text_colour)) == "#000000"): + if (rgb_to_hex(generate_foreground_color(bg_colour)) == "#000000"): hns_icon = "assets/img/HNSW.png" btc_icon = "assets/img/BTCW.png" eth_icon = "assets/img/ETHW.png" @@ -82,7 +82,7 @@ def render(data,db_object): if eth != "": eth = "" + eth eth_invert = "" + eth_address - + hide_addresses = False if hns == "" and btc == "" and eth == "": @@ -187,7 +187,9 @@ def get_template_file(template): "original": "city_old.html", "no card around data": "city_no_card.html", "no card around data (2)": "city_no_card_2.html", - "blank": "city_blank.html" + "blank": "city_blank.html", + "standard with donate footer": "city_donate_footer.html", + "no card with donate footer": "city_no_card_donate_footer.html", } if template in templates: diff --git a/template.py b/template.py index bccf8a0..673a7df 100644 --- a/template.py +++ b/template.py @@ -16,8 +16,11 @@ db_object = { 'BTC': "bc1qhs94zzcw64qnwq4hvk056rwxwvgrkd7tq7d4xw", 'ETH' : "0x6cB4B39bEc23a921C9a20D061Bf17d4640B0d39e", 'bg_colour': "#000000", - 'fg_colour': "#ffffff", - 'text_colour': "#152D45", + # 'fg_colour': "#ffffff", + # 'text_colour': "#152D45", + 'text_colour': "#ffffff", + 'fg_colour': "#8f00db", + } @app.route('/') diff --git a/templates/city_donate_footer.html b/templates/city_donate_footer.html new file mode 100644 index 0000000..5a2f751 --- /dev/null +++ b/templates/city_donate_footer.html @@ -0,0 +1,66 @@ + + + + + + + ShakeCities + + + + + + + + + + + + + + + + + + + + + +
+
{{avatar|safe}}
+
+
+

{{hnschat|safe}}

+
+
+

{{email|safe}}

+
+
+

{{location|safe}}

+
+
+
+
+

{{data|safe}}

+
+
+

+ + + + + + + + + +

+
+ + + {{footer | safe}} + + + + + \ No newline at end of file diff --git a/templates/city_no_card_donate_footer.html b/templates/city_no_card_donate_footer.html new file mode 100644 index 0000000..850b6ac --- /dev/null +++ b/templates/city_no_card_donate_footer.html @@ -0,0 +1,70 @@ + + + + + + + ShakeCities + + + + + + + + + + + + + + + + + + + + + + + +
+
{{avatar|safe}}
+
+

{{hnschat|safe}}

+

{{email|safe}}

+

{{location|safe}}

+
+
+
+

+ {{data|safe}} +

+
+ +
+

+ + + + + + + + + +

+
+ + {{footer|safe}} + + + + + \ No newline at end of file