From 41f4701ffbf8d78058af0629beb3ae3370421b97 Mon Sep 17 00:00:00 2001 From: binaryfox Date: Tue, 2 Jan 2024 21:14:28 -0800 Subject: [PATCH 1/5] Make bid sticker count configurable --- artshow/templates/artshow/workflows_bidder_detail.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artshow/templates/artshow/workflows_bidder_detail.html b/artshow/templates/artshow/workflows_bidder_detail.html index a880f7b..9b004de 100644 --- a/artshow/templates/artshow/workflows_bidder_detail.html +++ b/artshow/templates/artshow/workflows_bidder_detail.html @@ -55,6 +55,7 @@

+ No label printer detected.

@@ -72,6 +73,7 @@ setUpLabelPrinter('label-printer-status'); const json = JSON.parse(document.getElementById('json-data').textContent); +const stickerCount = document.getElementById('bid-sticker-count'); const printButton = document.getElementById('print-bid-stickers'); printButton.disabled = json.bidderId == null; printButton.addEventListener('click', async () => { @@ -79,7 +81,7 @@ A50,40,0,7,2,2,N,"${json.bidderId}" A160,46,0,5,1,1,N,"$" LO160,100,165,5 -P10 +P${stickerCount.value} `; printLabels(data); From cb54d03eb86729126d318837db5d91365d295fe0 Mon Sep 17 00:00:00 2001 From: binaryfox Date: Tue, 2 Jan 2024 21:31:48 -0800 Subject: [PATCH 2/5] Compress long header names in artist check-in --- artshow/templates/artshow/workflows_artist_checkin.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artshow/templates/artshow/workflows_artist_checkin.html b/artshow/templates/artshow/workflows_artist_checkin.html index 393e439..aa722d2 100644 --- a/artshow/templates/artshow/workflows_artist_checkin.html +++ b/artshow/templates/artshow/workflows_artist_checkin.html @@ -52,8 +52,8 @@ Name/Title Media Adult? - Reproduction rights included? - Not For Sale + RPR + NFS Min Bid Buy Now Location From e9e8aae505fad7bdc5342ca634a7f68623168e17 Mon Sep 17 00:00:00 2001 From: binaryfox Date: Tue, 2 Jan 2024 21:33:55 -0800 Subject: [PATCH 3/5] Move piece ID inward on piece sticker --- artshow/templates/artshow/workflows_artist_checkin.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artshow/templates/artshow/workflows_artist_checkin.html b/artshow/templates/artshow/workflows_artist_checkin.html index aa722d2..6216ba6 100644 --- a/artshow/templates/artshow/workflows_artist_checkin.html +++ b/artshow/templates/artshow/workflows_artist_checkin.html @@ -135,7 +135,7 @@ A25,45,0,2,1,1,N,"${escape(pieceName.slice(0, 24))}" A25,65,0,2,1,1,N,"${escape(pieceName.slice(24, 49))}" A25,105,0,2,1,1,N,"${escape(media.slice(0, 24))}" -A355,5,1,2,2,2,N,"${json.artistId}-${sticker.pieceId}" +A350,10,1,2,2,2,N,"${json.artistId}-${sticker.pieceId}" JB P1 `; From f54e21d839b1153ff12942ab473840b2252a8984 Mon Sep 17 00:00:00 2001 From: binaryfox Date: Tue, 2 Jan 2024 23:06:49 -0800 Subject: [PATCH 4/5] Remove unnecessary sticker spaces on bidder agreement --- artshow/static/artshow/bidder_agreement.css | 3 ++- artshow/templates/artshow/bidder_agreement.html | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/artshow/static/artshow/bidder_agreement.css b/artshow/static/artshow/bidder_agreement.css index 7680d07..15d974e 100644 --- a/artshow/static/artshow/bidder_agreement.css +++ b/artshow/static/artshow/bidder_agreement.css @@ -47,7 +47,7 @@ body { grid-gap: 0px 10px; grid-auto-flow: column; grid-template-rows: 20px repeat(2, 1fr); - grid-template-columns: 2fr repeat(3, 1fr); + grid-template-columns: repeat(3, 1fr); background-color: lightgrey; border: 1px solid black; border-radius: 5px; @@ -63,6 +63,7 @@ body { .bid-sticker { grid-row: 2 / 4; + grid-column: 3; display: table; height: 0.75in; width: 1.75in; diff --git a/artshow/templates/artshow/bidder_agreement.html b/artshow/templates/artshow/bidder_agreement.html index b9fcaaa..760af27 100644 --- a/artshow/templates/artshow/bidder_agreement.html +++ b/artshow/templates/artshow/bidder_agreement.html @@ -59,9 +59,7 @@

Rules

Staff initials:
 
-
1st bid sticker
-
2nd bid sticker
-
3rd bid sticker
+
Place bid sticker here.
From d4db24d181450c5e237e3a0464fb21d01a833f15 Mon Sep 17 00:00:00 2001 From: binaryfox Date: Tue, 2 Jan 2024 23:07:05 -0800 Subject: [PATCH 5/5] Handle missing buy now price in bid entry --- artshow/bid_entry.py | 2 +- artshow/tests/test_bid_entry.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/artshow/bid_entry.py b/artshow/bid_entry.py index a70b5df..3e8fe7d 100644 --- a/artshow/bid_entry.py +++ b/artshow/bid_entry.py @@ -60,7 +60,7 @@ def get_bids(piece): 'last_updated': bids_updated, 'location': piece.location, 'locations': piece.artist.assigned_locations(), - 'buy_now': float(piece.buy_now), + 'buy_now': None if piece.buy_now is None else float(piece.buy_now), }) diff --git a/artshow/tests/test_bid_entry.py b/artshow/tests/test_bid_entry.py index b1b498f..3545e29 100644 --- a/artshow/tests/test_bid_entry.py +++ b/artshow/tests/test_bid_entry.py @@ -55,6 +55,12 @@ def setUp(self): bid = Bid(bidder=bidder, piece=piece, amount=20) bid.save() + # Piece 1-3 has no buy now price. + piece = Piece(artist=artist, pieceid=3, min_bid=5, + status=Piece.StatusInShow, + location='A2') + piece.save() + self.client = Client() self.client.login(username='test', password='test') @@ -73,7 +79,7 @@ def test_invalid_artist(self): self.assertEqual(response.json(), expected) def test_invalid_piece(self): - response = self.client.get('/artshow/entry/bids/1/3/') + response = self.client.get('/artshow/entry/bids/1/4/') expected = { 'error': { 'field': 'piece_id', @@ -110,6 +116,17 @@ def test_piece_two_bids(self): } self.assertEqual(response.json(), expected) + def test_piece_no_buy_now(self): + response = self.client.get('/artshow/entry/bids/1/3/') + expected = { + 'bids': [], + 'buy_now': None, + 'last_updated': None, + 'location': 'A2', + 'locations': ['A1', 'A2'], + } + self.assertEqual(response.json(), expected) + def test_invalid_bidder(self): data = { 'bids': [