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
This commit is contained in:
Christopher Blake 2023-12-05 12:57:22 -04:00 committed by GitHub
parent 84961b11f7
commit 34667b28d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,14 +39,27 @@ block content
figure(style='width: 100%; margin: 0;') figure(style='width: 100%; margin: 0;')
img(src=item.image, style='width: 100%; max-height: 20em; object-fit: contain;') img(src=item.image, style='width: 100%; max-height: 20em; object-fit: contain;')
if item.url if item.url
td.ugc(data-label='Name') td.ugc(data-label=lang('WISHLIST_NAME'))
a( if item.pledgedBy && item.addedBy != req.user._id
href=item.url, strike
rel='noopener noreferrer', a(
target='_blank' href=item.url,
)= (item.name ? item.name : 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 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 if _CC.config.wishlist.note.markdown
td.ugc(data-label=lang('WISHLIST_NOTE')) td.ugc(data-label=lang('WISHLIST_NOTE'))
div!= item.note div!= item.note
@ -143,13 +156,25 @@ block content
if item.price if item.price
span= ' ' span= ' '
if item.url if item.url
a( if item.pledgedBy && item.addedBy != req.user._id
href=item.url, strike
rel='noopener noreferrer', a(
target='_blank' href=item.url,
)= (item.name ? item.name : 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 else
span= item.name if item.pledgedBy
strike
span= item.name
else
span= item.name
hr hr
if item.note || item.image if item.note || item.image
.columns .columns
@ -163,7 +188,7 @@ block content
style='height: 100%;' style='height: 100%;'
readonly readonly
)= item.note )= item.note
span.overflowWrap=lang('WISHLIST_ADDED_BY', item.addedBy) span.overflowWrap=lang('WISHLIST_ADDED_BY_USER', item.addedBy)
hr hr
div div
if req.params.user !== req.user._id && !item.pledgedBy if req.params.user !== req.user._id && !item.pledgedBy