From 790a550e7fde25fbde76c98b426b44e4aa79f8eb Mon Sep 17 00:00:00 2001 From: gerlofvanek Date: Thu, 28 Nov 2024 21:33:43 +0100 Subject: [PATCH] ui: Always select "new address" on offers/bids. Remember last used address. --- basicswap/templates/offer.html | 102 +++++++++++++++---- basicswap/templates/offer_new_1.html | 140 ++++++++++++++++++++++----- 2 files changed, 202 insertions(+), 40 deletions(-) diff --git a/basicswap/templates/offer.html b/basicswap/templates/offer.html index 130a556..fdb7363 100644 --- a/basicswap/templates/offer.html +++ b/basicswap/templates/offer.html @@ -407,22 +407,88 @@ Amount you will send {{ data.amt_to }} {{ data.tla_to }} - - Send From Address - -
-
- {{ input_arrow_down_svg | safe }} - -
-
- - + + Send From Address + +
+
+ {{ input_arrow_down_svg | safe }} + +
+
+ + + {% if data.amount_negotiable == true %} Amount @@ -585,12 +651,12 @@ function updateModalValues() { {% endif %} const addrSelect = document.querySelector('select[name="addr_from"]'); - const addrText = addrSelect.options[addrSelect.selectedIndex].text.split(' ')[0]; + const selectedText = addrSelect.options[addrSelect.selectedIndex].text; + const addrText = selectedText === 'New Address' ? selectedText : selectedText.split(' ')[0]; document.getElementById('modal-addr-from').textContent = addrText; document.getElementById('modal-valid-mins').textContent = document.querySelector('input[name="validmins"]').value; } - function showConfirmModal() { updateModalValues(); document.getElementById('confirmModal').classList.remove('hidden'); diff --git a/basicswap/templates/offer_new_1.html b/basicswap/templates/offer_new_1.html index 0ca0380..4f9cee0 100644 --- a/basicswap/templates/offer_new_1.html +++ b/basicswap/templates/offer_new_1.html @@ -94,29 +94,125 @@ -
-
-
-
-

Select Address

-
-
-
- {{ input_down_arrow_offer_svg | safe }} -
- {{ select_address_svg | safe }} -
- -
-
-
-
+
+
+
+
+

Select Address

+
+
+
+ {{ input_down_arrow_offer_svg | safe }} +
+ {{ select_address_svg | safe }}
+ +
+
+
+
+
+ +