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 price = req.body.price[i];
|
||||||
var bought = typeof req.body["bought_" + i] == 'undefined' ? false : true;
|
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,
|
name: itemName,
|
||||||
price: price,
|
price: price,
|
||||||
bought: bought
|
bought: bought
|
||||||
@@ -299,6 +301,7 @@ app.get ('/budget/detail/:id', function (req, res) {
|
|||||||
|
|
||||||
var detail = templateData.budget[req.params.id];
|
var detail = templateData.budget[req.params.id];
|
||||||
detail.id = req.params.id;
|
detail.id = req.params.id;
|
||||||
|
detail.budgetGroups = templateData.budget;
|
||||||
|
|
||||||
app.set ('layout', false);
|
app.set ('layout', false);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
<th>Koupeno</th>
|
<th>Koupeno</th>
|
||||||
<th>Jméno</th>
|
<th>Jméno</th>
|
||||||
<th>Cena</th>
|
<th>Cena</th>
|
||||||
|
<% if (budgetGroups.length > 1) { %>
|
||||||
|
<th>Přesunout</th>
|
||||||
|
<% } %>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -32,6 +35,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</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">
|
<td class="text-right">
|
||||||
<a href="javascript:void(0);" data-href="/budget/group/<%= id %>/<%= i %>/delete" class="js-delete-button" data-target="tr">
|
<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>
|
<i class="fa fa-trash"></i>
|
||||||
|
|||||||
Reference in New Issue
Block a user