Skip to content

Commit

Permalink
[NG Basket] Add confirmed col and confirm btn
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Sorcinelli authored and feroda committed Oct 21, 2015
1 parent c040e32 commit 176128b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/e2e/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ describe('GF ng-app', function() {
// get all the column from the first order
var columns = item.$$('td');

// expects to have 8 columns (counting the hidden ones)
// expects to have 9 columns (counting the hidden ones)
expect(columns.count())
.toBe(8);
.toBe(9);

// check the fields
expect(columns.get(0)
Expand Down
8 changes: 8 additions & 0 deletions ui/components/basket/basket.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<th>Prezzo (€)</th>
<th>Quantit&agrave;</th>
<th>Totale</th>
<th scope="col" ng-show="{{!gm.gas.config.gasmember_auto_confirm_order}}" translate> Confirmed </th>
<th style="text-align:center">Cancella</th>
</tr>
</thead>
Expand Down Expand Up @@ -78,6 +79,7 @@
</td>
<td data-title="image" class="tdprod" ng-show="!item.can_update">{{item.quantity}}</td>
<td class="tdprice"> {{item.quantity * item.price|currency:"€"}}</td>
<td ng-show="{{!gm.gas.config.gasmember_auto_confirm_order}}" class="tdprice"> {{ item.is_confirmed }} </td>
<td class="tdprice">
<fieldset ng-show="item.can_update">
<input name="checkbox_{{$index}}" id="checkbox_{{$index}}"
Expand All @@ -96,6 +98,11 @@
<span class="glyphicon glyphicon-shopping-cart" id="glyph-admin" aria-hidden="true"></span>
Aggiungi al paniere
</button>
<button class="btn btn-default btn-lg def-btn" ng-show="{{!gm.gas.config.gasmember_auto_confirm_order}}"
ng-click="basket.confirm()" type="button" id="btn-update" aria-label="Gestione" style="width:200px; margin:auto;" translate>
<span class="glyphicon glyphicon-shopping-cart" id="glyph-update" aria-hidden="true"></span>
Confirm basket
</button>
</td>
<td style="white-space: nowrap; width:20%"> Totale previsto: </td>
<td class="tableprice"> <b>€ {{ basket.pm.getTotal(basket.open_ordered_products) }}</b> </td>
Expand All @@ -112,6 +119,7 @@
<table class="table gas">
<thead>
<tr>

<th scope="col" ng-click="basket.tbd_sorting='order_shortname'; basket.tbd_reverseSort = !basket.tbd_reverseSort">Ordine
<span ng-show="basket.tbd_sorting == 'order_shortname'" class="listorder">
<span ng-show="!basket.tbd_reverseSort"><i class="fa fa-sort-desc"></i></span>
Expand Down
8 changes: 7 additions & 1 deletion ui/components/basket/basket.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ app.controller("BasketController", function ($http, $rootScope, parsingNumbers,
}

$rootScope.active_section = "basket";

this.pm = productManager;
this.gm = $rootScope.gm;
this.dataLoaded = true;
Expand All @@ -22,6 +21,12 @@ app.controller("BasketController", function ($http, $rootScope, parsingNumbers,
this.closed_ordered_products = [];
var THAT = this;

// export the basket scope for debugging
$rootScope.basket_scope = this;

this.confirm = function() {
console.debug('basket.confirm() not implemented yet');
}

this.get_ordered_products_from_basket = function(basket) {
var products = [];
Expand All @@ -44,6 +49,7 @@ app.controller("BasketController", function ($http, $rootScope, parsingNumbers,
step : step_unit,
min_amount : min_amount,
gsop_id : gsop.id,
is_confirmed: gmo.is_confirmed,
enabled: false //flag to __remove__ a product from basket
});
});
Expand Down

0 comments on commit 176128b

Please sign in to comment.