Doplneno presouvani polozek
This commit is contained in:
+4
-1
@@ -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);
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
<th>Koupeno</th>
|
||||
<th>Jméno</th>
|
||||
<th>Cena</th>
|
||||
<% if (budgetGroups.length > 1) { %>
|
||||
<th>Přesunout</th>
|
||||
<% } %>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -32,6 +35,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<% if (budgetGroups.length > 1) { %>
|
||||
<td>
|
||||
<select name="move_group[<%= i %>]" class="form-control group-select">
|
||||
<% for (var g in budgetGroups) { %>
|
||||
<option value="<%= g %>"
|
||||
<% if (g == id) { %> selected
|
||||
<% } %>
|
||||
><%= budgetGroups[g].name %></option>
|
||||
<% } %>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
<% } %>
|
||||
|
||||
<td class="text-right">
|
||||
<a href="javascript:void(0);" data-href="/budget/group/<%= id %>/<%= i %>/delete" class="js-delete-button" data-target="tr">
|
||||
<i class="fa fa-trash"></i>
|
||||
|
||||
Reference in New Issue
Block a user