thiswebshoprules

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

commit ea6054fb64483271ca80e1eb2f8865c76446ae61
parent e93056364836da1d22d27b0e5ddbdedb5e290611
Author: rob <rob@tarina.org>
Date:   Thu,  7 Mar 2024 17:04:00 +0200

yeah v0.1

Diffstat:
Mpublic_html/templates/base.html | 2+-
Mpublic_html/templates/bigpic.html | 5++---
Mpublic_html/templates/checkout.html | 4++--
Mpublic_html/templates/index.html | 7+++----
Mpublic_html/templates/splash.html | 2+-
Mserver.py | 11+++++++----
Dsettings.py | 16----------------
Asettings.py.sample | 17+++++++++++++++++
8 files changed, 33 insertions(+), 31 deletions(-)

diff --git a/public_html/templates/base.html b/public_html/templates/base.html @@ -2,7 +2,7 @@ $def with (content) <!doctype html> <HEAD> <meta charset="utf-8"> - <title>Gonzo Pi | a retake on filmmaking</title> + <title>Gonzo Pi | a reboot of filmmaking</title> <link rel="stylesheet" href="/static/robstyle.css?v=127" type="text/css" rel="stylesheet"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="cache-control" content="no-cache"> diff --git a/public_html/templates/bigpic.html b/public_html/templates/bigpic.html @@ -1,6 +1,5 @@ $def with (p,name,goodies) $for i in goodies: - <a href="/#$p"><-- back</a> | <a href="/static/upload/$i.soundlink/$i.soundname">Full image resolution</a><br> - <a href="/#$p"><img class="imgprod" width="100%" src="/static/img/web/$i.soundname"></a><br> - <a href="/#$p"><-- back</a><br> + <a href="/static/upload/$i.soundlink/$i.soundname""><img class="imgprod" width="100%" src="/static/img/web/$i.soundname"></a><br> + <a href="/shop#$p"><-- back</a><br> diff --git a/public_html/templates/checkout.html b/public_html/templates/checkout.html @@ -3,7 +3,7 @@ $ totsats = 0 $ toteuro = 0 <div id="container"> <div id="default"> -<a href="javascript:history.back()">go back</a> +<a href="/shop">go back</a> <br> <h2>Checkout</h2> in your order:<br> @@ -34,7 +34,7 @@ Order is only reserved once paid. $:checkoutform.render() </form> </div> -<a href="javascript:history.back()"><<<<<< back shoppin for more!!</a> +<a href="/shop"><<<<<< back shoppin for more!!</a> </div> </div> </div> diff --git a/public_html/templates/index.html b/public_html/templates/index.html @@ -13,7 +13,7 @@ $if sessionkey != 'empty': p_totsats=i.quantity*price[0] p_toteuro=i.quantity*price[1] $i.quantity x $productname(i.product) - $#$p_totsats $p_toteuro&euro; <a href="/dropitem/$i.product">remove</a> + $#$p_totsats $p_toteuro&euro; <a href="/shop/dropitem/$i.product">remove</a> <a href="/dropitem/$i.product">remove</a> <br> $code: @@ -27,13 +27,12 @@ $if sessionkey != 'empty': </div> </div> - $ siteconfig = db.select('siteconfig', what='id, name, description, description2')[0] $ categories = db.select('categories', what='id, category') <div id="container"> <div class="intro"> -$#<img src="/static/img/thumb/logo.png"> +<img style="width:100px;" src="/static/img/thumb/logo.png"> <br> <code>~*~</code> <br> @@ -75,7 +74,7 @@ $for i in products: <br> <br> $if i.available > 0: - Price $sat Satoshi ~ $euro &euro; <a href="?putinbag=$i.id#$i.id">add to cart</a><br> + Price $sat Satoshi ~ $euro &euro; <a href="/shop?putinbag=$i.id#$i.id">add to cart</a><br> Available $i.available pcs $else: SOLD OUT! check back later. diff --git a/public_html/templates/splash.html b/public_html/templates/splash.html @@ -2,7 +2,7 @@ $def with (content) <!doctype html> <HEAD> <meta charset="utf-8"> - <title>Gonzo Pi | a retake on filmmaking</title> + <title>Gonzo Pi | a reboot of filmmaking</title> <link rel="stylesheet" href="/static/splash.css?v=98" type="text/css" rel="stylesheet"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="cache-control" content="no-cache"> diff --git a/server.py b/server.py @@ -136,7 +136,10 @@ def callsubprocess(cmd): def dropitems(d): i = getproduct(d) db.update('products', where="id='"+str(i.id)+"'", available=i.available+1) - product = db.query("SELECT * FROM customerbag WHERE sessionkey='" + session.sessionkey +"' AND product='"+str(i.id)+"';")[0] + 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) else: @@ -297,7 +300,7 @@ class index(): print(session.bag) if i.putinbag != None: addtobag(i.putinbag) - return web.seeother('/#' + i.putinbag) + return web.seeother('/shop#' + i.putinbag) print('Cyberpunk cafe') #print(session.bag) products = db.query("SELECT * FROM products ORDER BY priority DESC") @@ -355,7 +358,7 @@ class dropitem(): i = 0 empty=dropitems(d) if empty=='empty': - return web.seeother('/') + return web.seeother('/shop?#'+d) return web.seeother(referer) class bigpic(): @@ -371,7 +374,7 @@ class checkout(): t = [] shippingcountries = db.select('shipping', what='country', order='country ASC') shippingcountries = list(shippingcountries) - t.append('NO-SHIPPING') + #t.append('Finland') for i in shippingcountries: if i.country != 'NO-SHIPPING': t.append(i.country) diff --git a/settings.py b/settings.py @@ -1,16 +0,0 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- - -#rpcauth -rpcauth = "http://madbaker:afkjaiej83iu398kjfow3lkref33rf4lkk@172.168.27.108:8332" -rtl="https://172.168.27.108:3002/v1/" - -#mail to webmaster -webmaster = "rob@tarina.org" - -baseurl = "https://rockmanbrothers.com" - -#op -allowed = (("rbckman", "secret"), - ("brkhelle", "topsecret")) - diff --git a/settings.py.sample b/settings.py.sample @@ -0,0 +1,17 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +# Make your settings here and change filename to settings.py + +#rpcauth +rpcauth = "http://rpcserver:secrethash@ip:port" +rtl="https://ip:port/v1/" + +#mail to webmaster +webmaster = "your@mail.com" + +baseurl = "https://url.com" + +#op +allowed = (("admin", "secretpasscode"),) +