Account for pending cards
This commit is contained in:
parent
042d143b04
commit
bfe656a5b4
4 changed files with 46 additions and 2 deletions
|
@ -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 custom CSS to =build/user.css=
|
||||
*** 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 aren’t 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 aren’t relevant).
|
||||
- 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;
|
||||
}
|
||||
|
||||
/* coupons */
|
||||
|
||||
img.coupon.expired {
|
||||
-webkit-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},
|
||||
"coupons":{"01":5},
|
||||
"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
|
||||
}
|
||||
]
|
||||
|
|
22
new.py
22
new.py
|
@ -52,6 +52,7 @@ redeemedsketch = 0
|
|||
coupons = []
|
||||
datelist = []
|
||||
logitems = []
|
||||
pends = []
|
||||
|
||||
for event in log.log:
|
||||
logentry = {}
|
||||
|
@ -232,6 +233,16 @@ for event in log.log:
|
|||
coupons.append({newcoupon:event["coupons"][newcoupon]})
|
||||
except:
|
||||
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:
|
||||
logitems.append(logentry)
|
||||
|
||||
|
@ -373,6 +384,15 @@ for theme in variables.masscollect:
|
|||
|
||||
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")
|
||||
|
||||
for card in cardlist:
|
||||
|
@ -837,6 +857,8 @@ def printdeck(deck,fold=True):
|
|||
break
|
||||
if found == False:
|
||||
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"
|
||||
if test % 5 == 0:
|
||||
deckstring += " </tr>\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue