When a user is thanking, check state to see if other user thanked first, if so switch new_state to THANKED_BY_BOTH. fixes #13

This commit is contained in:
badblocks 2025-04-08 14:12:54 -07:00
parent 52663c83ef
commit a83ce746b5
7 changed files with 35 additions and 42 deletions

View file

@ -1,10 +0,0 @@
{% load trade_offer_tags %}
{% if trade_offers %}
<div class="flex flex-row flex-wrap gap-1 justify-center items-start">
{% for offer in trade_offers %}
{% render_trade_offer offer %}
{% endfor %}
</div>
{% else %}
<p class="text-gray-500">No trade offers found.</p>
{% endif %}

View file

@ -1,6 +1,6 @@
{% load trade_offer_tags pagination_tags %}
<div class="flex flex-row gap-6 md:gap-2 lg:gap-6 flex-wrap justify-center py-6">
<div class="flex flex-row flex-wrap gap-6 md:gap-2 lg:gap-6 justify-center items-start py-6">
{% for offer in offers %}
{% if offer.accepted_by %}
{# Render a trade acceptance using our new tag #}

View file

@ -1,7 +1,7 @@
{% load gravatar card_badge cache %}
{% cache 60 trade_offer offer_pk %}
<div x-data="{ flipped: {{flipped|lower}}, offerExpanded: {{flipped|yesno:'false,true'}}, acceptanceExpanded: {{flipped|lower}} }" x-ref="tradeOffer" class="transition-all duration-500 trade-offer-card my-auto h-full w-auto justify-center">
<div x-data="{ flipped: {{flipped|lower}}, offerExpanded: {{flipped|yesno:'false,true'}}, acceptanceExpanded: {{flipped|lower}} }" x-ref="tradeOffer" class="transition-all duration-500 trade-offer-card">
<div class="flip-container">
<div{% if not on_detail_page %} @click="window.location.href = '{% url 'trade_offer_detail' pk=offer_pk %}'"{% endif %} class="flip-inner grid grid-cols-1 grid-rows-1 card bg-base-100 card-border shadow-lg w-90 transform transition-transform duration-500 ease-in-out{% if not on_detail_page %} cursor-pointer{% endif %}{%if flipped %} rotate-y-180{% endif %}"
:class="{'rotate-y-180': flipped}">