From 48dce2c5c4d8f2d30869db90433b7bcc89628d82 Mon Sep 17 00:00:00 2001 From: Wingy Date: Mon, 3 Oct 2022 11:03:09 -0400 Subject: [PATCH] add pledge logic --- languages/en-us.js | 1 + views/wishlist.pug | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/languages/en-us.js b/languages/en-us.js index 4e2d180..2449125 100644 --- a/languages/en-us.js +++ b/languages/en-us.js @@ -160,6 +160,7 @@ module.exports.strings = { WISHLIST_PLEDGE_SUCCESS: 'Successfully pledged for item!', WISHLIST_PLEDGE: 'Pledge', WISHLIST_PLEDGED: pledgedBy => `Pledged for by ${pledgedBy}`, + WISHLIST_PLEDGED_GUEST: 'Pledged for by a guest user', WISHLIST_PRICE: 'Price', WISHLIST_REFRESH_GUARD: 'Invalid user', WISHLIST_REFRESH_NO_URL: 'Item has no URL.', diff --git a/views/wishlist.pug b/views/wishlist.pug index 6b2e5c1..1668d42 100644 --- a/views/wishlist.pug +++ b/views/wishlist.pug @@ -113,7 +113,10 @@ block content .control.inline input.inline.button(type='submit' value=lang('WISHLIST_UNPLEDGE')) if item.pledgedBy && item.pledgedBy !== req.user._id - span.ugc=lang('WISHLIST_PLEDGED', item.pledgedBy) + if item.pledgedBy === '_CCUNKNOWN' + span.ugc=lang('WISHLIST_PLEDGED_GUEST') + else + span.ugc=lang('WISHLIST_PLEDGED', item.pledgedBy) td(data-label='Delete Item') form.inline( method='POST',