Permalink
Browse files

Added Error handling and messages.

  • Loading branch information...
1 parent b209734 commit ad395e8176125f2434bc8a0d9727eaa4abebe8b6 @shaunsmith shaunsmith committed Mar 24, 2013
@@ -32,5 +32,6 @@
}
.button-group {
float: right;
+ font-weight: normal;
}
@@ -15,57 +15,63 @@
<div class="row-fluid">
<div class="span6 offset1">
- <div class="row-fluid">
+ <div class="row-fluid" ng-show="error">
+ <h3 class="form-h3">Delete Employee?</h3>
+ <div class="alert alert-error">{{error}}</div>
+ <a href='#/home' class='btn'>Ok</a>
+ </div>
+ <div ng-hide="error">
+ <div class="row-fluid">
<h3 class="form-h3">
Delete Employee?
<div class="button-group">
- <button ng-click='confirm()' class='button-small'>Ok</button>
- <button ng-click='cancel()' class='button-small'>Cancel</button>
+ <button class='btn' ng-click='confirm()'>Ok</button>
+ <a href='#/home' class='btn'>Cancel</a>
</div>
</h3>
- </div>
- <div class="row-fluid">
- <form class="form-horizontal span12">
- <div class="control-group">
- <label class="control-label">Id</label>
- <div class="controls">
- <input type="text" ng-model='employee.id' disabled />
+ </div>
+ <div class="row-fluid">
+ <form class="form-horizontal span12">
+ <div class="control-group">
+ <label class="control-label">Id</label>
+ <div class="controls">
+ <input type="text" ng-model='employee.id' disabled />
+ </div>
</div>
- </div>
- <div class="control-group">
- <label class="control-label">First Name</label>
- <div class="controls">
- <input type="text" ng-model='employee.firstName' disabled />
+ <div class="control-group">
+ <label class="control-label">First Name</label>
+ <div class="controls">
+ <input type="text" ng-model='employee.firstName' disabled />
+ </div>
</div>
- </div>
- <div class="control-group">
- <label class="control-label">Last Name</label>
- <div class="controls">
- <input type="text" ng-model='employee.lastName' disabled />
+ <div class="control-group">
+ <label class="control-label">Last Name</label>
+ <div class="controls">
+ <input type="text" ng-model='employee.lastName' disabled />
+ </div>
</div>
- </div>
- <div class="control-group">
- <label class="control-label">Gender</label>
- <div class="controls">
- <select ng-model="employee.gender" disabled>
- <option value="Female">Female</option>
- <option value="Male">Male</option>
- </select>
+ <div class="control-group">
+ <label class="control-label">Gender</label>
+ <div class="controls">
+ <select ng-model="employee.gender" disabled>
+ <option value="Female">Female</option>
+ <option value="Male">Male</option>
+ </select>
+ </div>
</div>
- </div>
- <div class="control-group">
- <label class="control-label">Salary</label>
- <div class="controls">
- <div class="input-prepend">
- <span class="add-on">$</span> <input type="text"
- ng-model='employee.salary' disabled />
+ <div class="control-group">
+ <label class="control-label">Salary</label>
+ <div class="controls">
+ <div class="input-prepend">
+ <span class="add-on">$</span> <input type="text"
+ ng-model='employee.salary' disabled />
+ </div>
</div>
</div>
- </div>
- </form>
+ </form>
+ </div>
</div>
</div>
- <!--/span-->
<div class="span4 offset1">
<div class="aside">
<img src='resources/images/eclipselink-logo.png' alt='EclipseLink'
@@ -15,125 +15,133 @@
<div class="row-fluid">
<div class="span6 offset1">
- <div class="row-fluid">
+ <div class="row-fluid" ng-show="error">
+ <h3 class="form-h3">Employee</h3>
+ <div class="alert alert-error">{{error}}</div>
+ <a href='#/home' class='btn'>Ok</a>
+ </div>
+ <div ng-hide="error">
+ <div class="row-fluid">
<h3 class="form-h3">
Employee
<div class="button-group">
- <button ng-click='save()'>Save</button>
- <button ng-show='removeEnabled' ng-click='remove()'>Delete</button>
- <button ng-click='cancel()'>Cancel</button>
+ <button class='btn' ng-click='save()'>Save</button>
+ <button class='btn' ng-show='removeEnabled' ng-click='remove()'>Delete</button>
+ <a href='#/home' class='btn'>Cancel</a>
</div>
</h3>
- </div>
+ </div>
- <div class="row-fluid">
- <form class="form-horizontal">
- <div class="control-group">
- <label class="control-label">Id</label>
- <div class="controls">
- <input type="text" ng-model='employee.id' disabled />
+ <div class="row-fluid">
+ <form class="form-horizontal">
+ <div class="control-group">
+ <label class="control-label">Id</label>
+ <div class="controls">
+ <input type="text" ng-model='employee.id' disabled />
+ </div>
</div>
- </div>
- <div class="control-group">
- <label class="control-label">First Name</label>
- <div class="controls">
- <input type="text" ng-model='employee.firstName' />
+ <div class="control-group">
+ <label class="control-label">First Name</label>
+ <div class="controls">
+ <input type="text" ng-model='employee.firstName' />
+ </div>
</div>
- </div>
- <div class="control-group">
- <label class="control-label">Last Name</label>
- <div class="controls">
- <input type="text" ng-model='employee.lastName' />
+ <div class="control-group">
+ <label class="control-label">Last Name</label>
+ <div class="controls">
+ <input type="text" ng-model='employee.lastName' />
+ </div>
</div>
- </div>
- <div class="control-group">
- <label class="control-label">Gender</label>
- <div class="controls">
- <select ng-model="employee.gender">
- <option value="Female">Female</option>
- <option value="Male">Male</option>
- </select>
+ <div class="control-group">
+ <label class="control-label">Gender</label>
+ <div class="controls">
+ <select ng-model="employee.gender">
+ <option value="Female">Female</option>
+ <option value="Male">Male</option>
+ </select>
+ </div>
</div>
- </div>
- <div class="control-group">
- <label class="control-label">Salary</label>
- <div class="controls">
- <div class="input-prepend">
- <span class="add-on">$</span> <input type="text"
- ng-model='employee.salary' />
+ <div class="control-group">
+ <label class="control-label">Salary</label>
+ <div class="controls">
+ <div class="input-prepend">
+ <span class="add-on">$</span> <input type="text"
+ ng-model='employee.salary' />
+ </div>
</div>
</div>
- </div>
- </form>
- </div>
- <div class="row-fluid">
+ </form>
+ </div>
+ <div class="row-fluid">
<h4 class="form-h4">
Address
- <button class="button-group" ng-hide='address'
+ <button class="button-group btn btn-small" ng-hide='address'
ng-click='addAddress()'>Add</button>
</h4>
- </div>
- <div class="row-fluid" ng-show="address">
- <form class="form-horizontal">
- <div class="control-group">
- <label class="control-label">Street</label>
- <div class="controls">
- <input type="text" ng-model='address.street' />
- </div>
- </div>
- <div class="control-group">
- <label class="control-label">City</label>
- <div class="controls">
- <input type="text" ng-model='address.city' />
- </div>
- </div>
- <div class="control-group">
- <label class="control-label">Country</label>
- <div class="controls">
- <input type="text" ng-model='address.country' />
- </div>
- </div>
- <div class="control-group">
- <div class="controls">
- <button 'ng-show='address' ng-click='removeAddress()'>Remove</button>
- </div>
- </div>
- </form>
- </div>
- <div class="row-fluid">
- <h4 class="form-h4">
- Phone Numbers
- <button class="button-group" ng-click='addPhone()'>Add</button>
- </h4>
- </div>
- <div class="row-fluid" ng-show='phoneNumbers.length'>
- <form class="form-horizontal">
- <div ng-repeat='phoneNumber in phoneNumbers'>
+ </div>
+ <div class="row-fluid" ng-show="address">
+ <form class="form-horizontal">
<div class="control-group">
- <label class="control-label">Type</label>
+ <label class="control-label">Street</label>
<div class="controls">
- <input type="text" ng-model='phoneNumber.type' />
+ <input type="text" ng-model='address.street' />
</div>
</div>
<div class="control-group">
- <label class="control-label">Area Code</label>
+ <label class="control-label">City</label>
<div class="controls">
- <input type="text" ng-model='phoneNumber.areaCode' />
+ <input type="text" ng-model='address.city' />
</div>
</div>
<div class="control-group">
- <label class="control-label">Number</label>
+ <label class="control-label">Country</label>
<div class="controls">
- <input type="text" ng-model='phoneNumber.number' />
+ <input type="text" ng-model='address.country' />
</div>
</div>
<div class="control-group">
<div class="controls">
- <button ng-click='removePhone($index)'>Remove</button>
+ <button class='btn btn-small' ng-show='address'
+ ng-click='removeAddress()'>Remove</button>
+ </div>
+ </div>
+ </form>
+ </div>
+ <div class="row-fluid">
+ <h4 class="form-h4">
+ Phone Numbers
+ <button class="button-group btn btn-small" ng-click='addPhone()'>Add</button>
+ </h4>
+ </div>
+ <div class="row-fluid" ng-show='phoneNumbers.length'>
+ <form class="form-horizontal">
+ <div ng-repeat='phoneNumber in phoneNumbers'>
+ <div class="control-group">
+ <label class="control-label">Type</label>
+ <div class="controls">
+ <input type="text" ng-model='phoneNumber.type' />
+ </div>
+ </div>
+ <div class="control-group">
+ <label class="control-label">Area Code</label>
+ <div class="controls">
+ <input type="text" ng-model='phoneNumber.areaCode' />
+ </div>
+ </div>
+ <div class="control-group">
+ <label class="control-label">Number</label>
+ <div class="controls">
+ <input type="text" ng-model='phoneNumber.number' />
+ </div>
+ </div>
+ <div class="control-group">
+ <div class="controls">
+ <button class='btn btn-small' ng-click='removePhone($index)'>Remove</button>
+ </div>
</div>
</div>
- </div>
- </form>
+ </form>
+ </div>
</div>
</div>
<div class="span4">
@@ -147,10 +155,10 @@ <h3>Creating and Updating Resources</h3>
<p>A PUT uses the URI of the resource and a payload containing
the changed resource in either XML or JSON.</p>
<p>A POST uses the URI of the resource type without the resource
- id. If the payload object doesn't contain an id one will be created by EclipseLink
- using the generation mechanism specified in the JPA mappings.
- If the payload object does have an id a POST will not use id generation.
- </p>
+ id. If the payload object doesn't contain an id one will be created
+ by EclipseLink using the generation mechanism specified in the JPA
+ mappings. If the payload object does have an id a POST will not use
+ id generation.</p>
</div>
</div>
</div>
Oops, something went wrong.

0 comments on commit ad395e8

Please sign in to comment.