thiswebshoprules

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

index.html (2849B)


      1 $def with (products,bag,sessionkey,productname,inbag,db,getprice,getrate,category,markdown,getbtcratetime)
      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&euro; <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 &euro;
     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 <b><a href="/">All</a>
     45 $for c in categories:
     46     | <a href="?category=$c.category">$c.category</a>
     47 </b>
     48 <br>
     49 </div>
     50 <div id="productlist">
     51 $for i in products:
     52     $if category == i.category or category == None:
     53         <div class="product" id="$i.id">
     54         <code>~*~</code>
     55         <h2>
     56         $i.name
     57         </h2>
     58         <code>$i.category</code>
     59         <br>
     60         <br>
     61         $ goodies = db.query("SELECT * FROM soundlink WHERE id='" +i.id+"';")
     62         $for g in goodies:
     63             $if g.soundname[-5:] == '.jpeg' or g.soundname[-4:] == '.png':
     64                 <a href="/bigpic/$g.id"><img class="imgprod" src="/static/img/thumb/$g.soundname"></a>
     65         <br>
     66         
     67         <br>
     68         $code:
     69             sat, euro = getprice(i.id)
     70         $:markdown.markdown(i.description)
     71         product: $i.name
     72         <br>
     73         category: $i.category
     74         <br>
     75         <br>
     76         $if i.available > 0:
     77             Price $sat Satoshi ~ $euro &euro; <a href="/shop?putinbag=$i.id#$i.id">add to cart</a><br>
     78             Available $i.available pcs
     79         $else:
     80             SOLD OUT! check back later.
     81         </div>
     82         <br>
     83         <small>~-~</small>
     84         <br>
     85 </div>
     86 <img class="logo" src="/static/bitcoin.png"> 
     87 <br>
     88 <h2>$getrate()&euro;/â‚¿</h2>
     89 Bitcoin rate from
     90 <h6>$getbtcratetime()</h6>
     91 <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>
     92 <br>
     93 <br>
     94 <br>
     95 <br>
     96 <br>
     97 <br>
     98 <br>