Skip to content

Commit

Permalink
BTC to USD Price in Create Contract
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmabc committed Apr 10, 2015
1 parent b5ce0b7 commit 4f77d3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions html/controllers/contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ angular.module('app')

var modalInstance = $modal.open({
templateUrl: 'partials/modal/addContract.html',
controller: ProductModalInstance,
controller: $scope.ProductModalInstance,
size: size,
backdrop: backdrop,
resolve: {
Expand All @@ -100,6 +100,9 @@ angular.module('app')
},
edit: function() {
return false;
},
scope: function() {
return $scope;
}
}
});
Expand All @@ -121,7 +124,7 @@ angular.module('app')

var modalInstance = $modal.open({
templateUrl: 'partials/modal/addContract.html',
controller: ProductModalInstance,
controller: $scope.ProductModalInstance,
size: size,
backdrop: backdrop,
resolve: {
Expand All @@ -145,9 +148,9 @@ angular.module('app')

};

var ProductModalInstance = function($scope, $modalInstance, contract, edit) {
$scope.ProductModalInstance = function($scope, $modalInstance, contract, edit, scope) {

console.log(edit);
console.log('Last USD Price: ', scope.$parent.last_price_usd);

if(edit) {
contract = contract.contract;
Expand All @@ -174,6 +177,7 @@ angular.module('app')
$scope.contract.productShippingPrice = 0;
$scope.contract.remoteImages = [];
$scope.edit = false;
$scope.last_price_usd = scope.$parent.last_price_usd;
}

console.log($scope.contract);
Expand Down
6 changes: 3 additions & 3 deletions html/partials/modal/addContract.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ <h3>Import contract</h3>
</div>

<div class="row">
<div class="col-sm-2">
<div class="col-sm-3">
<div class="form-group {{newContractForm.inputProductPrice.$invalid ? 'has-error' : ''}}">
<label class="control-label" for="inputProductPrice">Price (&#3647;)</label>
<label class="control-label" for="inputProductPrice">Price (${{last_price_usd*contract.productPrice | number:2}} USD)</label>
<!--<number-only-input input-value="contract.productPrice" input-name="inputProductPrice"/>-->
<input required type="text" min="0" class="form-control" ng-model="contract.productPrice" id="inputProductPrice" name="inputProductPrice" placeholder="0.01"/>
</div>
Expand All @@ -59,7 +59,7 @@ <h3>Import contract</h3>
<input type="number" class="form-control" ng-model="contract.productQuantity" name="inputProductQuantity" id="inputProductQuantity" min="1" value="1"/>
</div>
</div>
<div class="col-sm-6">
<div class="col-sm-5">
<label for="inputProductCondition">Condition</label>
<select class="form-control" id="inputProductCondition" ng-model="contract.productCondition">
<option value="New" selected="selected">New</option>
Expand Down

0 comments on commit 4f77d3d

Please sign in to comment.