index.html (3013B)
1 $def with (products,bag,sessionkey,productname,inbag,db,getprice,getrate,category,markdown) 2 $ totsats = 0 3 $ toteuro = 0 4 $ x = 0 5 $if sessionkey != 'empty': 6 <div id="bag"> 7 <div id="insidebag"> 8 in your cart:<br> 9 $for i in bag: 10 $code: 11 price = getprice(i.product) 12 quantity = i.quantity 13 p_totsats=i.quantity*price[0] 14 p_toteuro=i.quantity*price[1] 15 $i.quantity x $productname(i.product) 16 $#$p_totsats $p_toteuro€ <a href="/shop/dropitem/$i.product">remove</a> 17 <a href="/dropitem/$i.product">remove</a> 18 <br> 19 $code: 20 totsats += p_totsats 21 toteuro += p_toteuro 22 $if totsats > 0: 23 total: $totsats Satoshi or $toteuro € 24 <br> 25 <h5><a href="/checkout">Checkout 🛒 --></a></h5> 26 <code>~</code> 27 </div> 28 </div> 29 30 $ siteconfig = db.select('siteconfig', what='id, name, description, description2')[0] 31 $ categories = db.select('categories', what='id, category') 32 33 <div id="container"> 34 <div class="intro"> 35 <img style="width:100px;" src="/static/img/thumb/logo.png"> 36 <br> 37 <code>~*~</code> 38 <br> 39 <br> 40 <h1>$siteconfig.name</h1> 41 $:markdown.markdown(siteconfig.description) 42 $:markdown.markdown(siteconfig.description2) 43 44 <div id="selectproducts"> 45 <b><a href="/shop#selectproducts">All</a> 46 $for c in categories: 47 | <a href="?category=$c.category#selectproducts">$c.category</a> 48 </b> 49 </div> 50 <br> 51 </div> 52 <div id="productlist"> 53 $for i in products: 54 $if category == i.category or category == None: 55 $if i.available > 0: 56 <div class="product" id="$i.id"> 57 <code>~*~</code> 58 <h2> 59 $i.name 60 </h2> 61 <code>$i.category</code> 62 <br> 63 <br> 64 $ goodies = db.query("SELECT * FROM soundlink WHERE id='" +i.id+"';") 65 $for g in goodies: 66 $if g.soundname[-5:] == '.jpeg' or g.soundname[-4:] == '.png': 67 <a href="/bigpic/$g.id"><img class="imgprod" src="/static/img/thumb/$g.soundname"></a> 68 <br> 69 70 <br> 71 $code: 72 sat, euro = getprice(i.id) 73 $:markdown.markdown(i.description) 74 product: $i.name 75 <br> 76 category: $i.category 77 <br> 78 <br> 79 $if i.available > 0: 80 Price $sat Satoshi ~ $euro € <a href="/shop?putinbag=$i.id#$i.id">add to cart</a><br> 81 Available $i.available pcs 82 $else: 83 SOLD OUT! check back later. 84 </div> 85 <br> 86 <small>~-~</small> 87 <br> 88 </div> 89 <img class="logo" src="/static/bitcoin.png"> 90 <br> 91 <h2>$getrate()€/â‚¿</h2> 92 <small>powered by <a href="https://github.com/ElementsProject/lightning">CLN</a>, <a href="https://dev.tarina.org/p/thiswebshoprules/">thiswebshoprules</a> and <a href="https://webpy.org">web.py </a></small> 93 <br> 94 <br> 95 <br> 96 <br> 97 <br> 98 <br> 99 <br>