From 11e2af96be6fa24a7cb70b7ec57e06a93aa3af4f Mon Sep 17 00:00:00 2001 From: Victor Bodinaud Date: Thu, 27 Feb 2025 15:16:25 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BFix=20reward?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 2740982..36dff74 100644 --- a/public/index.html +++ b/public/index.html @@ -564,6 +564,25 @@ dateStr = date.toLocaleDateString('fr-FR', { year: 'numeric', month: 'short', day: 'numeric' }); } + let rewardName = ''; + if (contributor.latest_project_order && + contributor.latest_project_order.items && + contributor.latest_project_order.items.length > 0) { + + const item = contributor.latest_project_order.items[0]; + + if (item.reward && item.reward.parent && item.reward.parent.title) { + rewardName = item.reward.parent.title.fr || + item.reward.parent.title.en || + Object.values(item.reward.parent.title)[0] || ''; + + // Ajouter la variante si elle existe + if (item.reward.description_fr) { + rewardName += ` (${item.reward.description_fr})`; + } + } + } + const avatarUrl = contributor.avatar || 'https://s3-eu-west-1.amazonaws.com/com.ulule.assets/site/build/img/avatars/avatar-blue.png'; html += ` @@ -574,7 +593,7 @@ ${contributor.name}
${contributor.name || 'Contributeur anonyme'}
- ${contributor.reward ? `
${contributor.reward}
` : ''} + ${rewardName ? `
${rewardName}
` : ''} ${contributor.location ? `
${contributor.location}
` : ''} ${dateStr ? `
Depuis le ${dateStr}
` : ''}