From c7e38a7f22c4603e15a77a71ea9d34a8ee797116 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sat, 18 Nov 2023 19:05:50 +1100 Subject: [PATCH] feat: Add empty site page --- sites/website.py | 12 ++++---- templates/account.html | 4 +-- templates/edit.html | 4 +-- templates/empty_site.html | 62 +++++++++++++++++++++++++++++++++++++++ templates/error.html | 4 +-- templates/hnschat.html | 4 +-- templates/index.html | 4 +-- templates/login.html | 4 +-- templates/signup.html | 4 +-- 9 files changed, 81 insertions(+), 21 deletions(-) create mode 100644 templates/empty_site.html diff --git a/sites/website.py b/sites/website.py index 427f466..6d56943 100644 --- a/sites/website.py +++ b/sites/website.py @@ -3,7 +3,7 @@ from bs4 import BeautifulSoup import os import dotenv -main_domain = "cities.hnshosting.au" +main_domain = "shakecities.com" if os.getenv('MAIN_DOMAIN') != None: main_domain = os.getenv('MAIN_DOMAIN') @@ -15,6 +15,8 @@ if os.path.exists("parts/footer.html"): def render(data,db_object): if data == False: return redirect("https://" + main_domain + '/claim?domain=' + request.host.split('.')[0]) + elif data == "": + return redirect("https://" + main_domain + '/empty_site') # Render as HTML html = "" @@ -24,16 +26,12 @@ def render(data,db_object): try: soup = BeautifulSoup(data, 'html.parser') - - # for script in soup.find_all('script'): - # script.extract() - # Inject SSL soup.append(BeautifulSoup(ssl, 'html.parser')) html = str(soup) except Exception as e: - return "

Invalid HTML


" + str(e) + return redirect("https://" + main_domain + '/empty_site') try: avatar = db_object['avatar'] @@ -106,7 +104,7 @@ def render(data,db_object): hns=hns,btc=btc,eth=eth, data=html,footer=footer) except Exception as e: - return "

Nothing here yet

" + "" + return redirect("https://" + main_domain + '/empty_site') def get_template(template,hide_addresses=False): file = "templates/" +get_template_file(template) diff --git a/templates/account.html b/templates/account.html index 0224461..f0ccd41 100644 --- a/templates/account.html +++ b/templates/account.html @@ -45,9 +45,9 @@
-
+
    -
  • Copyright © ShakeCities 2023
  • +
  • Copyright © ShakeCities 2023
diff --git a/templates/edit.html b/templates/edit.html index c8d84df..b74424a 100644 --- a/templates/edit.html +++ b/templates/edit.html @@ -68,9 +68,9 @@
-
+
    -
  • Copyright © ShakeCities 2023
  • +
  • Copyright © ShakeCities 2023
diff --git a/templates/empty_site.html b/templates/empty_site.html new file mode 100644 index 0000000..7fb00ab --- /dev/null +++ b/templates/empty_site.html @@ -0,0 +1,62 @@ + + + + + + + ShakeCities + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+

Nothing here yet

+
Back +
+
+
+
+
+
    +
  • Copyright © ShakeCities 2023
  • +
  • +
  • +
+
+
+ + + + + \ No newline at end of file diff --git a/templates/error.html b/templates/error.html index 2289a4a..2baf19d 100644 --- a/templates/error.html +++ b/templates/error.html @@ -48,9 +48,9 @@
-
+
    -
  • Copyright © ShakeCities 2023
  • +
  • Copyright © ShakeCities 2023
diff --git a/templates/hnschat.html b/templates/hnschat.html index ee9a3e3..2ea1c7e 100644 --- a/templates/hnschat.html +++ b/templates/hnschat.html @@ -49,9 +49,9 @@
-
+
    -
  • Copyright © ShakeCities 2023
  • +
  • Copyright © ShakeCities 2023
diff --git a/templates/index.html b/templates/index.html index f0f9c26..ed9e503 100644 --- a/templates/index.html +++ b/templates/index.html @@ -97,9 +97,9 @@
-
+
    -
  • Copyright © ShakeCities 2023
  • +
  • Copyright © ShakeCities 2023
diff --git a/templates/login.html b/templates/login.html index ace81c5..c34bcd0 100644 --- a/templates/login.html +++ b/templates/login.html @@ -48,9 +48,9 @@
-
+
    -
  • Copyright © ShakeCities 2023
  • +
  • Copyright © ShakeCities 2023
diff --git a/templates/signup.html b/templates/signup.html index d738c2a..17ecfe4 100644 --- a/templates/signup.html +++ b/templates/signup.html @@ -50,9 +50,9 @@
-
+
    -
  • Copyright © ShakeCities 2023
  • +
  • Copyright © ShakeCities 2023