update owner creation ui

This commit is contained in:
Dapeng 2016-09-19 17:10:49 +08:00
parent a481ee4a8e
commit c77f86a72d
3 changed files with 40 additions and 39 deletions

View file

@ -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
}
/**

View file

@ -1,37 +1,45 @@
<div class="container">
<h2>Owner</h2>
<form class="form-horizontal" name="ownerForm" data-ng-controller="ownerFormController">
<fieldset>
<div class="control-group" id="firstName">
<label class="control-label">First name </label>
<input ng-model="owner.firstName" name="firstName" required/>
<div class="form-group">
<label class="col-sm-2 control-label">First name</label>
<div class="col-sm-4">
<input class="form-control" ng-model="owner.firstName" name="firstName" required/>
<span ng-show="ownerForm.firstName.$error.required" class="help-inline">First name is required.</span>
</div>
<div class="control-group" id="lastName">
<label class="control-label">Last name </label>
<input ng-model="owner.lastName" name="lastName" required/>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Last name</label>
<div class="col-sm-4">
<input class="form-control" ng-model="owner.lastName" name="lastName" required/>
<span ng-show="ownerForm.lastName.$error.required" class="help-inline">Last name is required.</span>
</div>
<div class="control-group" id="address">
<label class="control-label">Address </label>
<input ng-model="owner.address" name="address" required/>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Address</label>
<div class="col-sm-4">
<input class="form-control" ng-model="owner.address" name="address" required/>
<span ng-show="ownerForm.address.$error.required" class="help-inline">Address is required.</span>
</div>
<div class="control-group" id="city">
<label class="control-label">City </label>
<input ng-model="owner.city" name="city" required/>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">City</label>
<div class="col-sm-4">
<input class="form-control" ng-model="owner.city" name="city" required/>
<span ng-show="ownerForm.city.$error.required" class="help-inline">City is required.</span>
</div>
<div class="control-group" id="telephone">
<label class="control-label">Telephone </label>
<input ng-model="owner.telephone" name="telephone" required/>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Telephone</label>
<div class="col-sm-4">
<input class="form-control" ng-model="owner.telephone" name="telephone" required/>
<span ng-show="ownerForm.telephone.$error.required" class="help-inline">Telephone is required.</span>
</div>
<div class="form-actions">
<button type="submit" ng-click="submitOwnerForm()">Submit</button>
</div>
</fieldset>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-4">
<button class="btn btn-primary" type="submit" ng-click="submitOwnerForm()">Submit</button>
</div>
</div>
</form>
</div>

View file

@ -1,15 +1,9 @@
<h2>Find Owners</h2>
<form class="form-horizontal" ng-controller="ownerSearchController">
<fieldset>
<div class="control-group" id="lastName">
<label class="control-label">Last name </label>
<input ng-model="ownerSearchForm.lastName" size="30" maxlength="80"/>
<h2>Owners</h2>
<form class="form-inline" ng-controller="ownerSearchController">
<div class="control-group">
<label class="control-label">Last name</label>
<input class="form-control" type="text" ng-model="ownerSearchForm.lastName" size="30" maxlength="80"/>
<button class="btn btn-info" type="submit" ng-click="submitOwnerSearchForm()">Find Owners</button> |
<a class="btn btn-info" ui-sref="app.ownercreate">Add New Owner</a>
</div>
<div class="form-actions">
<button type="submit" ng-click="submitOwnerSearchForm()">Find Owners</button>
</div>
</fieldset>
</form>
<br/>
<a ui-sref="app.ownercreate">Add Owners</a>
</form>