diff --git a/README.org b/README.org
index 82fd3bf..d79dd0e 100644
--- a/README.org
+++ b/README.org
@@ -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.
diff --git a/build/style.css b/build/style.css
index 6f12746..f29203e 100644
--- a/build/style.css
+++ b/build/style.css
@@ -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%);
+}
diff --git a/log-template.py b/log-template.py
index 39786f4..5dd55b7 100644
--- a/log-template.py
+++ b/log-template.py
@@ -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
}
]
diff --git a/new.py b/new.py
index ebcc4cc..087a846 100644
--- a/new.py
+++ b/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 += ""
+ if deck["name"] + teststring in pends:
+ deckstring += "
pending
" deckstring += "\n" if test % 5 == 0: deckstring += " \n"