thiswebshoprules

git clone https://git.tarina.org/thiswebshoprules
Log | Files | Refs

commit de0b8739608fc1940a7923e5ce4111faffee6cdc
parent eb5a2544d874736a8c6ce384a47df31cb5d5c10b
Author: rob <rob@tarina.org>
Date:   Thu, 20 Feb 2025 11:27:00 +0200

update

Diffstat:
Mpublic_html/static/robstyle.css | 17++++++++++++++++-
Mpublic_html/static/splash.css | 7++++++-
Mpublic_html/templates/almost.html | 3---
Mpublic_html/templates/base.html | 4++--
Apublic_html/templates/landing.html | 16++++++++++++++++
Mpublic_html/templates/pending.html | 2+-
Mserver.py | 24++++++++++++++----------
7 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/public_html/static/robstyle.css b/public_html/static/robstyle.css @@ -42,6 +42,7 @@ body font-weight: normal; color: #f4f4f4; font-size: 11pt; + word-wrap:break-word; } a @@ -174,11 +175,23 @@ button:hover background-color: #ff0000; } + +.introtext img +{ + width: auto; +} + img { border-radius: 3px; width: 90%; - max-width: 900px; + max-width: 600px; +} + +.introtext img +{ + width: auto; + word-wrap:break-word; } #container @@ -187,6 +200,7 @@ img height: auto; max-width: 400px; text-align: center; + word-wrap:break-word; } #propaganda-container @@ -195,6 +209,7 @@ img height: auto; max-width: 1500px; text-align: center; + word-wrap:break-word; } .promopic { diff --git a/public_html/static/splash.css b/public_html/static/splash.css @@ -181,7 +181,12 @@ img { border-radius: 30px; width: 100%; - max-width: 900px; + max-width: 600px; +} + +.introtext img +{ + width: 200px; } #container diff --git a/public_html/templates/almost.html b/public_html/templates/almost.html @@ -31,9 +31,6 @@ $ siteconfig = db.select('propaganda', what='id, name, description, description2 <div class="introtext"> <br> -<code>~*~</code> -<br> -<br> <h1>$siteconfig.name</h1> $:markdown.markdown(siteconfig.description) $:markdown.markdown(siteconfig.description2) diff --git a/public_html/templates/base.html b/public_html/templates/base.html @@ -2,8 +2,8 @@ $def with (content) <!doctype html> <HEAD> <meta charset="utf-8"> - <title>Gonzo Pi | a reboot of filmmaking</title> - <link rel="stylesheet" href="/static/robstyle.css?v=139" type="text/css" rel="stylesheet"/> + <title>Gonzo Pi | free your filmmaking</title> + <link rel="stylesheet" href="/static/robstyle.css?v=185" type="text/css" rel="stylesheet"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="cache-control" content="no-cache"> </HEAD> diff --git a/public_html/templates/landing.html b/public_html/templates/landing.html @@ -0,0 +1,16 @@ +$def with (nothing) +<div id="container"> +<h2>Gonzo Pi Web Shop opening soon!</h2> +<div id="logocontainer"> +<p>for preorders contact go@gonzopi.org +$#<img class="logo" src="/static/tarina-logo.png"> +<br> +<div id="logo2"> +</div> + +</div> +<br> +<small><a href="https://github.com/rbckman/gonzopi">Gonzopi code</a> <a href="https://github.com/rbckman/gonzopi_build">Gonzopi build</a> </small> +<br> +<br> +<br> diff --git a/public_html/templates/pending.html b/public_html/templates/pending.html @@ -31,7 +31,7 @@ $if totsats > 0: Order is only reserved once paid. <br> $if ordertype() == 'digital': - <h2>Digital goods will be shipped to your email once invoice paid..</h2> + <h2>Digital goods if any will be shipped to your email once invoice paid..</h2> $else: $ shippinginfo = db.select('shipping', where="country='" + pendinginfo.country + "'", what='price, days')[0] Shipping cost to $pendinginfo.country is $eur_to_sat(shippinginfo.price) Satoshi $(shippinginfo.price/100)&euro; <br> diff --git a/server.py b/server.py @@ -135,15 +135,16 @@ def callsubprocess(cmd): def dropitems(d): i = getproduct(d) - db.update('products', where="id='"+str(i.id)+"'", available=i.available+1) try: product = db.query("SELECT * FROM customerbag WHERE sessionkey='" + session.sessionkey +"' AND product='"+str(i.id)+"';")[0] except: return 'empty' if product.quantity > 1: db.update('customerbag', where="sessionkey='" + session.sessionkey +"' and product='"+str(i.id)+"'", quantity=product.quantity-1) + db.update('products', where="id='"+str(i.id)+"'", available=i.available+1) else: db.query("DELETE FROM customerbag WHERE sessionkey='" + session.sessionkey +"' AND product='"+str(i.id)+"';") + db.update('products', where="id='"+str(i.id)+"'", available=i.available+1) return 'empty' def addtobag(p): @@ -261,13 +262,16 @@ def checkforoldbags(): print(datetime.timedelta(hours=1)) print("Fuck") product = getproduct(bag.product) - print('found a bag at door! goddamit, got to put ' + str(bag.quantity) + ' x ' + product.name + ' back on the shelf') - if product.available > 1: - q = product.available + bag.quantity - else: - q = bag.quantity - db.update('products', where="id='"+str(bag.product)+"'", available=str(q)) - db.query("DELETE FROM customerbag WHERE sessionkey='" + bag.sessionkey + "'") + try: + print('found a bag at door! goddamit, got to put ' + str(bag.quantity) + ' x ' + product.name + ' back on the shelf') + if product.available > 1: + q = product.available + bag.quantity + else: + q = bag.quantity + db.update('products', where="id='"+str(bag.product)+"'", available=str(q)) + db.query("DELETE FROM customerbag WHERE sessionkey='" + bag.sessionkey + "'") + except: + pass def checkavailable(): print('check items from availability') @@ -460,10 +464,10 @@ class checkout(): db.insert('pending', invoice_key=session.sessionkey, country=i.country, firstname=i.firstname, lastname=i.lastname, address=i.address, town=i.town, postalcode=str(i.postalcode), email=i.email, dateadded=datetime.datetime.now()) else: db.insert('pending', invoice_key=session.sessionkey, email=i.email, dateadded=datetime.datetime.now()) - if not checkoutform.validates(): - return web.seeother('/checkout?error=shipping') if '@' not in i.email: web.seeother('/checkout?error=mail') + elif not checkoutform.validates(): + return web.seeother('/checkout?error=shipping') else: return web.seeother('/pending')