From 7e7f20f80a27358f54cfacd7e04997bd23f337b8 Mon Sep 17 00:00:00 2001 From: Sam Wing Date: Sat, 16 Nov 2019 23:53:17 -0500 Subject: [PATCH] oh im tired --- views/wishlist.pug | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/views/wishlist.pug b/views/wishlist.pug index 45e3c41..c7c7e62 100644 --- a/views/wishlist.pug +++ b/views/wishlist.pug @@ -10,6 +10,8 @@ block content if req.params.user === req.user._id th Move Up th Move Down + else + th Pledge th Delete tbody each item, index in wishlist @@ -59,17 +61,29 @@ block content ) span.icon i.fas.fa-arrow-down - td(data-label='Delete Item') - if item.addedBy === req.user._id - form.inline(method='POST', action=`/wishlist/${req.params.user}/remove/${item.id}`) + else + td(data-label='Pledge') + if req.params.user !== req.user._id && !item.pledgedBy + form.inline(method='POST', action=`/wishlist/${req.params.user}/pledge/${item.id}`) .field.inline .control.inline - button.button.is-text( - type='submit', - style='text-decoration: none;' - ) - span.icon - i.fas.fa-trash + input.inline.button.is-primary(type='submit' value='Pledge') + if item.pledgedBy === req.user._id + form.inline(method='POST', action=`/wishlist/${req.params.user}/unpledge/${item.id}`) + .field.inline + .control.inline + input.inline.button(type='submit' value='Unpledge') + td(data-label='Delete Item') + if item.addedBy === req.user._id + form.inline(method='POST', action=`/wishlist/${req.params.user}/remove/${item.id}`) + .field.inline + .control.inline + button.button.is-text( + type='submit', + style='text-decoration: none;' + ) + span.icon + i.fas.fa-trash else each item, index in wishlist