From 4d59bc23460e622864cd08b19d24ace9570ffb9f Mon Sep 17 00:00:00 2001 From: Victor Bodinaud Date: Thu, 27 Feb 2025 14:57:57 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=90=9B=20Fix=20rewards"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7cdc081227cfc542eea2df6c457a3bf59de3d6f9. --- public/index.html | 66 ++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 47 deletions(-) diff --git a/public/index.html b/public/index.html index 55a384c..2740982 100644 --- a/public/index.html +++ b/public/index.html @@ -510,12 +510,6 @@ const sortedRewards = [...data.rewards].sort((a, b) => a.price - b.price); sortedRewards.forEach(reward => { - // Récupérer le titre localisé (français par défaut, sinon anglais, sinon première langue disponible) - let rewardTitle = ''; - if (reward.title) { - rewardTitle = reward.title.fr || reward.title.en || Object.values(reward.title)[0] || ''; - } - // Calculer le pourcentage pour les récompenses limitées let percentTaken = 0; let stockText = ""; @@ -529,19 +523,19 @@ } html += ` -
-
${formatter.format(reward.price)}
-
${rewardTitle}
-
${reward.description}
-
- ${reward.orders_count} contributeurs - ${stockText} -
- ${reward.stock ? ` -
-
-
` : ''} -
`; +
+
${formatter.format(reward.price)}
+
${reward.title}
+
${reward.description}
+
+ ${reward.orders_count} contributeurs + ${stockText} +
+ ${reward.stock ? ` +
+
+
` : ''} +
`; }); html += ''; @@ -570,47 +564,25 @@ dateStr = date.toLocaleDateString('fr-FR', { year: 'numeric', month: 'short', day: 'numeric' }); } - const avatarUrl = contributor.avatar ? (contributor.avatar['90'] || '') : 'https://s3-eu-west-1.amazonaws.com/com.ulule.assets/site/build/img/avatars/avatar-blue.png'; - - // Extraire le nom de la récompense avec le format title.fr si disponible - 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 += `
- ${contributor.name || 'Contributeur'} + ${contributor.name}
-
${contributor.name || contributor.screenname || 'Contributeur anonyme'}
- ${rewardName ? `
${rewardName}
` : ''} +
${contributor.name || 'Contributeur anonyme'}
+ ${contributor.reward ? `
${contributor.reward}
` : ''} ${contributor.location ? `
${contributor.location}
` : ''} ${dateStr ? `
Depuis le ${dateStr}
` : ''}
- ${contributor.latest_project_order && contributor.latest_project_order.items && contributor.latest_project_order.items[0].line_total ? - `
${formatter.format(contributor.latest_project_order.items[0].line_total)}
` : ''} + ${contributor.amount ? `
${formatter.format(contributor.amount)}
` : ''}
- ${contributor.latest_project_comment && contributor.latest_project_comment.comment ? - `
"${contributor.latest_project_comment.comment}"
` : ''} + ${contributor.comment ? `
"${contributor.comment}"
` : ''}
`; });