commit fa47ab78e071920bb57c203271b3b28595340324 parent 6cebe6413cba1ca3d3267f60bb3b80f9ad1fb591 Author: rob <rob@tarina.org> Date: Sat, 16 Oct 2021 08:17:51 +0300 werks Diffstat:
19 files changed, 454 insertions(+), 0 deletions(-)
diff --git a/public_html/templates/base.html b/public_html/templates/base.html @@ -0,0 +1,18 @@ +$def with (content) +<!doctype html> +<HEAD> + <meta charset="utf-8"> + <title>Get Da Fuck Outta Here | buy good shit on the internet</title> + <link rel="stylesheet" href="/static/style.css?v=2.0" type="text/css" rel="stylesheet"/> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta http-equiv="cache-control" content="no-cache"> +</HEAD> +<BODY> + +<div id="container"> + $:content +</div> + +<script type="text/javascript" src="/static/scrollcookie.js"></script> + +</BODY> diff --git a/public_html/templates/bigpic.html b/public_html/templates/bigpic.html @@ -0,0 +1,5 @@ +$def with (p, product) + +<a href="/#$product"><-- back</a> +<a href="/#$product"><img src="/static/img/$product/web/$p" style="width:100%;"></a> + diff --git a/public_html/templates/bitcoin.html b/public_html/templates/bitcoin.html @@ -0,0 +1,6 @@ +$def with (wallet) + +$for i in wallet: + $i + $wallet[i] + diff --git a/public_html/templates/categories.html b/public_html/templates/categories.html @@ -0,0 +1,13 @@ +$def with (listcategories, addcategory) +<div id="container"> +<div id="default"> +<br> +$for i in listcategories: + <a href='/categories?delete=$i.id'>$i.category</a> +<div id="addevent"> +<form method="POST"> +$:addcategory.render() +</form> +</div> +</div> +</div> diff --git a/public_html/templates/checkout.html b/public_html/templates/checkout.html @@ -0,0 +1,29 @@ +$def with (checkoutform, bag, b, productname, float) +$ tot = 0 +<div id="container"> +<div id="default"> +<h2>Checkout</h2> +$if bag != []: + in your order (click to remove): + $for i in bag: + $code: + price = i.quantity * float(i.price/100) + <a href="/dropitem/$i.product">$i.quantity x $productname(i.product)</a> $price€<br> + <img src="/static/img/$i.product/thumb/000.jpeg" style="width:120px"><br> + $code: + tot += price +$if tot > 0: + <br> + total: $(tot)€ or in real money $int(b.convert_to_btc(tot, 'EUR') * 100000000) Satoshi +<br> +Order is only reserved once checkout done. +<br> +<div id="addevent"> +<form method="POST"> +$:checkoutform.render() +</form> +</div> +<b><p></p></b> +</div> +</div> +</div> diff --git a/public_html/templates/index.html b/public_html/templates/index.html @@ -0,0 +1,64 @@ +$def with (products, b, bag, str, int, float, sessionkey, productname) +$ tot = 0 +$ x = 0 + +<div id="logocontainer"> +<div id="logo2"> +<img class="logo" src="/static/logo.png"> +</div> +<div id="logo"> +<h1>GETDA<br>FUCK<br>OUTTA<br>HERE</h1> +</div> +<p>Good Old Shit Shop</p> +</div> +<br> + +<div id="productlist"> +$for i in products: + <div class="dashiit" id="$i.id"> + $code: + sat = str(int(b.convert_to_btc(i.price/100, 'EUR') * 100000000)) + <h2> + $i.name + </h2> + <p>$i.description</p> + $for p in i.images: + <a href="/bigpic/$i.id?pic=$p"><img src="/static/img/$i.id/thumb/$p"></a> + <br> + $if i.available > 0: + Price $sat Satoshi ~ $("%1.2f" % float(i.price/100))€ <a href="?putinbag=$i.id#$i.id">order</a><br> + Available $str(i.available) pcs + $else: + SOLD OUT! check back later. + </div> + <br> + <small>~-~</small> + <br> +</div> +<p></p> +<h3>rate is $int(b.get_latest_price('EUR'))€/btc</h4> +<small>powered by <a href="https://github.com/ElementsProject/lightning">c-lightning</a>, <a href="https://github.com/ElementsProject/lightning-charge">lightning-charge</a> and <a href="https://webpy.org">web.py </a></small> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<div id="bag"> +$if bag != []: + <div id="insidebag"> + in your order (click to remove): + $for i in bag: + $code: + price = i.quantity * float(i.price/100) + $#<img src="/static/img/$i.product/thumb/000.jpeg" style="width:50px"> + <a href="/dropitem/$i.product">$i.quantity x $productname(i.product)</a> $price€ | + $code: + tot += price +$if tot > 0: + <br> + total: $(tot)€ or in real money $int(b.convert_to_btc(tot, 'EUR') * 100000000) Satoshi + <a href="/checkout/">Checkout</a> + </div> +</div> diff --git a/public_html/templates/l33t.html b/public_html/templates/l33t.html @@ -0,0 +1,14 @@ +$def with (addproduct) +<div id="container"> + <div id="default"> + <br> + <h2>Add Product</h2> + <div id="addevent"> + <form method="POST"> + $:addproduct.render() + </form> + </div> + <b><p></p></b> + </div> + </div> +</div> diff --git a/public_html/templates/login.html b/public_html/templates/login.html @@ -0,0 +1,13 @@ +$def with (loginform) +<div id="container"> + <div id="default"> + <br> + <div id="addevent"> + <form method="POST"> + $:loginform.render() + </form> + </div> + <b><p></p></b> + </div> + </div> +</div> diff --git a/public_html/templates/op.html b/public_html/templates/op.html @@ -0,0 +1,14 @@ +$def with (content) +<!doctype html> +<HEAD> + <meta charset="utf-8"> + <title>TARINA | the filmmaking device</title> + <link rel="stylesheet" href="/static/style.css" type="text/css" rel="stylesheet"/> + <meta name="viewport" content="width=device-width, initial-scale=1"> +</HEAD> +<BODY> + <a href="/categories">Categories</a> | <a href="/products/">Products</a> | <a href="/shipping/">Shipping</a> | <a href="/payments">Payments</a> | <a href="/logout">Logout</a> +<div id="container"> + $:content +</div> +</BODY> diff --git a/public_html/templates/operator.html b/public_html/templates/operator.html @@ -0,0 +1,4 @@ +<div id="container"> +<div id="default"> +</div> +</div> diff --git a/public_html/templates/pay.html b/public_html/templates/pay.html @@ -0,0 +1,27 @@ +$def with (invoice) +$ qr = '/static/qr/' + invoice['id'] + '.png' +<script> +function copy() { + let textarea = document.getElementById("payreq"); + textarea.select(); + document.execCommand("copy"); +} +</script> +<meta http-equiv="refresh" content="5" /> +<br> +<h2>$invoice['description']<br>$invoice['msatoshi'] msat, $invoice['quoted_amount'] $invoice['quoted_currency']</h2> +<br> +<img src="$qr"> +<div id='hash'> +<h4>id:</h4> +<textarea id='payid'> +$invoice['id'] +</textarea> +<h4>pay req:</h4> +<textarea id='payreq'> +$invoice['payreq'] +</textarea> +<br> +<button id="copybutton" onclick="copy()">Copy</button> +<button id="backbutton" autofocus onclick="parent.location='/'">Back</button> +</div> diff --git a/public_html/templates/paybtc.html b/public_html/templates/paybtc.html @@ -0,0 +1,36 @@ +$def with (invoice, btcaddress, btcuri, showpayment) +$ qr = '/static/qr/' + btcaddress + '.png' +<script> +function copy() { + let textarea = document.getElementById("payreq"); + textarea.select(); + document.execCommand("copy"); +} +</script> +<meta http-equiv="refresh" content="60" /> +<br> +<h3>$invoice.products</h3> +<h3>$float(invoice.amount/100)€</h3> +<h3>$invoice.totsats Satoshi</h3> +$if showpayment == []: + <h3>Status: not paid</h3> +$else: + $for i in showpayment: + <h4>Status:</h4> + <h4>txid: $i['txids']</h4> + <h4>confirmations: $i['confirmations']</h4> +<br> +<img src="$qr"> +<div id='hash'> +<h4>bitcoin address:</h4> +<textarea id='payid'> +$btcaddress +</textarea> +<h4>pay uri:</h4> +<textarea id='payreq'> +$btcuri +</textarea> +<br> +<button id="copybutton" onclick="copy()">Copy</button> +<button id="backbutton" autofocus onclick="parent.location='/payln/$invoice.invoice_key'">Pay with Lightning</button> +</div> diff --git a/public_html/templates/payln.html b/public_html/templates/payln.html @@ -0,0 +1,37 @@ +$def with (lninvoice, invoice, bag, productname, float) +$ qr = '/static/qr/' + lninvoice['id'] + '.png' +<script> +function copy() { + let textarea = document.getElementById("payreq"); + textarea.select(); + document.execCommand("copy"); +} +</script> +<meta http-equiv="refresh" content="60" /> +<h2>Pay with Bitcoin Lightning</h2> +in your order (click to remove):<br> +$for i in bag: + $code: + price = i.quantity * float(i.price/100) + <a href="/dropitem/$i.product">$i.quantity x $productname(i.product)</a> $price€ <br> + <img src="/static/img/$i.product/thumb/000.jpeg" style="width:120px"><br> + +<h3>$float(invoice.amount/100)€</h3> +<h3>$invoice.totsats Satoshi</h3> +<h3>$lninvoice['quoted_currency']</h3> +<h3>$lninvoice['status']</h3> +<br> +<img src="$qr"> +<div id='hash'> +<h4>id:</h4> +<textarea id='payid'> +$lninvoice['id'] +</textarea> +<h4>pay req:</h4> +<textarea id='payreq'> +$lninvoice['payreq'] +</textarea> +<br> +<button id="copybutton" onclick="copy()">Copy</button> +<button id="backbutton" autofocus onclick="parent.location='/paybtc/$invoice.invoice_key'">Pay with Bitcoin on-chain</button> +</div> diff --git a/public_html/templates/payment.html b/public_html/templates/payment.html @@ -0,0 +1,27 @@ +$def with (invoice) +$ qr = '/static/qr/' + invoice['id'] + '.png' +<script> +function copy() { + let textarea = document.getElementById("payreq"); + textarea.select(); + document.execCommand("copy"); +} +</script> +<meta http-equiv="refresh" content="60" /> +<br> +<h2>$invoice['description']<br>$invoice['msatoshi'] msat, $invoice['quoted_amount'] $invoice['quoted_currency']</h2> +<br> +<img src="$qr"> +<div id='hash'> +<h4>id:</h4> +<textarea id='payid'> +$invoice['id'] +</textarea> +<h4>pay req:</h4> +<textarea id='payreq'> +$invoice['payreq'] +</textarea> +<br> +<button id="copybutton" onclick="copy()">Copy</button> +<button id="backbutton" autofocus onclick="parent.location='/'">Back</button> +</div> diff --git a/public_html/templates/payments.html b/public_html/templates/payments.html @@ -0,0 +1,33 @@ +$def with (payments) +$var payments = payments +$ link = '' +</div> +<h2>payments</h2> +<table> +$for i in payments: + $if i.payment == 'Bitcoin': + $ link = "/paybtc/" + i.invoice_key + $if i.payment == 'Bitcoin Lightning': + $ link = "/payln/" + i.invoice_key + <pre> + <b>status: $i.status</b> + <a href=$link>$i.invoice_key</a> + $i.payment + $i.btc + $i.ln + $i.products | $float(i.amount/100) € | Satoshis: $i.totsats + order $i.timestamp + $if i.datepaid: + paid $i.datepaid + $else: + not paid! + $i.email + $i.firstname $i.lastname + $i.address + $i.postalcode + $i.town + $i.country + <a href='/payments?status=thankyou&key=$i.invoice_key'>thank you</a> | <a href='/payments?status=shipped&key=$i.invoice_key'>shipped</a> | <a href='/payments?status=paynotice&key=$i.invoice_key'>payment notice</a> | <a href='/payments?status=remove&key=$i.invoice_key'>remove</a> + </pre> +</table> + diff --git a/public_html/templates/pending.html b/public_html/templates/pending.html @@ -0,0 +1,50 @@ +$def with (pending_key, pendingform, pendinginfo, shippinginfo, bag, b, productname, float) +$ tot = 0 +<div id="container"> +<div id="default"> +<h2>Checkout</h2> +$if bag != []: + in your order (click to remove): + $for i in bag: + $code: + price = i.quantity * float(i.price/100) + <a href="/dropitem/$i.product">$i.quantity x $productname(i.product)</a> $price€ <br> + <img src="/static/img/$i.product/thumb/000.jpeg" style="width:120px"><br> + $code: + tot += price + + +<br> +$if pendinginfo.country == 'NO-SHIPPING': + No shipping selected, be sure to pick up item yaself okey. +$else: + Shipping cost to $pendinginfo.country is $float(shippinginfo.price/100)€ <br> + Shipping estimate is $shippinginfo.days days<br> + $code: + tot += float(shippinginfo.price/100) + <pre> + First Name: $pendinginfo.firstname + Last Name: $pendinginfo.lastname + Country: $pendinginfo.country + Address: $pendinginfo.address + Town: $pendinginfo.town + Postalcode: $pendinginfo.postalcode + Email: $pendinginfo.email + </pre> + +<br> +<h3> +$if tot > 0: + total: $(tot)€ or in real money $int(b.convert_to_btc(tot, 'EUR') * 100000000) Satoshi +</h3> +<br> +<a href="/checkout/$pending_key">Go back!</a> +<div id="addevent"> +<form method="POST"> +$:pendingform.render() +</form> +</div> +<b><p></p></b> +</div> +</div> +</div> diff --git a/public_html/templates/products.html b/public_html/templates/products.html @@ -0,0 +1,29 @@ +$def with (addproduct, listproducts, productimages, idvalue) +<div id="container"> +<div id="default"> +<br> +$for i in listproducts: + <a href='/products/$i.id'>$i.name $i.price</a> +$if idvalue == '': + <h2>Add product</h2> +$else: + <h2>Edit product</h2> +<div id="addevent"> +<form method="POST"> +$:addproduct.render() +</form> +<a href='/products/$idvalue?cmd=del&id=$idvalue'>remove product</a> +<br> +$for i in productimages: + <img src="/static/img/$idvalue/thumb/$i"> + <a href='/products/$idvalue?cmd=removeimg&img=$i'>remove</a> +<form method="POST" enctype="multipart/form-data" action=""> +Image(jpeg): <input type="file" name="imgfile"/> <br> +<br/> +<input name="upload", type="submit" value="upload" /> +</form> +</div> + +</div> +</div> +</div> diff --git a/public_html/templates/shipping.html b/public_html/templates/shipping.html @@ -0,0 +1,16 @@ +$def with (addcountry, listcountries) +<div id="container"> +<div id="default"> +<br> +<h2>Add shipping country</h2> +<div id="addevent"> +<form method="POST"> +$:addcountry.render() +</form> +</div> +$for i in listcountries: + <a href='/shipping/$i.id'>$i.country $i.price $i.days</a> +<b><p></p></b> +</div> +</div> +</div> diff --git a/public_html/templates/thankyou.html b/public_html/templates/thankyou.html @@ -0,0 +1,19 @@ +$def with (id) +<script> +function copy() { + let textarea = document.getElementById("payid"); + textarea.select(); + document.execCommand("copy"); +} +</script> + +<h1>Payment received!</h1> +<h2>Thank you!</h2> + +<p>show id to madbaker and claim your bread</p> +<textarea id='payid'> +$id +</textarea> +<button id="copybutton" onclick="copy()">Copy</button> +<br> +<button id="backbutton" autofocus onclick="parent.location='/'">Back</button>