Account for pending cards

master
trémeur 3 weeks ago
parent 042d143b04
commit bfe656a5b4

@ -46,5 +46,5 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- Add level images manually to =build/assets/levels/= - Add level images manually to =build/assets/levels/=
- Add custom CSS to =build/user.css= - Add custom CSS to =build/user.css=
*** Updating and building *** Updating and building
- For each transaction, add a dictionary ={}= to the =log= list like in the example (removing any of ="received"=, ="lost"=, ="crayons"=, ="decks"=, ="coupons">= that arent relevant). - For each transaction, add a dictionary ={}= to the =log= list like in the example (removing any of ="received"=, ="lost"=, ="crayons"=, ="decks"=, ="coupons"=, ="pend"=, ="unpend"= that arent relevant).
- Run =./build.sh= in this directory to download the relevant card images and then upload everything to the server. - Run =./build.sh= in this directory to download the relevant card images and then upload everything to the server.

@ -563,7 +563,27 @@ span.searchresults {
font-family: monospace; font-family: monospace;
} }
/* coupons */
img.coupon.expired { img.coupon.expired {
-webkit-filter: grayscale(100%); -webkit-filter: grayscale(100%);
filter: grayscale(100%); filter: grayscale(100%);
} }
/* pending cards */
td:has(.pending) {
position: relative;
}
td:has(.pending) img {
filter: hue-rotate(180deg);
}
td p.pending {
position: absolute;
font-size: 10px;
top: 50%;
left: 50%;
transform: translate(-50%, -200%);
}

@ -9,6 +9,8 @@ log = [
"crayons":{"red":1,"orange":2,"yellow":-3}, "crayons":{"red":1,"orange":2,"yellow":-3},
"coupons":{"01":5}, "coupons":{"01":5},
"decks":["deck1","deck2","deck3","deck4","deck5","deck6","deck7","deck8"], # only if "event":"portfolio" "decks":["deck1","deck2","deck3","deck4","deck5","deck6","deck7","deck8"], # only if "event":"portfolio"
"sketch":-1 # for turning in 1 sketchpad "sketch":-1, # for turning in 1 sketchpad
"pend":["card05"], # to mark a card as pending
"unpend":["card06"] # to remove a card from the pending list if a trade is cancelled
} }
] ]

@ -52,6 +52,7 @@ redeemedsketch = 0
coupons = [] coupons = []
datelist = [] datelist = []
logitems = [] logitems = []
pends = []
for event in log.log: for event in log.log:
logentry = {} logentry = {}
@ -232,6 +233,16 @@ for event in log.log:
coupons.append({newcoupon:event["coupons"][newcoupon]}) coupons.append({newcoupon:event["coupons"][newcoupon]})
except: except:
pass pass
try:
for card in event["pend"]:
pends.append(card)
except:
pass
try:
for card in event["unpend"]:
pends.remove(card)
except:
pass
if logit == True: if logit == True:
logitems.append(logentry) logitems.append(logentry)
@ -373,6 +384,15 @@ for theme in variables.masscollect:
wantedlist = sorted(wantedlist, key=lambda d: d["name"]) wantedlist = sorted(wantedlist, key=lambda d: d["name"])
removelist = []
for card in wantedlist:
if card["name"] in pends:
removelist.append(card)
for card in removelist:
wantedlist.remove(card)
print("Adjusting card priorities") print("Adjusting card priorities")
for card in cardlist: for card in cardlist:
@ -837,6 +857,8 @@ def printdeck(deck,fold=True):
break break
if found == False: if found == False:
deckstring += "<img src=\"/decks/" + deck["name"] + "/00.gif\" loading=\"lazy\">" deckstring += "<img src=\"/decks/" + deck["name"] + "/00.gif\" loading=\"lazy\">"
if deck["name"] + teststring in pends:
deckstring += "<p class=\"pending\">pending</p>"
deckstring += "</td>\n" deckstring += "</td>\n"
if test % 5 == 0: if test % 5 == 0:
deckstring += " </tr>\n" deckstring += " </tr>\n"

Loading…
Cancel
Save