diff --git a/src/app.js b/src/app.js index 89dcfa6..aa2f207 100644 --- a/src/app.js +++ b/src/app.js @@ -277,7 +277,9 @@ app.post ('/budget/add_item_in_group', function (req, res) { var price = req.body.price[i]; var bought = typeof req.body["bought_" + i] == 'undefined' ? false : true; - templateData.budget[group].items.push ({ + var g = typeof req.body.move_group[i] == 'undefined' ? group : req.body.move_group[i]; + + templateData.budget[g].items.push ({ name: itemName, price: price, bought: bought @@ -299,6 +301,7 @@ app.get ('/budget/detail/:id', function (req, res) { var detail = templateData.budget[req.params.id]; detail.id = req.params.id; + detail.budgetGroups = templateData.budget; app.set ('layout', false); diff --git a/src/views/partials/backend/budgetDetail.ejs b/src/views/partials/backend/budgetDetail.ejs index 04f5cfd..b8e81d9 100644 --- a/src/views/partials/backend/budgetDetail.ejs +++ b/src/views/partials/backend/budgetDetail.ejs @@ -5,6 +5,9 @@ Koupeno Jméno Cena + <% if (budgetGroups.length > 1) { %> + Přesunout + <% } %> @@ -32,6 +35,20 @@ + <% if (budgetGroups.length > 1) { %> + + + + + <% } %> +