thiswebshoprules

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

commit 85e057324bf8a5de974da5818d9478b835a57516
parent 2fccb23fdb00d08a4166e477e3e457402aaa9695
Author: rob <rob@tarina.org>
Date:   Tue,  3 Jan 2023 22:42:24 +0200

yeah

Diffstat:
Mdb/cyberpunkcafe.db | 0
Mpublic_html/static/logo.png | 0
Dpublic_html/static/tarina-logo.png | 0
Mpublic_html/templates/base.html | 4++--
Mpublic_html/templates/index.html | 20++++++++------------
Mpublic_html/templates/op.html | 2+-
Mpublic_html/templates/payln.html | 7++++---
Mpublic_html/templates/pending.html | 6+++---
Mserver.py | 27+++++++++++++++++++++++++--
9 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/db/cyberpunkcafe.db b/db/cyberpunkcafe.db Binary files differ. diff --git a/public_html/static/logo.png b/public_html/static/logo.png Binary files differ. diff --git a/public_html/static/tarina-logo.png b/public_html/static/tarina-logo.png Binary files differ. 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>Tarina web shop Welcome!</title> - <link rel="stylesheet" href="/static/style.css?v=9999.999" type="text/css" rel="stylesheet"/> + <title>Rockman Brothers | International Heavy Voodoo Sound</title> + <link rel="stylesheet" href="/static/robstyle.css?v=11" 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/index.html b/public_html/templates/index.html @@ -24,17 +24,13 @@ $if sessionkey != 'empty': </div> <div id="container"> -<h2>WELCOME TO THE SHOP</h2> -<h4>Original Tarina Shop Since 2022</h4> -<div id="logocontainer"> -<div id="logo2"> -<img class="logo" src="/static/tarina-logo.png"> <br> -<img class="logo2" src="/static/bitcoin.png"> -</div> +<h1>Rockman Brothers</h1> +<h4>International Heavy Voodoo Sound</h4> +<br> +<div id="logocontainer"> </div> -<br> <div id="productlist"> $for i in products: @@ -48,8 +44,7 @@ $for i in products: <h2> $i.name </h2> - <p>$i.description</p> - <br> + <pre>$i.description</pre> $if i.available > 0: Price $sat Satoshi ~ $euro &euro; <a href="?putinbag=$i.id#$i.id">order</a><br> Available $i.available pcs @@ -60,8 +55,9 @@ $for i in products: <small>~-~</small> <br> </div> -<p></p> -<h4>$getrate()&euro;/₿</h4> +<img class="logo" src="/static/bitcoin.png"> +<br> +<h2>$getrate()&euro;/₿</h2> <small>powered by <a href="https://github.com/ElementsProject/lightning">c-lightning</a>, <a href="https://github.com/Ride-The-Lightning/c-lightning-REST">c-lightning-REST</a> and <a href="https://webpy.org">web.py </a></small> <br> <br> diff --git a/public_html/templates/op.html b/public_html/templates/op.html @@ -8,7 +8,7 @@ $def with (content) <meta http-equiv="cache-control" content="no-cache"> </HEAD> <BODY> - <a href="/categories">Categories</a> | <a href="/products/">Products</a> | <a href="/shipping/">Shipping</a> | <a href="/orders">Orders</a> | <a href="/logout">Logout</a> + <a href="/config">Config</a> | <a href="/categories">Categories</a> | <a href="/products/">Products</a> | <a href="/shipping/">Shipping</a> | <a href="/orders">Orders</a> | <a href="/logout">Logout</a> <div id="container"> $:content </div> diff --git a/public_html/templates/payln.html b/public_html/templates/payln.html @@ -15,7 +15,7 @@ $if lninvoice['status'] != 'paid': <br> <h2>Pay with Bitcoin Lightning</h2> $else: - <h2>Payment recieved!</h2> + <h3>Payment recieved!</h3> $if digitalkey: <p>link to your digital goodies is in your mail!</p><br> <img src="/static/jamesfrancothanks.gif" style="width:300px"><br> @@ -35,7 +35,8 @@ $for i in bag: $p_totsats $p_toteuro&euro;<br> $for g in goodies: $if g.soundname[-5:] == '.jpeg' or g.soundname[-4:] == '.png': - <img src="/static/img/thumb/$g.soundname" style="width:120px"><br> + <img src="/static/img/thumb/$g.soundname" style="width:120px"> + <br> $code: totsats += p_totsats toteuro += p_toteuro @@ -45,7 +46,7 @@ $if totsats > 0: with rate: $getrate()&euro;/₿ <h2>status: $lninvoice['status']</h2> <br> -<img src="$qr"> +<a href="lightning:$lninvoice['bolt11']"><img src="$qr"></a> <div id='hash'> <h4>id:</h4> <textarea id='payid'> 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': - <h4>Digital goods will be shipped to your email once invoice paid..</h4> + <h2>Digital goods 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> @@ -50,10 +50,10 @@ $else: </pre> <br> -<h3> +<p> $if totsats > 0: total: $totsats Satosi $(toteuro)&euro; -</h3> +<p> <br> <a href="/checkout">Go back!</a> <div id="addevent"> diff --git a/server.py b/server.py @@ -42,6 +42,7 @@ urls = ( '/op', 'op', '/bitcoin', 'bitcoin', '/shipping/(.*)', 'shipping', + '/config', 'config', '/payments?', 'payments') allowed = (("rbckman", "secret"), @@ -193,8 +194,8 @@ def getprice(productid): p = db.query("SELECT * FROM products WHERE id='"+str(productid)+"';")[0] b = BtcConverter() if p.currency=='euro': - sat = b.convert_to_btc(p.price/100, 'EUR') - euro = p.price + sat = b.convert_to_btc(p.price/100, 'EUR') * 100000000 + euro = p.price/100 if p.currency=='bitcoin': euro = b.convert_btc_to_cur(p.price/100000000,'EUR') sat = p.price @@ -624,6 +625,28 @@ class op: else: raise web.seeother('/login') +class config: + form = web.form.Form( + web.form.Textbox('name', web.form.notnull, description="Site name:"), + web.form.Textarea('description', web.form.notnull, description="Description:"), + web.form.Button('Save')) + def GET(self): + if logged(): + configsite = self.form() + try: + oldsiteconfig = db.select('siteconfig', what='id, name, description')[0] + configsite.fill(name=oldsiteconfig.name, description=oldsiteconfig.description) + except: + print('no non no') + return renderop.config(configsite) + else: + raise web.seeother('/login') + def POST(self): + addcategory = self.form() + i = web.input() + db.update('siteconfig', where='id=1', name=i.name, description=i.description) + raise web.seeother('/config') + class categories: form = web.form.Form( web.form.Textbox('category', web.form.notnull, description="Add Category:"),