From d942632811a5a871053ed22af7364e8b8907fb5b Mon Sep 17 00:00:00 2001 From: badbl0cks <4161747+badbl0cks@users.noreply.github.com> Date: Wed, 12 Mar 2025 00:57:23 -0700 Subject: [PATCH] Add expand all/collapse all button for trades listings --- .../trades/trade_offer_all_list.html | 28 ++-- .../templates/trades/trade_offer_my_list.html | 126 ++++++++++-------- theme/templatetags/trade_offer.html | 23 +++- 3 files changed, 108 insertions(+), 69 deletions(-) diff --git a/theme/templates/trades/trade_offer_all_list.html b/theme/templates/trades/trade_offer_all_list.html index e77608c..943d08d 100644 --- a/theme/templates/trades/trade_offer_all_list.html +++ b/theme/templates/trades/trade_offer_all_list.html @@ -4,15 +4,25 @@ {% block title %}All Trade Offers{% endblock title %} {% block content %} -
-
-
- - -
+
+
+
+
+ + +
+
+
+ + +
diff --git a/theme/templates/trades/trade_offer_my_list.html b/theme/templates/trades/trade_offer_my_list.html index d3ca9ff..7cc60c2 100644 --- a/theme/templates/trades/trade_offer_my_list.html +++ b/theme/templates/trades/trade_offer_my_list.html @@ -4,21 +4,77 @@ {% block title %}Trade Offer & Acceptance List{% endblock title %} {% block content %} -
- -
-
- {% include "trades/_friend_code_select.html" with friend_codes=friend_codes selected_friend_code=selected_friend_code field_name="friend_code" label="Filter by Friend Code" %} +
+ +
+
+ + {% include "trades/_friend_code_select.html" with friend_codes=friend_codes selected_friend_code=selected_friend_code field_name="friend_code" label="Filter by Friend Code" %} - - - + + + +
+
+ + +
- + +
+

Waiting for Your Response

+ {% if trade_acceptances_waiting_paginated.object_list %} + {% include "trades/_trade_offer_list.html" with offers=trade_acceptances_waiting_paginated %} +
+ {% if trade_acceptances_waiting_paginated.has_previous %} + Previous + {% else %} + + {% endif %} + Page {{ trade_acceptances_waiting_paginated.number }} of {{ trade_acceptances_waiting_paginated.paginator.num_pages }} + {% if trade_acceptances_waiting_paginated.has_next %} + Next + {% else %} + + {% endif %} +
+ {% else %} +

None at this time.

+ {% endif %} +
+ + +
+

Waiting for Trade Partner's Response

+ {% if other_party_trade_acceptances_paginated.object_list %} + {% include "trades/_trade_offer_list.html" with offers=other_party_trade_acceptances_paginated %} +
+ {% if other_party_trade_acceptances_paginated.has_previous %} + Previous + {% else %} + + {% endif %} + Page {{ other_party_trade_acceptances_paginated.number }} of {{ other_party_trade_acceptances_paginated.paginator.num_pages }} + {% if other_party_trade_acceptances_paginated.has_next %} + Next + {% else %} + + {% endif %} +
+ {% else %} +

None at this time.

+ {% endif %} +
+ +

My Trade Offers

{% if my_trade_offers_paginated.object_list %} @@ -41,52 +97,6 @@ {% endif %}
- -
-

Waiting for Your Response

- {% if trade_acceptances_waiting_paginated.object_list %} - {% include "trades/_trade_offer_list.html" with offers=trade_acceptances_waiting_paginated %} -
- {% if trade_acceptances_waiting_paginated.has_previous %} - Previous - {% else %} - - {% endif %} - Page {{ trade_acceptances_waiting_paginated.number }} of {{ trade_acceptances_waiting_paginated.paginator.num_pages }} - {% if trade_acceptances_waiting_paginated.has_next %} - Next - {% else %} - - {% endif %} -
- {% else %} -

No pending acceptances at this time.

- {% endif %} -
- - -
-

Waiting for Trade Partner's Response

- {% if other_party_trade_acceptances_paginated.object_list %} - {% include "trades/_trade_offer_list.html" with offers=other_party_trade_acceptances_paginated %} -
- {% if other_party_trade_acceptances_paginated.has_previous %} - Previous - {% else %} - - {% endif %} - Page {{ other_party_trade_acceptances_paginated.number }} of {{ other_party_trade_acceptances_paginated.paginator.num_pages }} - {% if other_party_trade_acceptances_paginated.has_next %} - Next - {% else %} - - {% endif %} -
- {% else %} -

No pending acceptances found.

- {% endif %} -
- diff --git a/theme/templatetags/trade_offer.html b/theme/templatetags/trade_offer.html index 754e6f2..16919d1 100644 --- a/theme/templatetags/trade_offer.html +++ b/theme/templatetags/trade_offer.html @@ -1,11 +1,30 @@ {% load gravatar card_badge %} + + + -
+