From 34667b28d1574f6e256790ceb98d0e0d46692d1f Mon Sep 17 00:00:00 2001 From: Christopher Blake Date: Tue, 5 Dec 2023 12:57:22 -0400 Subject: [PATCH] feat: strikeout pledged items (#107) * strikeout pledged items * strikethrough in legacy card mode * added by user fix in card view * add strike through for non url items * make wishlish name language specific * only strike when not your list --- src/views/wishlist.pug | 53 +++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/src/views/wishlist.pug b/src/views/wishlist.pug index 039d7dd..dada33f 100644 --- a/src/views/wishlist.pug +++ b/src/views/wishlist.pug @@ -39,14 +39,27 @@ block content figure(style='width: 100%; margin: 0;') img(src=item.image, style='width: 100%; max-height: 20em; object-fit: contain;') if item.url - td.ugc(data-label='Name') - a( - href=item.url, - rel='noopener noreferrer', - target='_blank' - )= (item.name ? item.name : item.url) + td.ugc(data-label=lang('WISHLIST_NAME')) + if item.pledgedBy && item.addedBy != req.user._id + strike + a( + href=item.url, + rel='noopener noreferrer', + target='_blank' + )= (item.name ? item.name : item.url) + else + a( + href=item.url, + rel='noopener noreferrer', + target='_blank' + )= (item.name ? item.name : item.url) else - td.ugc(data-label=lang('WISHLIST_NAME'))= item.name + td.ugc(data-label='Name') + if item.pledgedBy + strike + span= item.name + else + span= item.name if _CC.config.wishlist.note.markdown td.ugc(data-label=lang('WISHLIST_NOTE')) div!= item.note @@ -143,13 +156,25 @@ block content if item.price span= ' ' if item.url - a( - href=item.url, - rel='noopener noreferrer', - target='_blank' - )= (item.name ? item.name : item.url) + if item.pledgedBy && item.addedBy != req.user._id + strike + a( + href=item.url, + rel='noopener noreferrer', + target='_blank' + )= (item.name ? item.name : item.url) + else + a( + href=item.url, + rel='noopener noreferrer', + target='_blank' + )= (item.name ? item.name : item.url) else - span= item.name + if item.pledgedBy + strike + span= item.name + else + span= item.name hr if item.note || item.image .columns @@ -163,7 +188,7 @@ block content style='height: 100%;' readonly )= item.note - span.overflowWrap=lang('WISHLIST_ADDED_BY', item.addedBy) + span.overflowWrap=lang('WISHLIST_ADDED_BY_USER', item.addedBy) hr div if req.params.user !== req.user._id && !item.pledgedBy