diff --git a/src/main/webapp/components/_partials/_modal_add_owner.html b/src/main/webapp/components/_partials/_modal_add_owner.html
index fa1b44c7a..257a4c560 100644
--- a/src/main/webapp/components/_partials/_modal_add_owner.html
+++ b/src/main/webapp/components/_partials/_modal_add_owner.html
@@ -130,11 +130,11 @@
- View as
+ View as
-
\ No newline at end of file
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/components/pets/PetController.js b/src/main/webapp/components/pets/PetController.js
index fb9c894f3..3f2eff547 100644
--- a/src/main/webapp/components/pets/PetController.js
+++ b/src/main/webapp/components/pets/PetController.js
@@ -5,15 +5,23 @@ var PetController = ['$scope', 'Pet', function($scope, Pet) {
scrollTop: $("#pets").offset().top
}, 1000);
});
-
+
$scope.pets = Pet.query();
-
+
}];
-var AddPetController = ['$scope','$rootScope','PetType','Pet',function($scope,$rootScope,PetType,Pet) {
+var AddPetController = ['$scope','$rootScope','PetType','OwnerPet',function($scope,$rootScope,PetType,OwnerPet) {
$scope.petTypes = PetType.query();
-
+ $scope.currentPet = {type:{}};
+
$scope.save = function(){
- Pet.$save($scope.currentPet);
+ currentOwnerId = $scope.currentOwner.id;
+
+ for (i=0; i<$scope.petTypes.length; i++){
+ if ($scope.petTypes[i].id == $scope.currentPet.type.id){
+ $scope.currentPet.type.name = $scope.petTypes[i].name;
+ }
+ }
+ OwnerPet.save({ownerId:currentOwnerId},$scope.currentPet);
};
}];
\ No newline at end of file
diff --git a/src/main/webapp/images/avatars/owner11.jpg b/src/main/webapp/images/avatars/owner11.jpg
new file mode 100644
index 000000000..2458a42b4
Binary files /dev/null and b/src/main/webapp/images/avatars/owner11.jpg differ
diff --git a/src/main/webapp/images/avatars/owner12.jpg b/src/main/webapp/images/avatars/owner12.jpg
new file mode 100644
index 000000000..409db1437
Binary files /dev/null and b/src/main/webapp/images/avatars/owner12.jpg differ
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html
index 07e4df255..5d58cba13 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.html
@@ -21,12 +21,6 @@
-
-
-
-
-
-
@@ -44,7 +38,7 @@
-
+
diff --git a/src/main/webapp/js/app.js b/src/main/webapp/js/app.js
index dbc315d45..3083b7074 100644
--- a/src/main/webapp/js/app.js
+++ b/src/main/webapp/js/app.js
@@ -9,9 +9,9 @@ app.constant('context', '/petclinic');
app.config(['stateHelperProvider','$urlRouterProvider','$urlMatcherFactoryProvider',function(stateHelperProvider,$urlRouterProvider,$urlMatcherFactoryProvider) {
$urlRouterProvider.otherwise("/");
-
+
$urlMatcherFactoryProvider.strictMode(false)
-
+
stateHelperProvider.state({
name: "landing",
url: "/",
@@ -49,7 +49,7 @@ app.config(['stateHelperProvider','$urlRouterProvider','$urlMatcherFactoryProvid
controller: "OwnerDetailsController",
data: {requireLogin : true}
});
-
+
} ]);
/** Controllers **/
@@ -67,6 +67,7 @@ app.controller('SearchController', SearchController);
/** Services **/
app.factory('Owner', Owner);
app.factory('Pet', Pet);
+app.factory('OwnerPet', OwnerPet);
app.factory('Vet', Vet);
app.factory('Visit', Visit);
app.factory('PetType', PetType);
@@ -79,7 +80,7 @@ app.directive('scrollToTarget', function() {
element.bind('click', function() {
angular.element('html, body').stop().animate({
scrollTop: angular.element(angular.element(element).attr('href')).offset().top - 20
- }, 1500);
+ }, 1500);
return false;
});
};