From c77f86a72d0e21ab4465c29d7c5d6f1376d4b0b2 Mon Sep 17 00:00:00 2001 From: Dapeng Date: Mon, 19 Sep 2016 17:10:49 +0800 Subject: [PATCH] update owner creation ui --- .../samples/petclinic/web/OwnerResource.java | 3 +- .../webapp/scripts/app/owner/ownerForm.html | 52 +++++++++++-------- .../scripts/app/owner/ownerSearchForm.html | 24 ++++----- 3 files changed, 40 insertions(+), 39 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java b/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java index e9cba805c..7024631ca 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java +++ b/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java @@ -64,9 +64,8 @@ public class OwnerResource { */ @RequestMapping(value = "/owner", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) - public void createOwner(@RequestBody Owner owner) { + public void createOwner(@Valid @RequestBody Owner owner) { this.clinicService.saveOwner(owner); - // TODO: need to handle failure } /** diff --git a/src/main/webapp/scripts/app/owner/ownerForm.html b/src/main/webapp/scripts/app/owner/ownerForm.html index 719c0af24..38177f549 100644 --- a/src/main/webapp/scripts/app/owner/ownerForm.html +++ b/src/main/webapp/scripts/app/owner/ownerForm.html @@ -1,37 +1,45 @@
-

Owner

-
-
- - +
+ +
+ First name is required.
-
- - +
+
+ +
+ Last name is required.
-
- - +
+
+ +
+ Address is required.
-
- - +
+
+ +
+ City is required.
-
- - +
+
+ +
+ Telephone is required.
- -
- -
-
+
+
+
+ +
+
diff --git a/src/main/webapp/scripts/app/owner/ownerSearchForm.html b/src/main/webapp/scripts/app/owner/ownerSearchForm.html index 548c452a8..4cd2fac2d 100644 --- a/src/main/webapp/scripts/app/owner/ownerSearchForm.html +++ b/src/main/webapp/scripts/app/owner/ownerSearchForm.html @@ -1,15 +1,9 @@ -

Find Owners

-
-
-
- - -
-
- -
-
-
- -
- Add Owners +

Owners

+
+
+ + + | + Add New Owner +
+
\ No newline at end of file