Refactor email templates
This commit is contained in:
parent
e37731b74d
commit
32da8157a6
31 changed files with 476 additions and 2516 deletions
2
theme/templates/email/common/footer.txt
Normal file
2
theme/templates/email/common/footer.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Happy trading!
|
||||
PKMN Trade Club
|
||||
1
theme/templates/email/common/header.txt
Normal file
1
theme/templates/email/common/header.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
Hello {{ recipient_user }},
|
||||
1
theme/templates/email/common/subject.txt
Normal file
1
theme/templates/email/common/subject.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
[PKMN Trade Club]
|
||||
15
theme/templates/email/trades/trade_update_accepted.txt
Normal file
15
theme/templates/email/trades/trade_update_accepted.txt
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{% include 'email/common/header.txt' %}
|
||||
|
||||
Great news! {{ acting_user }} ({{ acting_user_ign }} {{ acting_user_friend_code }}) has accepted your trade offer.
|
||||
|
||||
Trade Details:
|
||||
- They have: {{ want_card }}
|
||||
- They want: {{ has_card }}
|
||||
(#{{ hash }})
|
||||
|
||||
What's next? You can now mark the trade as "Sent" once you've offered the card to them in the app, or reject the trade if needed.
|
||||
|
||||
Visit your dashboard to manage this trade:
|
||||
{{ domain }}{% url 'dashboard' %}
|
||||
|
||||
{% include 'email/common/footer.txt' %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
Trade Accepted
|
||||
15
theme/templates/email/trades/trade_update_received.txt
Normal file
15
theme/templates/email/trades/trade_update_received.txt
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{% include 'email/common/header.txt' %}
|
||||
|
||||
Great news! {{ acting_user }} ({{ acting_user_ign }} {{ acting_user_friend_code }}) has marked your trade as "Received".
|
||||
|
||||
Trade Details:
|
||||
- They sent: {{ want_card }}
|
||||
- They received: {{ has_card }}
|
||||
(#{{ hash }})
|
||||
|
||||
What's next? Send a thank you to this user to increase their reputation!
|
||||
|
||||
Visit your dashboard to send thanks:
|
||||
{{ domain }}{% url 'dashboard' %}
|
||||
|
||||
{% include 'email/common/footer.txt' %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
Trade Received
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
Hello {{ recipient_user }},
|
||||
{% include 'email/common/header.txt' %}
|
||||
|
||||
We're sorry to inform you that {{ acting_user }} ({{ acting_user_friend_code }}) has canceled their trade acceptance.
|
||||
|
||||
Trade Details:
|
||||
- #{{ hash }}
|
||||
- Card you were going to send: {{ has_card }}
|
||||
- Card they were offering: {{ want_card }}
|
||||
- They had: {{ want_card }}
|
||||
- They wanted: {{ has_card }}
|
||||
(#{{ hash }})
|
||||
|
||||
Your trade offer is still active and available for other users to accept.
|
||||
|
||||
Visit your dashboard to manage your trade offers:
|
||||
{% url 'dashboard' %}
|
||||
{{ domain }}{% url 'dashboard' %}
|
||||
|
||||
Happy trading!
|
||||
PKMN Trade Club
|
||||
{% include 'email/common/footer.txt' %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
Trade Was Rejected
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
Hello {{ recipient_user }},
|
||||
{% include 'email/common/header.txt' %}
|
||||
|
||||
We're sorry to inform you that {{ acting_user }} ({{ acting_user_friend_code }}) has rejected the trade.
|
||||
|
||||
Trade Details:
|
||||
- #{{ hash }}
|
||||
- Card you were going to receive: {{ has_card }}
|
||||
- Card you were offering: {{ want_card }}
|
||||
- You had: {{ has_card }}
|
||||
- You wanted: {{ want_card }}
|
||||
(#{{ hash }})
|
||||
|
||||
Don't worry - there are plenty of other trade opportunities available! You can browse our marketplace for similar trades.
|
||||
|
||||
Visit the marketplace:
|
||||
https://pkmntrade.club{% url 'trade_offer_list' %}
|
||||
{{ domain }}{% url 'trade_offer_list' %}
|
||||
|
||||
Better luck with your next trade!
|
||||
PKMN Trade Club
|
||||
{% include 'email/common/footer.txt' %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
Trade Was Rejected
|
||||
15
theme/templates/email/trades/trade_update_sent.txt
Normal file
15
theme/templates/email/trades/trade_update_sent.txt
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{% include 'email/common/header.txt' %}
|
||||
|
||||
{{ acting_user }} ({{ acting_user_ign }} {{ acting_user_friend_code }}) has marked your trade as "Sent".
|
||||
|
||||
Trade Details:
|
||||
- You have: {{ want_card }}
|
||||
- You want: {{ has_card }}
|
||||
(#{{ hash }})
|
||||
|
||||
What's next? Once you respond to the trade in the app, please mark the trade as "Received" in your dashboard.
|
||||
|
||||
Visit your dashboard to manage this trade:
|
||||
{{ domain }}{% url 'dashboard' %}
|
||||
|
||||
{% include 'email/common/footer.txt' %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
Trade Sent
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
Hello {{ recipient_user }},
|
||||
{% include 'email/common/header.txt' %}
|
||||
|
||||
{{ acting_user }} ({{ acting_user_friend_code }}) has sent their thanks for the successful trade!
|
||||
|
||||
Trade Details:
|
||||
- #{{ hash }}
|
||||
- Card you sent: {{ has_card }}
|
||||
- Card they offered: {{ want_card }}
|
||||
- They sent: {{ want_card }}
|
||||
- They received: {{ has_card }}
|
||||
(#{{ hash }})
|
||||
|
||||
What's next? Send a thank you to this user to increase their reputation!
|
||||
|
||||
Visit your dashboard to send thanks:
|
||||
{% url 'dashboard' %}
|
||||
{{ domain }}{% url 'dashboard' %}
|
||||
|
||||
Happy trading!
|
||||
PKMN Trade Club
|
||||
{% include 'email/common/footer.txt' %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
You Received A Thanks!
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{% include 'email/common/header.txt' %}
|
||||
|
||||
{{ acting_user }} ({{ acting_user_friend_code }}) has sent their thanks for the successful trade!
|
||||
|
||||
Trade Details:
|
||||
- {% if is_initiator %}They sent: {{ has_card }}{% else %}You sent: {{ want_card }}{% endif %}
|
||||
- {% if is_initiator %}They received: {{ want_card }}{% else %}You received: {{ has_card }}{% endif %}
|
||||
(#{{ hash }})
|
||||
|
||||
This trade is now completed; no further actions can be made.
|
||||
|
||||
Thank you for using PKMN Trade Club.
|
||||
|
||||
{% include 'email/common/footer.txt' %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
You Received A Thanks!
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
Hello {{ recipient_user }},
|
||||
{% include 'email/common/header.txt' %}
|
||||
|
||||
{{ acting_user }} ({{ acting_user_friend_code }}) has sent their thanks for the successful trade!
|
||||
|
||||
Trade Details:
|
||||
- #{{ hash }}
|
||||
- Card they sent: {{ has_card }}
|
||||
- Card you offered: {{ want_card }}
|
||||
- You sent: {{ want_card }}
|
||||
- You received: {{ has_card }}
|
||||
(#{{ hash }})
|
||||
|
||||
What's next? Send a thank you to this user to increase their reputation!
|
||||
|
||||
Visit your dashboard to send thanks:
|
||||
{% url 'dashboard' %}
|
||||
{{ domain }}{% url 'dashboard' %}
|
||||
|
||||
Happy trading!
|
||||
PKMN Trade Club
|
||||
{% include 'email/common/footer.txt' %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
You Received A Thanks!
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Most Offered</h5>
|
||||
</div>
|
||||
<div class="card-body my-4 p-0">
|
||||
{% cache 3600 most_offered_cards %}
|
||||
{% cache 300 most_offered_cards %}
|
||||
{% include "home/_card_list.html" with cards=most_offered_cards %}
|
||||
{% endcache %}
|
||||
</div>
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Most Wanted</h5>
|
||||
</div>
|
||||
<div class="card-body my-4 p-0">
|
||||
{% cache 3600 most_wanted_cards %}
|
||||
{% cache 300 most_wanted_cards %}
|
||||
{% include "home/_card_list.html" with cards=most_wanted_cards %}
|
||||
{% endcache %}
|
||||
</div>
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Least Offered</h5>
|
||||
</div>
|
||||
<div class="card-body my-4 p-0">
|
||||
{% cache 3600 least_offered_cards %}
|
||||
{% cache 300 least_offered_cards %}
|
||||
{% include "home/_card_list.html" with cards=least_offered_cards %}
|
||||
{% endcache %}
|
||||
</div>
|
||||
|
|
@ -87,7 +87,6 @@
|
|||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<!-- Featured Offers -->
|
||||
<div>
|
||||
{% cache 3600 featured_offers %}
|
||||
<div class="p-4 text-center ">
|
||||
<h5 class="text-xl font-semibold whitespace-nowrap truncate mb-0">Featured Offers</h5>
|
||||
</div>
|
||||
|
|
@ -102,12 +101,10 @@
|
|||
<p class="text-center">No featured offers available.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endcache %}
|
||||
</div>
|
||||
|
||||
<!-- Recent Offers -->
|
||||
<div>
|
||||
{% cache 3600 recent_offers %}
|
||||
<div class="text-center p-4">
|
||||
<h5 class="text-xl font-semibold whitespace-nowrap truncate mb-0">Recent Offers</h5>
|
||||
</div>
|
||||
|
|
@ -120,53 +117,7 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endcache %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<script defer>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Minimal JavaScript for toggling Featured Offers tabs
|
||||
const featuredTabs = document.querySelectorAll('input[name="featured_tabs"]');
|
||||
const featuredTabContents = document.querySelectorAll('#featured-tab-contents .tab-content');
|
||||
|
||||
function updateFeaturedTabs() {
|
||||
featuredTabs.forEach(radio => {
|
||||
if (radio.checked) {
|
||||
const target = radio.id;
|
||||
featuredTabContents.forEach(content => {
|
||||
content.style.display = content.getAttribute('data-tab') === target ? 'block' : 'none';
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
featuredTabs.forEach(radio => {
|
||||
radio.addEventListener('change', updateFeaturedTabs);
|
||||
});
|
||||
|
||||
// Initialize tabs on page load
|
||||
updateFeaturedTabs();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
.tabs-box .tab {
|
||||
z-index: 1;
|
||||
}
|
||||
.tabs-box .tab:checked,
|
||||
.tabs-box .tab.active {
|
||||
z-index: 2;
|
||||
background-color: var(--color-base-200);
|
||||
accent-color: var(--color-base-200);
|
||||
}
|
||||
.tabs-box .tab:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
|
@ -1,19 +1,13 @@
|
|||
{% load trade_offer_tags pagination_tags %}
|
||||
{% comment %}
|
||||
This snippet renders a grid of trade offer cards (or acceptance cards) along with pagination controls.
|
||||
For a TradeOffer, we use {% render_trade_offer %}; for a TradeAcceptance, {% render_trade_acceptance %}.
|
||||
{% endcomment %}
|
||||
|
||||
<div class="flex flex-row gap-6 md:gap-2 lg:gap-6 flex-wrap justify-center items-start py-6">
|
||||
<div class="flex flex-row gap-6 md:gap-2 lg:gap-6 flex-wrap justify-center py-6">
|
||||
{% for offer in offers %}
|
||||
<div class="flex flex-none">
|
||||
{% if offer.accepted_by %}
|
||||
{# Render a trade acceptance using our new tag #}
|
||||
{% render_trade_acceptance offer %}
|
||||
{% else %}
|
||||
{% render_trade_offer offer %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<div>No trade offers available.</div>
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
Hello {{ recipient_user }},
|
||||
|
||||
Great news! {{ acting_user }} ({{ acting_user_friend_code }}) has accepted your trade offer.
|
||||
|
||||
Trade Details:
|
||||
- #{{ hash }}
|
||||
- They are offering: {{ want_card }}
|
||||
- They want: {{ has_card }}
|
||||
|
||||
What's next? You can now mark the trade as "Sent" once you've offered the card to them in the app, or reject the trade if needed.
|
||||
|
||||
Visit your dashboard to manage this trade:
|
||||
{% url 'dashboard' %}
|
||||
|
||||
Happy trading!
|
||||
PKMN Trade Club
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
Hello {{ recipient_user }},
|
||||
|
||||
{{ acting_user }} ({{ acting_user_friend_code }}) has marked your trade as "Received".
|
||||
|
||||
Trade Details:
|
||||
- #{{ hash }}
|
||||
- Card you sent: {{ has_card }}
|
||||
- Card they offered: {{ want_card }}
|
||||
|
||||
What's next? Send a thank you to this user to increase their reputation!
|
||||
|
||||
Visit your dashboard to send thanks:
|
||||
{% url 'dashboard' %}
|
||||
|
||||
Happy trading!
|
||||
PKMN Trade Club
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
Hello {{ recipient_user }},
|
||||
|
||||
{{ acting_user }} ({{ acting_user_friend_code }}) has marked your trade as "Sent".
|
||||
|
||||
Trade Details:
|
||||
- #{{ hash }}
|
||||
- Card being sent to you: {{ has_card }}
|
||||
- Card you're offering: {{ want_card }}
|
||||
|
||||
What's next? Once you respond to the trade in the app, please mark the trade as "Received" in your dashboard.
|
||||
|
||||
Visit your dashboard to manage this trade:
|
||||
{% url 'dashboard' %}
|
||||
|
||||
Happy trading!
|
||||
PKMN Trade Club
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
Hello {{ recipient_user }},
|
||||
|
||||
{{ acting_user }} ({{ acting_user_friend_code }}) has sent their thanks for the successful trade!
|
||||
|
||||
Trade Details:
|
||||
- #{{ hash }}
|
||||
- Card {% if is_initiator %}you{% else %}they{% endif %} sent: {{ has_card }}
|
||||
- Card {% if is_initiator %}they{% else %}you{% endif %} offered: {{ want_card }}
|
||||
|
||||
This trade is now completed; no further actions can be made.
|
||||
|
||||
Thank you for using PKMN Trade Club.
|
||||
|
||||
Happy trading!
|
||||
PKMN Trade Club
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<span class="text-sm font-semibold text-center">Wants</span>
|
||||
</div>
|
||||
<div class="absolute inset-x-0 top-1/2 transform -translate-y-1/2 flex justify-center">
|
||||
<div class="avatar tooltip tooltip-top" data-tip="{{ initiated_by_username }} | {{ initiated_reputation }}">
|
||||
<div class="avatar tooltip tooltip-top" data-tip="{{ initiated_by_username }} | {{ initiated_reputation }} rep">
|
||||
<div class="w-10 rounded-full">
|
||||
{{ initiated_by_email|gravatar:40 }}
|
||||
</div>
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
<span class="text-sm font-semibold text-center">Wants</span>
|
||||
</div>
|
||||
<div class="absolute inset-x-0 top-1/2 transform -translate-y-1/2 flex justify-center">
|
||||
<div class="avatar">
|
||||
<div class="avatar tooltip tooltip-top" data-tip="{{ initiated_by_username }} | {{ initiated_reputation }} rep">
|
||||
<div class="w-10 rounded-full">
|
||||
{{ initiated_by_email|gravatar:40 }}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue