Skip to content

Commit

Permalink
Merge branch 'release/0.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmvrmc committed Sep 1, 2014
2 parents ed8b876 + 317fff9 commit 1c41edf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
12 changes: 10 additions & 2 deletions public/partials/TaxesData/TaxesDataCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ appControllers.controller('TaxesDataCtrl', ['$scope', 'TaxesDataFactory', functi
// check to make sure the form is completely valid
if (isValid) {
TaxesDataFactory.postTax(user).then(function(result){
alert(JSON.stringify(result.data));
alert("Post data: \n" + JSON.stringify(result.data));
});
}
else {
Expand All @@ -20,8 +20,16 @@ appControllers.controller('TaxesDataCtrl', ['$scope', 'TaxesDataFactory', functi
'Solteiro','Casado','Divorciado','Viúvo','Outro'
];

$scope.validateTelefone = function($value){
if($value > 0 || $value ==''){
return true;
} else {
return false;
}
};

$scope.validateNif = function($value){

$scope.validateNif = function($value){
if(typeof $value == "undefined" || $value == ''){
return true;
}
Expand Down
13 changes: 13 additions & 0 deletions public/partials/TaxesData/tax-pessoa.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
</div>
</div>
</div>

<div class='row'>
<!-- TELEFONE -->
<div class="form-group" ng-class="{ 'has-error' : taxForm.telefone.$invalid && !taxForm.telefone.$pristine }">
<div class='col-md-4'>
<label>Telefone</label>
<input type="text" name="telefone" class="form-control" ng-model="user.telefone" ui-validate="'validateTelefone($value)'" novalidate/>
</div>
<div class='col-md-2'>
<p ng-show="taxForm.telefone.$invalid && !taxForm.telefone.$pristine" class="row help-block">Introduza um telefone válido.</p>
</div>
</div>
</div>


<div class='row'>
Expand Down
2 changes: 1 addition & 1 deletion server/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
</head>
<body ng-app="App">
<div class='container-fluid'>
<div class='container'>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
Expand Down

0 comments on commit 1c41edf

Please sign in to comment.