Allow moving top one down and bottom one up
This commit is contained in:
parent
53869bcf6c
commit
ddbaf05936
1 changed files with 19 additions and 18 deletions
|
@ -11,30 +11,31 @@ block content
|
||||||
span= item.name
|
span= item.name
|
||||||
div
|
div
|
||||||
if req.params.user !== req.user._id && !item.pledgedBy
|
if req.params.user !== req.user._id && !item.pledgedBy
|
||||||
form(method='POST', action=`/wishlist/${req.params.user}/pledge/${item.id}`)
|
form.inline(method='POST', action=`/wishlist/${req.params.user}/pledge/${item.id}`)
|
||||||
.field
|
.field.inline
|
||||||
.control
|
.control.inline
|
||||||
input.button.is-primary(type='submit' value='Pledge')
|
input.inline.button.is-primary(type='submit' value='Pledge')
|
||||||
if item.pledgedBy === req.user._id
|
if item.pledgedBy === req.user._id
|
||||||
form(method='POST', action=`/wishlist/${req.params.user}/unpledge/${item.id}`)
|
form.inline(method='POST', action=`/wishlist/${req.params.user}/unpledge/${item.id}`)
|
||||||
.field
|
.field.inline
|
||||||
.control
|
.control.inline
|
||||||
input.button(type='submit' value='Unpledge')
|
input.inline.button(type='submit' value='Unpledge')
|
||||||
if req.user._id === req.params.user
|
if req.user._id === req.params.user
|
||||||
form.inline(method='POST', action=`/wishlist/${req.params.user}/remove/${item.id}`)
|
form.inline(method='POST', action=`/wishlist/${req.params.user}/remove/${item.id}`)
|
||||||
.field.inline
|
.field.inline
|
||||||
.control.inline
|
.control.inline
|
||||||
input.inline.button.is-warning(type='submit' value='Remove')
|
input.inline.button.is-warning(type='submit' value='Remove')
|
||||||
- console.log(lastCanSee);
|
if req.user._id === req.params.user
|
||||||
if req.user._id === req.params.user && index !== 0 && index !== lastCanSee
|
if index !== 0
|
||||||
form.inline(method='POST', action=`/wishlist/${req.params.user}/move/up/${item.id}`)
|
form.inline(method='POST', action=`/wishlist/${req.params.user}/move/up/${item.id}`)
|
||||||
.field.inline
|
.field.inline
|
||||||
.control.inline
|
.control.inline
|
||||||
input.inline.button(type='submit' value='Move item up')
|
input.inline.button(type='submit' value='Move item up')
|
||||||
form.inline(method='POST', action=`/wishlist/${req.params.user}/move/down/${item.id}`)
|
if index !== lastCanSee
|
||||||
.field.inline
|
form.inline(method='POST', action=`/wishlist/${req.params.user}/move/down/${item.id}`)
|
||||||
.control.inline
|
.field.inline
|
||||||
input.inline.button(type='submit' value='Move item down')
|
.control.inline
|
||||||
|
input.inline.button(type='submit' value='Move item down')
|
||||||
form(method='POST')
|
form(method='POST')
|
||||||
.field
|
.field
|
||||||
label.label Item URL or Name
|
label.label Item URL or Name
|
||||||
|
|
Loading…
Reference in a new issue