From 63e20bace6d33a04838acd7c5e06800014f929d0 Mon Sep 17 00:00:00 2001 From: badbl0cks <4161747+badbl0cks@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:39:15 -0700 Subject: [PATCH] Fix expanded state handling for trade offers and modify expand all on trade offers listing to persist between pages --- theme/templates/account/dashboard.html | 8 +- theme/templates/trades/_trade_offer_list.html | 2 +- .../trades/trade_offer_all_list.html | 57 ++++++--- .../templates/trades/trade_offer_detail.html | 2 +- theme/templatetags/trade_offer.html | 119 +++--------------- trades/templatetags/trade_offer_tags.py | 8 ++ trades/views.py | 6 +- 7 files changed, 74 insertions(+), 128 deletions(-) diff --git a/theme/templates/account/dashboard.html b/theme/templates/account/dashboard.html index cd8763d..63bc1ce 100644 --- a/theme/templates/account/dashboard.html +++ b/theme/templates/account/dashboard.html @@ -24,9 +24,9 @@
-

{{ _('Trade Summary') }}

+

{{ _('Trade Summary') }}

-
+
{{ _('Your Reputation') }}
{{ request.user.reputation_score }}
@@ -38,7 +38,7 @@
{{ _('Active Offers') }}
-
+
{{ _('Waiting on You') }}
{{ trade_acceptances_waiting_paginated.page_obj.count }}
@@ -55,7 +55,7 @@
-

{{ _('Quick Actions') }}

+

{{ _('Quick Actions') }}

{{ _('Create New Offer') }} {{ _('View All Offers') }} diff --git a/theme/templates/trades/_trade_offer_list.html b/theme/templates/trades/_trade_offer_list.html index 4990a91..85ec100 100644 --- a/theme/templates/trades/_trade_offer_list.html +++ b/theme/templates/trades/_trade_offer_list.html @@ -11,7 +11,7 @@ {# Render a trade acceptance using our new tag #} {% render_trade_acceptance offer %} {% else %} - {% render_trade_offer offer %} + {% render_trade_offer offer expanded=expanded %} {% endif %}
{% empty %} diff --git a/theme/templates/trades/trade_offer_all_list.html b/theme/templates/trades/trade_offer_all_list.html index be30f02..95f0645 100644 --- a/theme/templates/trades/trade_offer_all_list.html +++ b/theme/templates/trades/trade_offer_all_list.html @@ -4,15 +4,48 @@ {% block title %}Trade Offers{% endblock title %} {% block content %} -
- +
+ +

Trade Offers