mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:35:50 +00:00
TN: Disable the fields that not supported and refresh owner pet after adding
This commit is contained in:
parent
a5fa3431e8
commit
87c47c6fce
3 changed files with 12 additions and 10 deletions
|
@ -33,17 +33,17 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="occupation">Occupation</label>
|
<label for="occupation">Occupation</label>
|
||||||
<input type="text" class="form-control" id="occupation">
|
<input type="text" class="form-control" id="occupation" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="company">Company</label>
|
<label for="company">Company</label>
|
||||||
<input type="text" class="form-control" id="company">
|
<input type="text" class="form-control" id="company" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="birthDate">Birth Date</label>
|
<label for="birthDate">Birth Date</label>
|
||||||
<input type="text" class="form-control" id="birthDate">
|
<input type="text" class="form-control" id="birthDate" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="address">Address</label>
|
<label for="address">Address</label>
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="email">Email</label>
|
<label for="email">Email</label>
|
||||||
<input type="text" class="form-control" id="email">
|
<input type="text" class="form-control" id="email" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8 col-md-offset-2">
|
<div class="col-md-8 col-md-offset-2">
|
||||||
|
@ -142,17 +142,17 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="occupation">Occupation</label>
|
<label for="occupation">Occupation</label>
|
||||||
<input type="text" class="form-control" id="occupation" value="Accountant">
|
<input type="text" class="form-control" id="occupation" value="Accountant" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="company">Company</label>
|
<label for="company">Company</label>
|
||||||
<input type="text" class="form-control" id="company" value="Ledger Associates">
|
<input type="text" class="form-control" id="company" value="Ledger Associates" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="birthDate">Birth Date</label>
|
<label for="birthDate">Birth Date</label>
|
||||||
<input type="text" class="form-control" id="birthDate" value="04 Feb 1988">
|
<input type="text" class="form-control" id="birthDate" value="04 Feb 1988" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="address">Address</label>
|
<label for="address">Address</label>
|
||||||
|
@ -168,7 +168,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="email">Email</label>
|
<label for="email">Email</label>
|
||||||
<input type="text" class="form-control" id="email" value="maria.escobito@gmail.com">
|
<input type="text" class="form-control" id="email" value="maria.escobito@gmail.com" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8 col-md-offset-2">
|
<div class="col-md-8 col-md-offset-2">
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="birthDate">Birth Date</label>
|
<label for="birthDate">Birth Date</label>
|
||||||
<input type="text" class="form-control" id="birthDate" data-ng-model="currentPet.birthDate">
|
<input type="text" class="form-control" id="birthDate" data-ng-model="currentPet.birthDate" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="type">Type</label>
|
<label for="type">Type</label>
|
||||||
|
|
|
@ -22,6 +22,8 @@ var AddPetController = ['$scope','$rootScope','PetType','OwnerPet',function($sco
|
||||||
$scope.currentPet.type.name = $scope.petTypes[i].name;
|
$scope.currentPet.type.name = $scope.petTypes[i].name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OwnerPet.save({ownerId:currentOwnerId},$scope.currentPet);
|
OwnerPet.save({ownerId:currentOwnerId},$scope.currentPet, function(pet) {
|
||||||
|
$scope.currentOwner.pets.push(pet);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}];
|
}];
|
Loading…
Reference in a new issue